Skip to content

Commit 567af0c

Browse files
feat: support setting headers via env
1 parent 595fcd0 commit 567af0c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

langsmith-java-core/src/main/kotlin/com/langchain/smith/core/ClientOptions.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,14 @@ private constructor(
457457
(System.getProperty("langchain.langsmithOrganizationId")
458458
?: System.getenv("LANGSMITH_ORGANIZATION_ID"))
459459
?.let { organizationId(it) }
460+
System.getenv("LANGCHAIN_CUSTOM_HEADERS")?.let { customHeadersEnv ->
461+
for (line in customHeadersEnv.split("\n")) {
462+
val colon = line.indexOf(':')
463+
if (colon >= 0) {
464+
putHeader(line.substring(0, colon).trim(), line.substring(colon + 1).trim())
465+
}
466+
}
467+
}
460468
}
461469

462470
/**

0 commit comments

Comments
 (0)