|
@@ -13,6 +13,7 @@ import { convertToR1Format } from "../transform/r1-format"
|
|
|
import { DEEP_SEEK_DEFAULT_TEMPERATURE } from "./constants"
|
|
import { DEEP_SEEK_DEFAULT_TEMPERATURE } from "./constants"
|
|
|
import { getModelParams, SingleCompletionHandler } from ".."
|
|
import { getModelParams, SingleCompletionHandler } from ".."
|
|
|
import { BaseProvider } from "./base-provider"
|
|
import { BaseProvider } from "./base-provider"
|
|
|
|
|
+import { defaultHeaders } from "./openai"
|
|
|
|
|
|
|
|
// Add custom interface for OpenRouter params.
|
|
// Add custom interface for OpenRouter params.
|
|
|
type OpenRouterChatCompletionParams = OpenAI.Chat.ChatCompletionCreateParams & {
|
|
type OpenRouterChatCompletionParams = OpenAI.Chat.ChatCompletionCreateParams & {
|
|
@@ -37,11 +38,6 @@ export class OpenRouterHandler extends BaseProvider implements SingleCompletionH
|
|
|
const baseURL = this.options.openRouterBaseUrl || "https://openrouter.ai/api/v1"
|
|
const baseURL = this.options.openRouterBaseUrl || "https://openrouter.ai/api/v1"
|
|
|
const apiKey = this.options.openRouterApiKey ?? "not-provided"
|
|
const apiKey = this.options.openRouterApiKey ?? "not-provided"
|
|
|
|
|
|
|
|
- const defaultHeaders = {
|
|
|
|
|
- "HTTP-Referer": "https://github.com/RooVetGit/Roo-Cline",
|
|
|
|
|
- "X-Title": "Roo Code",
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
this.client = new OpenAI({ baseURL, apiKey, defaultHeaders })
|
|
this.client = new OpenAI({ baseURL, apiKey, defaultHeaders })
|
|
|
}
|
|
}
|
|
|
|
|
|