Description
Copying the public ChatResponse.from_updates documentation example into a clean Python namespace raises NameError: name 'Content' is not defined. The example constructs Content.from_text(...) twice but imports only ChatResponse and ChatResponseUpdate.
Minimal reproduction
from agent_framework import ChatResponse, ChatResponseUpdate
updates = [
ChatResponseUpdate(contents=[Content.from_text(text="Hello")], role="assistant"),
ChatResponseUpdate(contents=[Content.from_text(text=" How can I help you?")]),
]
response = ChatResponse.from_updates(updates)
print(response.text)
This is the example in python/packages/core/agent_framework/_types.py, in the ChatResponse.from_updates docstring.
Expected behavior and proposed correction
Import Content in the example's existing import statement so the copied block prints Hello How can I help you?. This is a one-line documentation correction with no runtime or public API changes; the desired import is already determined by the example's existing expressions.
Verification and AI assistance
Reproduced against current main commit 91ab44faa4824a30247d00c341f3498ba46b1ca3 on Python 3.13.16. The actual source docstring code block was extracted and executed in an empty namespace. It raises NameError before the import correction and prints the documented output after it. No model calls, credentials, or services were used.
Related open PRs, including the work-in-progress comment corrections in #8985, were checked by their actual changed files and patches; none includes this import correction. OpenAI Codex assisted with analysis, the correction, verification, and this report. I am preparing the focused documentation contribution.
Description
Copying the public
ChatResponse.from_updatesdocumentation example into a clean Python namespace raisesNameError: name 'Content' is not defined. The example constructsContent.from_text(...)twice but imports onlyChatResponseandChatResponseUpdate.Minimal reproduction
This is the example in
python/packages/core/agent_framework/_types.py, in theChatResponse.from_updatesdocstring.Expected behavior and proposed correction
Import
Contentin the example's existing import statement so the copied block printsHello How can I help you?. This is a one-line documentation correction with no runtime or public API changes; the desired import is already determined by the example's existing expressions.Verification and AI assistance
Reproduced against current
maincommit91ab44faa4824a30247d00c341f3498ba46b1ca3on Python 3.13.16. The actual source docstring code block was extracted and executed in an empty namespace. It raisesNameErrorbefore the import correction and prints the documented output after it. No model calls, credentials, or services were used.Related open PRs, including the work-in-progress comment corrections in #8985, were checked by their actual changed files and patches; none includes this import correction. OpenAI Codex assisted with analysis, the correction, verification, and this report. I am preparing the focused documentation contribution.