Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

feat(llm-connections): allow extraHeaders for azure (#5996)

Hassieb Pakzadd50dbed79782
diff --git a/packages/shared/src/server/llm/fetchLLMCompletion.ts b/packages/shared/src/server/llm/fetchLLMCompletion.ts
index cb0b012ed6..fb6122a5f4 100644
--- a/packages/shared/src/server/llm/fetchLLMCompletion.ts
+++ b/packages/shared/src/server/llm/fetchLLMCompletion.ts
@@ -191,6 +191,9 @@ export async function fetchLLMCompletion(
callbacks: finalCallbacks,
maxRetries,
timeout: 1000 * 60 * 2, // 2 minutes timeout
+ configuration: {
+ defaultHeaders: extraHeaders,
+ },
});
} else if (modelParams.adapter === LLMAdapter.Bedrock) {
const { region } = BedrockConfigSchema.parse(config);
diff --git a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
index 2b69e74514..32a09a61fd 100644
--- a/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
+++ b/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx
@@ -409,7 +409,8 @@ export function CreateLLMApiKeyForm({
)}
{/* Extra Headers */}
- {currentAdapter === "openai" ? (
+ {currentAdapter === LLMAdapter.OpenAI ||
+ currentAdapter === LLMAdapter.Azure ? (
<FormField
control={form.control}
name="extraHeaders"