@@ -78,40 +78,20 @@ export async function createAIProvider({
7878 const { createOpenAICompatible } = await import (
7979 "@ai-sdk/openai-compatible"
8080 ) ;
81- const local = global . location || { } ;
8281 const openaicompatible = createOpenAICompatible ( {
8382 name : "openaicompatible" ,
8483 baseURL,
8584 apiKey,
86- fetch : async ( input , init ) => {
87- const headers = ( init ?. headers || { } ) as Record < string , string > ;
88- if ( ! baseURL ?. startsWith ( local . origin ) ) delete headers [ "Authorization" ] ;
89- return await fetch ( input , {
90- ...init ,
91- headers,
92- credentials : "omit" ,
93- } ) ;
94- } ,
9585 } ) ;
9686 return openaicompatible ( model , settings ) ;
9787 } else if ( provider === "pollinations" ) {
9888 const { createOpenAICompatible } = await import (
9989 "@ai-sdk/openai-compatible"
10090 ) ;
101- const local = global . location || { } ;
10291 const pollinations = createOpenAICompatible ( {
10392 name : "pollinations" ,
10493 baseURL,
10594 apiKey,
106- fetch : async ( input , init ) => {
107- const headers = ( init ?. headers || { } ) as Record < string , string > ;
108- if ( ! baseURL ?. startsWith ( local . origin ) ) delete headers [ "Authorization" ] ;
109- return await fetch ( input , {
110- ...init ,
111- headers,
112- credentials : "omit" ,
113- } ) ;
114- } ,
11595 } ) ;
11696 return pollinations ( model , settings ) ;
11797 } else if ( provider === "ollama" ) {
0 commit comments