mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
feat: add x-anthropic-beta header to OpenRouter requests
This commit is contained in:
parent
fb9c57e1d9
commit
c88f48b45d
2 changed files with 9 additions and 1 deletions
|
|
@ -75,6 +75,7 @@ describe("OpenRouterHandler", () => {
|
|||
"HTTP-Referer": "https://github.com/RooVetGit/Roo-Cline",
|
||||
"X-Title": "Roo Code",
|
||||
"User-Agent": `RooCode/${Package.version}`,
|
||||
"x-anthropic-beta": "fine-grained-tool-streaming-2025-05-14",
|
||||
},
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -72,7 +72,14 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
|
|||
const baseURL = this.options.openRouterBaseUrl || "https://openrouter.ai/api/v1"
|
||||
const apiKey = this.options.openRouterApiKey ?? "not-provided"
|
||||
|
||||
this.client = new OpenAI({ baseURL, apiKey, defaultHeaders: DEFAULT_HEADERS })
|
||||
this.client = new OpenAI({
|
||||
baseURL,
|
||||
apiKey,
|
||||
defaultHeaders: {
|
||||
...DEFAULT_HEADERS,
|
||||
"x-anthropic-beta": "fine-grained-tool-streaming-2025-05-14",
|
||||
},
|
||||
})
|
||||
|
||||
// Load models asynchronously to populate cache before getModel() is called
|
||||
this.loadDynamicModels().catch((error) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue