Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

fix: recursively remove additionalProperties from Gemini requests #351

Merged
merged 1 commit into from
Jun 27, 2025

Conversation

valtzu
Copy link
Contributor

@valtzu valtzu commented Jun 27, 2025

Tool parameters with nested objects cause 400 bad request from Gemini due to only removing the unsupported additionalProperties on top-level.

Invalid JSON payload received. Unknown name "additionalProperties" at 'tools[0].function_declarations[0].parameters.properties[0].value': Cannot find field.

@valtzu valtzu force-pushed the gemini-additionalProperties-fix branch from 010b0c5 to c937ba0 Compare June 27, 2025 18:59
Copy link
Member

@chr-hertel chr-hertel left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks 👍

@chr-hertel chr-hertel added the bug Something isn't working label Jun 27, 2025
@chr-hertel chr-hertel merged commit c69f561 into php-llm:main Jun 27, 2025
7 checks passed
OskarStark added a commit to symfony/ai that referenced this pull request Jul 1, 2025
…quests (valtzu)

This PR was merged into the main branch.

Discussion
----------

fix: recursively remove `additionalProperties` from Gemini requests

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Docs?         | no
| Issues        |
| License       | MIT

Cherry picking php-llm/llm-chain#351

> Tool parameters with nested objects cause 400 bad request from Gemini due to only removing the unsupported `additionalProperties` on top-level.

```
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools[0].function_declarations[0].parameters.properties[0].value': Cannot find field.
```

Commits
-------

ea94f84 fix: recursively remove `additionalProperties` from Gemini requests (#351)
symfony-splitter pushed a commit to symfony/ai-platform that referenced this pull request Jul 11, 2025
…quests (valtzu)

This PR was merged into the main branch.

Discussion
----------

fix: recursively remove `additionalProperties` from Gemini requests

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Docs?         | no
| Issues        |
| License       | MIT

Cherry picking php-llm/llm-chain#351

> Tool parameters with nested objects cause 400 bad request from Gemini due to only removing the unsupported `additionalProperties` on top-level.

```
Invalid JSON payload received. Unknown name "additionalProperties" at 'tools[0].function_declarations[0].parameters.properties[0].value': Cannot find field.
```

Commits
-------

ea94f84 fix: recursively remove `additionalProperties` from Gemini requests (#351)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants