Skip to content

< all problems11 · Level 05, Agents

Build an Agent with the OpenAI Agents SDK

medium · agent loop · Agents

Build build_agent() returning a configured Agent, passing model=MODEL and model_settings=SETTINGS (both configured above):

  1. Tools. Expose search_orders and get_customer with the @function_tool decorator. The SDK derives the schema from your type hints.
  2. Structured output. Set output_type to the provided SupportAnswer Pydantic model.
  3. Instructions. Tell it to use the tools rather than guessing at order details.
  4. 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.