Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

400 Bad Request with Gemini: Function Parameter Validation Failure #1029

Closed
ryujim opened this issue Feb 2, 2025 · 2 comments
Closed

400 Bad Request with Gemini: Function Parameter Validation Failure #1029

ryujim opened this issue Feb 2, 2025 · 2 comments

Comments

@ryujim
Copy link

ryujim commented Feb 2, 2025

Describe the bug

When attempting to use Goose with Gemini as the provider, the session fails with a 400 Bad Request error related to function declarations parameter validation. The error specifically mentions that only 'enum' is supported for STRING type in the URL format specification.

Error message:

ERROR goose::agents::truncate: Error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.tools[0].function_declarations[4].parameters.properties[url].format: only 'enum' is supported for STRING type

    at crates/goose/src/agents/truncate.rs:279

To Reproduce

Steps to reproduce the behavior:

  1. Start Goose session
  2. Enter any input
  3. Observe the error in the response

Expected behavior

The session should establish successfully and process the input without throwing parameter validation errors related to function declarations.

Screenshots

Image

  • OS & Arch: macOS (x86_64/Intel)
  • Interface: CLI
  • Version: v1.0.4
  • Extensions enabled: git, memory, computercontroller, developer, fetch
  • Provider & Model: Google - gemini-2.0-flash-exp

Additional context

Same error on other models from Google.

@salman1993
Copy link
Collaborator

salman1993 commented Feb 2, 2025

If you disable the fetch tool, that should fix it.

Why you're seeing the error?
We found that the Google Gemini model fails with fetch tool because Gemini API doesn't fully support jsonschema, specifically:
fetch server uses format: uri for the url field here. Gemini only supports format: string so it fails in this case.

@ryujim
Copy link
Author

ryujim commented Feb 2, 2025

It fixed it.
Thanks for the quick reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants