-
Couldn't load subscription status.
- Fork 1.3k
Open
Labels
Feature requestNew feature requestNew feature request
Milestone
Description
Description
It'd be useful to have a new output_json_schema property on AbstractAgent.
In the case of the concrete Agent, it would depend on agent._output_schema:
- if
StructuredTextOutputSchema(superclass ofNativeOutputSchemaandPromptedOutputSchema), get it from.object_def.json_schema - if it's
OutputSchemaWithoutMode, get it from.processor.object_def.json_schema - if it's
PlainTextOutputSchema, it's just{'type': 'string'} - if it's
ToolOutputSchema, we need to create a union schema of all.toolset.processorsusingUnionOutputProcessor, which currently takes a sequence of output types and createsObjectOutputProcessors for them on the fly, but could also take a sequence ofObjectOutputProcessors (the ones we get from.toolset.processors) directly. Once we have thatUnionOutputProcessor, the schema is on.object_def.json_schema - if it's
ToolOrTextOutputSchema, it's the above or{'type': 'string'}
(This is slightly outdated as I did some refactoring here recently, but it's directionally correct)
Needed for:
- Add
Agent.to_mcp()method #3076 - DRAFT: Add generate_dataset_from_agent to Pydantic Evals #3187
- Also include return (type) json schema for tools (similar how tool parameters are handled) #3122
References
No response
Metadata
Metadata
Assignees
Labels
Feature requestNew feature requestNew feature request