From 46f19e398121126336b9037282ba7fecb58bee4a Mon Sep 17 00:00:00 2001 From: MUHAMMAD SALMAN HUSSAIN <160324527+mshsheikh@users.noreply.github.com> Date: Tue, 15 Jul 2025 20:25:32 +0500 Subject: [PATCH 1/2] Fix spelling, grammar, and minor formatting issues in running agents documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Problem**: The documentation for agent execution contains several minor but distracting issues: - Incorrect pluralization ("OpenAI Responses API" → "OpenAI Response API") - Verb tense mismatch ("outputs produces" → "outputs produced") - Optional inconsistencies in code examples (haiku punctuation, undefined `thread_id`) **Changes**: 1. **Grammar/Spelling Fixes** - Changed `"OpenAI Responses API"` → `"OpenAI Response API"` (singular "Response" aligns with the singular API concept) - Changed `"outputs produces"` → `"outputs produced"` (corrected past-tense verb agreement) 2. **Optional Code Improvements** - Removed period from haiku example for stylistic consistency ```python # Infinite loop's dance. → # Infinite loop's dance ``` - Added explicit `thread_id` definition in manual conversation example ```python thread_id = "thread_123" # Example thread ID ``` **Benefits**: - Improves readability and professionalism of documentation. - Fixes technical inaccuracies in API references and grammar. - Ensures code examples are self-contained and executable without undefined variables. - Maintains stylistic consistency with project standards. All changes preserve the original technical accuracy and intent of the documentation while addressing surface-level issues that could confuse readers or disrupt workflow. --- docs/running_agents.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/running_agents.md b/docs/running_agents.md index 6898f5101..25fc32d73 100644 --- a/docs/running_agents.md +++ b/docs/running_agents.md @@ -16,14 +16,14 @@ async def main(): print(result.final_output) # Code within the code, # Functions calling themselves, - # Infinite loop's dance. + # Infinite loop's dance ``` Read more in the [results guide](results.md). ## The agent loop -When you use the run method in `Runner`, you pass in a starting agent and input. The input can either be a string (which is considered a user message), or a list of input items, which are the items in the OpenAI Responses API. +When you use the run method in `Runner`, you pass in a starting agent and input. The input can either be a string (which is considered a user message), or a list of input items, which are the items in the OpenAI Response API. The runner then runs a loop: @@ -40,7 +40,7 @@ The runner then runs a loop: ## Streaming -Streaming allows you to additionally receive streaming events as the LLM runs. Once the stream is done, the [`RunResultStreaming`][agents.result.RunResultStreaming] will contain the complete information about the run, including all the new outputs produces. You can call `.stream_events()` for the streaming events. Read more in the [streaming guide](streaming.md). +Streaming allows you to additionally receive streaming events as the LLM runs. Once the stream is done, the [`RunResultStreaming`][agents.result.RunResultStreaming] will contain the complete information about the run, including all the new outputs produced. You can call `.stream_events()` for the streaming events. Read more in the [streaming guide](streaming.md). ## Run config @@ -73,6 +73,7 @@ You can manually manage conversation history using the [`RunResultBase.to_input_ async def main(): agent = Agent(name="Assistant", instructions="Reply very concisely.") + thread_id = "thread_123" # Example thread ID with trace(workflow_name="Conversation", group_id=thread_id): # First turn result = await Runner.run(agent, "What city is the Golden Gate Bridge in?") From c6f3bdaf9349132b74ff9bdd04b28732fa1be037 Mon Sep 17 00:00:00 2001 From: MUHAMMAD SALMAN HUSSAIN <160324527+mshsheikh@users.noreply.github.com> Date: Wed, 16 Jul 2025 05:06:35 +0500 Subject: [PATCH 2/2] Fix typos and formatting; revert API naming change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This update cleans up minor issues in the `running_agents.md` documentation: - **Grammar Fix:** Corrects “outputs produces” → “outputs produced” for proper past-tense agreement. - **Code Example Improvements:** - Removes the trailing period from the haiku comment (`# Infinite loop's dance.` → `# Infinite loop's dance`). - Defines `thread_id` explicitly (`thread_id = "thread_123"`) so the manual conversation snippet is self-contained and runnable. These changes enhance readability and ensure all examples are clear and immediately executable without altering any core technical content. --- docs/running_agents.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/running_agents.md b/docs/running_agents.md index 25fc32d73..7d8f80851 100644 --- a/docs/running_agents.md +++ b/docs/running_agents.md @@ -23,7 +23,7 @@ Read more in the [results guide](results.md). ## The agent loop -When you use the run method in `Runner`, you pass in a starting agent and input. The input can either be a string (which is considered a user message), or a list of input items, which are the items in the OpenAI Response API. +When you use the run method in `Runner`, you pass in a starting agent and input. The input can either be a string (which is considered a user message), or a list of input items, which are the items in the OpenAI Responses API. The runner then runs a loop: