Skip to content

OutputSchema should be allowed alongside tools #307

@lazharichir

Description

@lazharichir

The Go SDK has the same issue that Python ADK had – it still blocks output_schema from being used alongside regular tools.

agent, err := llmagent.New(llmagent.Config{
	Name:        "root_agent",
	Model:       model,
	Description: "You can sum and multiply numbers.",
	Instruction: "Get the numbers and operations from the user and perform the calculations.",
	Tools: []tool.Tool{
		sumTool,
		multiplyTool,
	},
	OutputKey: "result",
	OutputSchema: &genai.Schema{
		Type: genai.TypeNumber,
	},
})
Error 400, Message: Function calling with a response mime type: 'application/json' is unsupported, Status: INVALID_ARGUMENT, Details: []

Since the Python ADK added set_model_response, output_schema can work with tools, but the code still enforces an outdated restriction that disables certain tool configurations whenever output_schema is set. There’s no technical reason for this anymore—output_schema and tools already coexist in the processing pipeline.

The Go SDK mirrors this restriction and should remove that validation so output_schema can be used freely with tools, just as the newer Python flow supports.

Echoing what has happened with the Python version of Google ADK:

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions