diff --git a/src/agents/run.py b/src/agents/run.py index d05878e5d2..0e9818591f 100644 --- a/src/agents/run.py +++ b/src/agents/run.py @@ -239,10 +239,13 @@ 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. 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. @@ -325,10 +328,13 @@ 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. 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. @@ -402,10 +408,13 @@ 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. 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. diff --git a/src/agents/run_config.py b/src/agents/run_config.py index 572e62ed17..a2058c2631 100644 --- a/src/agents/run_config.py +++ b/src/agents/run_config.py @@ -349,7 +349,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.""" __all__ = [