Skip to content
Open
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
18 changes: 15 additions & 3 deletions src/agents/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,14 @@ async def run(
Pass ``None`` to disable the turn limit.
hooks: An object that receives callbacks on various lifecycle events.
run_config: Global settings for the entire agent run.
error_handlers: Error handlers keyed by error kind. Currently supports max_turns.
error_handlers: Error handlers keyed by error kind. Currently supports
max_turns and model_refusal.
Comment on lines +242 to +243
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be outdated. We'd like to avoid listing the possible values here.

Suggested change
error_handlers: Error handlers keyed by error kind. Currently supports
max_turns and model_refusal.
error_handlers: Error handlers keyed by error kind.

previous_response_id: The ID of the previous response. If using OpenAI
models via the Responses API, this allows you to skip passing in input
from the previous turn.
auto_previous_response_id: If True, enable Responses API response chaining
automatically for the first turn even when no
``previous_response_id`` is supplied yet.
conversation_id: The conversation ID
(https://platform.openai.com/docs/guides/conversation-state?api-mode=responses).
If provided, the conversation will be used to read and write items.
Expand Down Expand Up @@ -325,10 +329,14 @@ def run_sync(
Pass ``None`` to disable the turn limit.
hooks: An object that receives callbacks on various lifecycle events.
run_config: Global settings for the entire agent run.
error_handlers: Error handlers keyed by error kind. Currently supports max_turns.
error_handlers: Error handlers keyed by error kind. Currently supports
max_turns and model_refusal.
previous_response_id: The ID of the previous response, if using OpenAI
models via the Responses API, this allows you to skip passing in input
from the previous turn.
auto_previous_response_id: If True, enable Responses API response chaining
automatically for the first turn even when no
``previous_response_id`` is supplied yet.
conversation_id: The ID of the stored conversation, if any.
session: A session for automatic conversation history management.

Expand Down Expand Up @@ -402,10 +410,14 @@ def run_streamed(
Pass ``None`` to disable the turn limit.
hooks: An object that receives callbacks on various lifecycle events.
run_config: Global settings for the entire agent run.
error_handlers: Error handlers keyed by error kind. Currently supports max_turns.
error_handlers: Error handlers keyed by error kind. Currently supports
max_turns and model_refusal.
previous_response_id: The ID of the previous response, if using OpenAI
models via the Responses API, this allows you to skip passing in input
from the previous turn.
auto_previous_response_id: If True, enable Responses API response chaining
automatically for the first turn even when no
``previous_response_id`` is supplied yet.
conversation_id: The ID of the stored conversation, if any.
session: A session for automatic conversation history management.

Expand Down
2 changes: 1 addition & 1 deletion src/agents/run_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class RunOptions(TypedDict, Generic[TContext]):
"""The session for the run."""

error_handlers: NotRequired[RunErrorHandlers[TContext] | None]
"""Error handlers keyed by error kind. Currently supports max_turns."""
"""Error handlers keyed by error kind. Currently supports max_turns and model_refusal."""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above



__all__ = [
Expand Down