Skip to content

fix: keep type field in Gemini schema when properties is empty - #18979

Merged
1 commit merged into
BerriAI:litellm_staging_01_14_2026from
theonlypal:fix/gemini-empty-properties-type
Jan 14, 2026
Merged

1 commit merged into
BerriAI:litellm_staging_01_14_2026from
theonlypal:fix/gemini-empty-properties-type

Conversation

@theonlypal

@theonlypal theonlypal commented Jan 12, 2026 •

Copy link
Copy Markdown
Contributor

Relevant issues

Fixes pydantic/pydantic-ai#3935
Fixes #18442

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🐛 Bug Fix

Changes

Gemini requires type: object even for functions with no parameters. The current code removes it when properties is empty.

@vercel

vercel Bot commented Jan 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
litellm Ready Ready Preview, Comment Jan 14, 2026 7:11am

@pdecat

pdecat commented Jan 13, 2026

Copy link
Copy Markdown

Doesn't this also close #18442?

@ghost

ghost commented Jan 13, 2026

Copy link
Copy Markdown

@theonlypal can you make sure your pr passes the relevant gemini tests. If our test is invalid, please update it and attach a screenshot of the changed call actually working.

Screenshot 2026-01-14 at 3 37 03 AM

@theonlypal

Copy link
Copy Markdown
Contributor Author

@krrishdholakia
Image 1-13-26 at 11 14 PM
Image 1-13-26 at 11 15 PM

@ghost
ghost changed the base branch from main to litellm_staging_01_14_2026 January 14, 2026 13:32
@ghost
ghost merged commit d92a016 into BerriAI:litellm_staging_01_14_2026 Jan 14, 2026
6 of 7 checks passed
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
This pull request was closed.

This branch was successfully deployed

1 active deployment
Preview — a8c9cb5f Deployed Jan 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants