MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / constructor

Method constructor

src/api/providers/openrouter.ts:149–162  ·  view source on GitHub ↗
(options: ApiHandlerOptions)

Source from the content-addressed store, hash-verified

147 private currentReasoningDetails: any[] = []
148
149 constructor(options: ApiHandlerOptions) {
150 super()
151 this.options = options
152
153 const baseURL = this.options.openRouterBaseUrl || "https://openrouter.ai/api/v1"
154 const apiKey = this.options.openRouterApiKey ?? "not-provided"
155
156 this.client = new OpenAI({ baseURL, apiKey, defaultHeaders: DEFAULT_HEADERS, timeout: this.timeoutMs })
157
158 // Load models asynchronously to populate cache before getModel() is called
159 this.loadDynamicModels().catch((error) => {
160 console.error("[OpenRouterHandler] Failed to load dynamic models:", error)
161 })
162 }
163
164 private async loadDynamicModels(): Promise<void> {
165 try {

Callers

nothing calls this directly

Calls 2

loadDynamicModelsMethod · 0.95
errorMethod · 0.65

Tested by

no test coverage detected