Skip to content

[Bug]: Gemini API returns 400 error: Unknown name "additionalProperties" in function calling #620

Description

@Whit3knight

Bug Description

When using Google Gemini as provider with function calling enabled, Memoh sends JSON Schema containing "additionalProperties" field which Gemini API does not support.

Steps to Reproduce

  1. Configure provider as Google Gemini
  2. Enable a bot with function calling/tools
  3. Send a message that triggers tool use

Error Messages / Logs

stream failed: api error 400: Invalid JSON payload received. Unknown name "additionalProperties" at 'tools[0].function_declarations[0].parameters.properties[0].value.items.properties[2].value.items': Cannot find field. Invalid JSON payload received. Unknown name "additionalProperties" at 'tools[0].function_declarations[0].parameters.properties[0].value.items': Cannot find field. Invalid JSON payload received. Unknown name "additionalProperties" at 'tools[0].function_declarations[0].parameters': Cannot find field.

Version

Memoh-Local-v0.12.0

Model Used

gemini-3.1-flash-lite / gemini-2.5-flash

Channel

Telegram

Additional Context

No response

Contributing

  • I would like to submit a pull request to fix this bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions