Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added git
Empty file.
9 changes: 5 additions & 4 deletions src/agents/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@
@dataclass
class ToolsToFinalOutputResult:
is_final_output: bool
"""Whether this is the final output. If False, the LLM will run again and receive the tool call
output.
"""If True, this is the final output;
if False, LLM will run again and receive the tool call output.
"""

final_output: Any | None = None
"""The final output. Can be None if `is_final_output` is False, otherwise must match the
`output_type` of the agent.
"""The final output value.
- Must be non-None and match the agent's `output_type` if `is_final_output` is True.
- Must be None if `is_final_output` is False.
"""


Expand Down
10 changes: 9 additions & 1 deletion src/agents/model_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,16 @@ class ModelSettings:

truncation: Literal["auto", "disabled"] | None = None
"""The truncation strategy to use when calling the model.

- "auto": If the context (this response + previous ones) exceeds the model's
context window, older input items in the *middle* of the conversation will
be dropped so the request still fits. Streaming continues normally.
- "disabled" (default): Do not truncate. If input exceeds the model's
context window, the request fails with HTTP 400 (no streaming).
- None: Defer to the provider's default behavior (typically "disabled").

See [Responses API documentation](https://platform.openai.com/docs/api-reference/responses/create#responses_create-truncation)
for more details.
for details.
"""

max_tokens: int | None = None
Expand Down