|
37 | 37 |
|
38 | 38 | @dataclass |
39 | 39 | class ToolsToFinalOutputResult: |
| 40 | + """Result type for processing tool outputs into final agent outputs. |
| 41 | + |
| 42 | + This class helps manage the transition between tool execution results |
| 43 | + and the final output of an agent run. It determines whether more LLM |
| 44 | + processing is needed or if we have reached the final output state. |
| 45 | +
|
| 46 | + Attributes: |
| 47 | + is_final_output: Whether this is the final output. If False, the LLM |
| 48 | + will run again and receive the tool call output. |
| 49 | + final_output: The final output value. Can be None if `is_final_output` |
| 50 | + is False, otherwise must match the `output_type` of the agent. |
| 51 | + """ |
| 52 | + |
40 | 53 | is_final_output: bool |
41 | 54 | """Whether this is the final output. If False, the LLM will run again and receive the tool call |
42 | 55 | output. |
@@ -73,18 +86,31 @@ class MCPConfig(TypedDict): |
73 | 86 |
|
74 | 87 | @dataclass |
75 | 88 | class AgentBase(Generic[TContext]): |
76 | | - """Base class for `Agent` and `RealtimeAgent`.""" |
| 89 | + """Base class for all agent implementations in the OpenAI Agents SDK. |
| 90 | + |
| 91 | + This class provides the core functionality shared between standard agents |
| 92 | + and realtime agents. It manages tools, model settings, and agent configuration. |
| 93 | + |
| 94 | + Generic Args: |
| 95 | + TContext: The type of context maintained during agent execution. |
| 96 | + |
| 97 | + Key Features: |
| 98 | + - Tool management and execution |
| 99 | + - Model configuration |
| 100 | + - Handoff support for agent collaboration |
| 101 | + - Context management across runs |
| 102 | + """ |
77 | 103 |
|
78 | 104 | name: str |
79 | | - """The name of the agent.""" |
| 105 | + """The name of the agent, used for identification and logging.""" |
80 | 106 |
|
81 | 107 | handoff_description: str | None = None |
82 | 108 | """A description of the agent. This is used when the agent is used as a handoff, so that an |
83 | 109 | LLM knows what it does and when to invoke it. |
84 | 110 | """ |
85 | 111 |
|
86 | 112 | tools: list[Tool] = field(default_factory=list) |
87 | | - """A list of tools that the agent can use.""" |
| 113 | + """A list of tools that the agent has access to and can use during execution.""" |
88 | 114 |
|
89 | 115 | mcp_servers: list[MCPServer] = field(default_factory=list) |
90 | 116 | """A list of [Model Context Protocol](https://modelcontextprotocol.io/) servers that |
|
0 commit comments