Skip to content

[Bug] HTTP 400: function_response.name cannot be empty in gemini-native tool calling #54

@ptran17203

Description

@ptran17203

An INVALID_ARGUMENT error (HTTP 400) is triggered when the orchestrator sends a tool response back to the Gemini API without specifying the function name.

Error Log:

HTTP 400: gemini-native: [{ "error": { "code": 400, "message": "* GenerateContentRequest.contents[3].parts[0].function_response.name: Name cannot be empty.\n", "status": "INVALID_ARGUMENT" } } ]

HTTP 400: gemini-native: [{ "error": { "code": 400, "message": "* GenerateContentRequest.contents[3].parts[0].function_response.name: Name cannot be empty.\n", "status": "INVALID_ARGUMENT" } } ]
Root Cause Analysis: The error occurs during the Tool Calling loop. Gemini API requires that every function_response part must have a name field that matches the function_call name requested by the model. In this instance, the orchestrator is sending a function_response where the name field is either empty, null, or undefined, causing the API to reject the entire request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions