Skip to content

error with gemini tool call #4

@licycle

Description

@licycle

using gemini and tool call func, return empty response content

async def get_voice() -> float:
    # Returns a random stock price for demonstration purposes.
    print("tool using")
    return random.randint(10, 200)

async def run_tool_agent():
    # Create a runtime.
    runtime = SingleThreadedAgentRuntime()
    # Create the tools.
    tools: List[Tool] = [FunctionTool(get_voice, description="get voice")]
    # Register the agents.
    await ToolAgent.register(runtime, "tool_executor_agent", lambda: ToolAgent("tool executor agent", tools))
    await ToolUseAgent.register(
        runtime,
        "tool_use_agent",
        lambda: ToolUseAgent(
            GeminiChatCompletionClient(model="gemini-1.5-pro", api_key="apikey"),
            [tool.schema for tool in tools], "tool_executor_agent"
        ),
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions