Skip to content

Commit b9c37e8

Browse files
committed
docs: document auto_previous_response_id and drop stale error_handlers value list
PR #2117 added the `auto_previous_response_id` parameter to `Runner.run`, `Runner.run_sync`, and `Runner.run_streamed` signatures but did not document it in the `Args:` blocks (parameter appears in `inspect.signature` but not in `inspect.getdoc`). Add the missing `auto_previous_response_id` entry to each `Args:` block. Drop the "Currently supports max_turns" enumeration from the `error_handlers` docstrings (3 in `run.py`, 1 in `run_config.py:RunOptions.error_handlers`) to avoid documenting a list that will drift again as more handler kinds are added.
1 parent f9eb3a4 commit b9c37e8

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

src/agents/run.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,13 @@ async def run(
239239
Pass ``None`` to disable the turn limit.
240240
hooks: An object that receives callbacks on various lifecycle events.
241241
run_config: Global settings for the entire agent run.
242-
error_handlers: Error handlers keyed by error kind. Currently supports max_turns.
242+
error_handlers: Error handlers keyed by error kind.
243243
previous_response_id: The ID of the previous response. If using OpenAI
244244
models via the Responses API, this allows you to skip passing in input
245245
from the previous turn.
246+
auto_previous_response_id: If True, enable Responses API response chaining
247+
automatically for the first turn even when no
248+
``previous_response_id`` is supplied yet.
246249
conversation_id: The conversation ID
247250
(https://platform.openai.com/docs/guides/conversation-state?api-mode=responses).
248251
If provided, the conversation will be used to read and write items.
@@ -325,10 +328,13 @@ def run_sync(
325328
Pass ``None`` to disable the turn limit.
326329
hooks: An object that receives callbacks on various lifecycle events.
327330
run_config: Global settings for the entire agent run.
328-
error_handlers: Error handlers keyed by error kind. Currently supports max_turns.
331+
error_handlers: Error handlers keyed by error kind.
329332
previous_response_id: The ID of the previous response, if using OpenAI
330333
models via the Responses API, this allows you to skip passing in input
331334
from the previous turn.
335+
auto_previous_response_id: If True, enable Responses API response chaining
336+
automatically for the first turn even when no
337+
``previous_response_id`` is supplied yet.
332338
conversation_id: The ID of the stored conversation, if any.
333339
session: A session for automatic conversation history management.
334340
@@ -402,10 +408,13 @@ def run_streamed(
402408
Pass ``None`` to disable the turn limit.
403409
hooks: An object that receives callbacks on various lifecycle events.
404410
run_config: Global settings for the entire agent run.
405-
error_handlers: Error handlers keyed by error kind. Currently supports max_turns.
411+
error_handlers: Error handlers keyed by error kind.
406412
previous_response_id: The ID of the previous response, if using OpenAI
407413
models via the Responses API, this allows you to skip passing in input
408414
from the previous turn.
415+
auto_previous_response_id: If True, enable Responses API response chaining
416+
automatically for the first turn even when no
417+
``previous_response_id`` is supplied yet.
409418
conversation_id: The ID of the stored conversation, if any.
410419
session: A session for automatic conversation history management.
411420

src/agents/run_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ class RunOptions(TypedDict, Generic[TContext]):
349349
"""The session for the run."""
350350

351351
error_handlers: NotRequired[RunErrorHandlers[TContext] | None]
352-
"""Error handlers keyed by error kind. Currently supports max_turns."""
352+
"""Error handlers keyed by error kind."""
353353

354354

355355
__all__ = [

0 commit comments

Comments
 (0)