Skip to content

Commit 1511241

Browse files
committed
fix(providers): lift @ts-nocheck on Gemini + OpenRouter
GeminiProvider needed one type addition: GeminiGenerationConfig gains a responseSchema?: Record<string, unknown> field so the constrained-decoding path at line 741 type-checks. OpenRouterProvider needed one signature fix: line 487 was passing apiResponse.id (string) to OpenRouterProviderError's httpStatus (number) slot. Moved it to details as { responseId: apiResponse.id }. OpenAIProvider keeps @ts-nocheck because the file references a phantom OpenAIAPITypes namespace that was never imported — that needs the openai SDK as a real dependency, not a one-liner.
1 parent f87d0e2 commit 1511241

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/core/llm/providers/implementations/GeminiProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-nocheck
21
// File: backend/agentos/core/llm/providers/implementations/GeminiProvider.ts
32

43
/**
@@ -116,6 +115,7 @@ interface GeminiGenerationConfig {
116115
topK?: number;
117116
stopSequences?: string[];
118117
responseMimeType?: string;
118+
responseSchema?: Record<string, unknown>;
119119
}
120120

121121
/** A single function declaration for tool calling. */

src/core/llm/providers/implementations/OpenRouterProvider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// File: backend/agentos/core/llm/providers/implementations/OpenRouterProvider.ts
2-
// @ts-nocheck
32
/**
43
* @fileoverview Implements the IProvider interface for OpenRouter, a service that
54
* provides access to a wide variety of LLMs from different providers through a unified API.
@@ -485,7 +484,7 @@ export class OpenRouterProvider implements IProvider {
485484
): ModelCompletionResponse {
486485
const choice = apiResponse.choices[0];
487486
if (!choice) {
488-
throw new OpenRouterProviderError("Received empty choices array from OpenRouter.", "API_RESPONSE_MALFORMED", apiResponse.id);
487+
throw new OpenRouterProviderError("Received empty choices array from OpenRouter.", "API_RESPONSE_MALFORMED", undefined, undefined, { responseId: apiResponse.id });
489488
}
490489

491490
const usage: ModelUsage | undefined = apiResponse.usage ? {

0 commit comments

Comments
 (0)