File tree Expand file tree Collapse file tree
packages/web/src/features/chat Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ export const getAISDKLanguageModelAndOptions = async (config: LanguageModel): Pr
309309const extractLanguageModelKeyValuePairs = async (
310310 pairs : {
311311 [ k : string ] : string | Token ;
312- }
312+ } | undefined
313313) : Promise < Record < string , string > > => {
314314 const resolvedPairs : Record < string , string > = { } ;
315315
@@ -335,13 +335,7 @@ export const SOURCEBOT_USER_EMAIL_HEADER = 'X-Sourcebot-User-Email';
335335export const resolveLanguageModelHeaders = async (
336336 configuredHeaders : Record < string , string | Token > | undefined ,
337337) : Promise < Record < string , string > | undefined > => {
338- const headers : Record < string , string > = { } ;
339-
340- for ( const [ key , value ] of Object . entries ( configuredHeaders ?? { } ) ) {
341- headers [ key ] = typeof value === 'string'
342- ? value
343- : await getTokenFromConfig ( value ) ;
344- }
338+ const headers = await extractLanguageModelKeyValuePairs ( configuredHeaders ) ;
345339
346340 const userEmail = await ( async ( ) => {
347341 if ( env . SOURCEBOT_LLM_USER_EMAIL_HEADER_ENABLED !== 'true' ) {
You can’t perform that action at this time.
0 commit comments