这是indexloc提供的服务,不要输入任何密码
Skip to content

Bug Report: Gemini Live API function calls always return empty arguments #2940

@Woodygan

Description

@Woodygan

Bug Report: Gemini Live API function calls always return empty arguments

Summary

Function calling with Gemini Live API through LiveKit always returns empty arguments (args={}) even when function schemas are properly defined with required parameters. This affects all raw function tools using the parameters_json_schema field instead of the correct parameters field that Google's API expects.

Root Cause

The bug is in the to_fnc_ctx() function in livekit/plugins/google/utils.py, specifically in the raw function tool conversion path:

Current broken code:

if is_raw_function_tool(fnc):
    info = get_raw_function_info(fnc)
    tools.append(
        types.FunctionDeclaration(
            name=info.name,
            description=info.raw_schema.get("description", ""),
            parameters_json_schema=info.raw_schema.get("parameters", {}),  # ← BUG: Wrong/depreciated field name
        )
    )

Should be:

if is_raw_function_tool(fnc):
    info = get_raw_function_info(fnc)
    tools.append(
        types.FunctionDeclaration(
            name=info.name,
            description=info.raw_schema.get("description", ""),
            parameters=info.raw_schema.get("parameters", {}),  # ← Change to "parameter"?
        )
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions