Skip to content

Commit 1c28f65

Browse files
committed
fix: Remove the processing logic of Authorization in openai-compatible to make it compatible with passwords
1 parent 3eb6111 commit 1c28f65

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

src/utils/deep-research/provider.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)