From the course: OpenAI API: Agents

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Core concepts: Agents, runners, handoffs, and guardrails

Core concepts: Agents, runners, handoffs, and guardrails - OpenAI API Tutorial

From the course: OpenAI API: Agents

Core concepts: Agents, runners, handoffs, and guardrails

- The Agent SDK has three primitives: agents, handoffs, and guardrails. Agents are the LLM with instructions, tool use, and all the other features from the OpenAI API, handoffs are the ability of an agent to delegate tasks to other agents, and guardrails allow you to validate input and output from an agent. These three primitives make up the core of your multi-agent workflow, so let's take a closer look at how they work. To create an agent, you simply import the Agent class from the SDK, and then you declare an agent with a name, instructions, and other values. You can choose to point to a specific model if you want to, and you can also pass in model settings using the ModelSettings class. And here you can append any of the standard model settings you would use in the API. If you want to set the type of an output from an agent, you can do that using the output_type property, as you see in this example here. Agents can use tools and function calling, including the tools shipped with…

Contents