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

Goose (Gemini API) errs out if prompt is empty #987

Closed
tobbelobb opened this issue Jan 31, 2025 · 0 comments · Fixed by #989
Closed

Goose (Gemini API) errs out if prompt is empty #987

tobbelobb opened this issue Jan 31, 2025 · 0 comments · Fixed by #989
Assignees
Labels
bug Something isn't working

Comments

@tobbelobb
Copy link

Describe the bug

Upon the next prompt (after the empty one), we get an error message:

ERROR goose::agents::truncate: Error: Request failed: Request failed with status: 400 Bad Request. Message: * GenerateContentRequest.contents[0].parts: contents.parts must not be empty.

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

I put a sample interaction in the following log file: error_when_empty_prompt.log

To Reproduce

  1. Start a session with Goose using the Gemini API.
  2. Leave the prompt empty or press enter.
  3. Send any non-empty prompt, eg 'hello'. The error message is then printed. No LLM response is printed.

Expected behavior

The system should handle empty prompts gracefully.

Screenshots

(Not applicable as it's a CLI-based interaction).

Please provide following information:

  • OS & Arch: Ubuntu 22.04, Linux x86
  • Interface: CLI
  • Version: 1.0.3
  • Extensions enabled: Computer Controller, Developer
  • Provider & Model: Google - gemini-2.0-flash-exp

Additional context

Based on the log, the error is identified at crates/goose/src/agents/truncate.rs:279, suggesting the error is on the server side where the request is not properly validated for empty content before processing.

I have only tested models gemini-2.0-flash-exp and gpt-4o. The gemini one has this problem, the gpt-4o one works fine.

@laanak08 laanak08 self-assigned this Jan 31, 2025
@laanak08 laanak08 linked a pull request Jan 31, 2025 that will close this issue
@laanak08 laanak08 added the bug Something isn't working label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants