Build an Agent with the OpenAI Agents SDK
Build build_agent() returning a configured Agent, passing model=MODEL and model_settings=SETTINGS (both configured above):
- Tools. Expose
search_ordersandget_customerwith the@function_tooldecorator. The SDK derives the schema from your type hints. - Structured output. Set
output_typeto the providedSupportAnswerPydantic model. - Instructions. Tell it to use the tools rather than guessing at order details.
- A step limit. Cap the run so a confused agent cannot loop forever.
Then implement answer(question), which runs the agent and returns the SupportAnswer.
A live model answers, so the tests check the agent's configuration and the shape of the result rather than exact text.