Learn how to use input and output with Teams.
str
input and str
output.
MovieScript
for us.
Structured Output example
Run the example
StockReport
class, here’s how it looks:
use_json_mode=True
on the Agent.output_schema
. This returns the structured output as a single RunContent
event in the stream of events.
Streaming Structured Output example
Run the example
Team.run()
or Team.print_response()
as the input
parameter.
Structured Input example
Run the example
input_schema
on the Team to validate the input. If you then pass the input as a dictionary, it will be automatically validated against the schema.
Validating the input example
Run the example
parser_model_prompt
to your Parser Model to customize the model’s instructions.
output_model_prompt
to your Output Model to customize the model’s instructions.