Skip to content

Commit a0f4112

Browse files
committed
feat: add custom headers support to endpoint inference client
1 parent 6d2f047 commit a0f4112

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib/server/endpoints/inference-client/endpointInferenceClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,13 @@ export const endpointInferenceClientParametersSchema = z.object({
107107
}),
108108
})
109109
.default({}),
110+
customHeaders: z.record(z.string(), z.string()).default({}),
110111
});
111112

112113
export async function endpointInferenceClient(
113114
input: z.input<typeof endpointInferenceClientParametersSchema>
114115
): Promise<Endpoint> {
115-
const { model, provider, modelName, baseURL, multimodal } =
116+
const { model, provider, modelName, baseURL, multimodal, customHeaders } =
116117
endpointInferenceClientParametersSchema.parse(input);
117118

118119
if (!!provider && !!baseURL) {
@@ -255,6 +256,7 @@ export async function endpointInferenceClient(
255256
...options?.headers,
256257
"X-Use-Cache": "false",
257258
"ChatUI-Conversation-ID": conversationId?.toString() ?? "",
259+
...customHeaders,
258260
},
259261
});
260262
},

0 commit comments

Comments
 (0)