Skip to content

Commit b9a6225

Browse files
committed
fix: comment out unimplemented Gemini tool types to fix TypeScript errors
The Google GenAI library does not yet support responseSchema and codeExecution tool types. The UI checkboxes are added for future use, with backend implementation commented out until library support is available.
1 parent 0496f9a commit b9a6225

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

src/api/providers/gemini.ts

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,22 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl
7878
tools.push({ googleSearch: {} })
7979
}
8080

81-
if (this.options.enableStructuredOutput) {
82-
// Structured output configuration
83-
// This would typically be configured with response schemas
84-
// For now, we're adding the capability placeholder
85-
tools.push({ responseSchema: {} })
86-
}
87-
88-
if (this.options.enableCodeExecution) {
89-
// Code execution tool configuration
90-
tools.push({ codeExecution: {} })
91-
}
81+
// Note: Structured Output and Code Execution features are configured in the UI
82+
// but not yet implemented in the backend as the Google GenAI library
83+
// doesn't support these tool types yet. These will be enabled when
84+
// the library adds support for:
85+
// - responseSchema for structured output
86+
// - codeExecution for code execution capabilities
87+
88+
// if (this.options.enableStructuredOutput) {
89+
// // Will be enabled when library supports responseSchema
90+
// tools.push({ responseSchema: {} })
91+
// }
92+
93+
// if (this.options.enableCodeExecution) {
94+
// // Will be enabled when library supports codeExecution
95+
// tools.push({ codeExecution: {} })
96+
// }
9297

9398
const config: GenerateContentConfig = {
9499
systemInstruction,
@@ -222,12 +227,16 @@ export class GeminiHandler extends BaseProvider implements SingleCompletionHandl
222227
if (this.options.enableGrounding) {
223228
tools.push({ googleSearch: {} })
224229
}
225-
if (this.options.enableStructuredOutput) {
226-
tools.push({ responseSchema: {} })
227-
}
228-
if (this.options.enableCodeExecution) {
229-
tools.push({ codeExecution: {} })
230-
}
230+
// Note: Structured Output and Code Execution features are configured in the UI
231+
// but not yet implemented here as the Google GenAI library
232+
// doesn't support these tool types yet.
233+
234+
// if (this.options.enableStructuredOutput) {
235+
// tools.push({ responseSchema: {} })
236+
// }
237+
// if (this.options.enableCodeExecution) {
238+
// tools.push({ codeExecution: {} })
239+
// }
231240
const promptConfig: GenerateContentConfig = {
232241
httpOptions: this.options.googleGeminiBaseUrl
233242
? { baseUrl: this.options.googleGeminiBaseUrl }

0 commit comments

Comments
 (0)