Skip to content

Conversation

micke754
Copy link
Contributor

Describe your changes

Related issue/discussion:

#532

Checklist before requesting a review

  • I have read CONTRIBUTING.md
  • I have performed a self-review of my code

If this is a feature

I'm actually unsure if you would classify this as a feature, or more of a fix of an existing one. I've raised a discussion to cover my basses.

  • I have created a discussion
  • A project maintainer has approved this feature request. Link to comment:

Let me know if I've messed up somewhere. I'm Just a humble python dev here trying to get this working to "unblock" me.

Kevin Michaels added 2 commits June 23, 2025 14:08
This commit introduces the `ThinkingBudget` parameter to the Google API configuration. This allows users to control the thinking budget for Google's AI models.

The `ThinkingBudget` can now be specified in the `Model` struct within `config.go`. This value is then used to configure the Google API client in `internal/google/google.go` by setting the `ThinkingBudget` field in the `Config` struct.

The `mods.go` file is updated to pass the `ThinkingBudget` from the model configuration to the Google client configuration.

This change enhances the control users have over the AI model's behavior and resource utilization.
This commit updates the Google stream reader to gracefully handle the end of the stream by checking for `io.EOF`. When EOF is encountered, it now marks the stream as finished and returns `stream.ErrNoContent` to signal the end of data without being treated as a fatal error. This ensures more robust stream processing.
@micke754 micke754 requested a review from caarlos0 as a code owner June 23, 2025 04:40
Kevin Michaels added 2 commits June 23, 2025 16:47
The Gemini/Google API does not currently support tool calls. This commit updates the `CallTools` method in the `Stream` struct to return `nil` instead of panicking, reflecting the current implementation status.
The Gemini API may not not support returning streamed messages after the fact, so the Messages method in the google.go stream should return nil instead of panicking.
@micke754 micke754 force-pushed the feature/gemini-thinking-params branch from bdcfff9 to ddaae0d Compare June 23, 2025 04:48
Copy link
Member

@caarlos0 caarlos0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great - thanks!

@caarlos0 caarlos0 merged commit a36ca67 into charmbracelet:main Jun 23, 2025
5 of 8 checks passed
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

Successfully merging this pull request may close these issues.

2 participants