Skip to content

Conversation

@lucas-barake
Copy link
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

Gemini's function_response.response field requires a Struct (i.e. a JSON object), but @effect/ai-google was passing part.result directly, which fails with a 400 error when the tool result is a primitive value (string, number, boolean, etc.).

This wraps primitive tool results in { result: value } using Predicate.isRecord to detect when wrapping is needed. Plain objects pass through unchanged.

Related

@lucas-barake lucas-barake requested a review from IMax153 as a code owner January 29, 2026 00:56
@github-project-automation github-project-automation bot moved this to Discussion Ongoing in PR Backlog Jan 29, 2026
@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

🦋 Changeset detected

Latest commit: e0b29de

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effect/ai-google Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

@effect/ai-google: Gemini rejects primitive tool results (requires object)

1 participant