Skip to content

Bump LiteLLM to fix Vertex AI function calling with no-param tools - #2329

Merged
seratch merged 2 commits into
openai:mainfrom
habema:fix/bump-litellm-for-vertex-tool-issue
Jan 18, 2026
Merged

Bump LiteLLM to fix Vertex AI function calling with no-param tools#2329
seratch merged 2 commits into
openai:mainfrom
habema:fix/bump-litellm-for-vertex-tool-issue

Conversation

@habema

@habema habema commented Jan 18, 2026

Copy link
Copy Markdown
Contributor

Fixes a Vertex AI error that occurs within LiteLLM, where tools with no parameters (like get_random_number()) would fail with a BadRequestError about function declaration parameters schema needing to be type OBJECT.

Bumped LiteLLM dependency to 1.81.0 which handles this case properly. Related bug fix here.

Error:

litellm.BadRequestError: Vertex_aiException BadRequestError - {
  "error": {
    "code": 400,
    "message": "Unable to submit request because `get_random_number` functionDeclaration parameters schema should be of type OBJECT. Learn more: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling",
    "status": "INVALID_ARGUMENT"
  }
}

Repro Script:

import asyncio
import random

from agents import Agent, Runner, function_tool


@function_tool
def get_random_number() -> int:
    """
    Returns a random number between 0 and 100.
    """
    return random.randint(0, 100)


agent = Agent(
    name="Assistant",
    model="litellm/vertex_ai/gemini-3-flash-preview",
    instructions="You are a helpful agent.",
    tools=[get_random_number],
)


async def main():
    result = await Runner.run(agent, input="Call the `get_random_number` tool")
    print(result.final_output)


if __name__ == "__main__":
    asyncio.run(main())

@seratch seratch added this to the 0.6.x milestone Jan 18, 2026
@seratch
seratch merged commit e833518 into openai:main Jan 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants