refactor: export OPENROUTER_HEADERS from openai-adapters and import in core
Deduplicates the header constants by having a single source of truth in the openai-adapters package.
This commit is contained in:
parent
25186c7bcb
commit
cc4b809787
3 changed files with 4 additions and 7 deletions
|
|
@ -1,16 +1,12 @@
|
|||
import { ChatCompletionCreateParams } from "openai/resources/index";
|
||||
|
||||
import { OPENROUTER_HEADERS } from "@continuedev/openai-adapters";
|
||||
|
||||
import { LLMOptions } from "../../index.js";
|
||||
import { osModelsEditPrompt } from "../templates/edit.js";
|
||||
|
||||
import OpenAI from "./OpenAI.js";
|
||||
|
||||
const OPENROUTER_HEADERS: Record<string, string> = {
|
||||
"HTTP-Referer": "https://www.continue.dev/",
|
||||
"X-OpenRouter-Title": "Continue",
|
||||
"X-OpenRouter-Categories": "ide-extension",
|
||||
};
|
||||
|
||||
class OpenRouter extends OpenAI {
|
||||
static providerName = "openrouter";
|
||||
protected supportsReasoningField = true;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export interface OpenRouterConfig extends OpenAIConfig {
|
|||
|
||||
// TODO: Extract detailed error info from OpenRouter's error.metadata.raw to surface better messages
|
||||
|
||||
const OPENROUTER_HEADERS: Record<string, string> = {
|
||||
export const OPENROUTER_HEADERS: Record<string, string> = {
|
||||
"HTTP-Referer": "https://www.continue.dev/",
|
||||
"X-OpenRouter-Title": "Continue",
|
||||
"X-OpenRouter-Categories": "ide-extension",
|
||||
|
|
|
|||
|
|
@ -243,4 +243,5 @@ export {
|
|||
} from "./apis/AnthropicUtils.js";
|
||||
|
||||
export { isResponsesModel } from "./apis/openaiResponses.js";
|
||||
export { OPENROUTER_HEADERS } from "./apis/OpenRouter.js";
|
||||
export { extractBase64FromDataUrl, parseDataUrl } from "./util/url.js";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue