Skip to content

Python: [Work in progress] Minor fixes to code comments - #8985

Draft
Darren Cohen (dargilco) wants to merge 8 commits into
microsoft:mainfrom
dargilco:dargilco/response_stream_sample
Draft

Darren Cohen (dargilco) wants to merge 8 commits into
microsoft:mainfrom
dargilco:dargilco/response_stream_sample

Conversation

@dargilco

@dargilco Darren Cohen (dargilco) commented Oct 2, 2026 •

Copy link
Copy Markdown
Member
  • Update all "a Agent" to "an Agent"
  • Minor update to python\samples\02-agents\response_stream.py
    • Update comment at the top to move the Python code below the pattern title, just like done in the above two patterns.
    • In example 4, show that the cleanup hook was called after streaming is done, by printing streaming updates. If we don't print the updates, there is no way to see when it was done.

Motivation & Context

Description & Review Guide

  • What are the major changes?
  • What is the impact of these changes?
  • What do you want reviewers to focus on?

Related Issue

Fixes #

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

Copilot AI balanced review requested due to automatic review settings October 2, 2026 18:15
@dargilco Darren Cohen (dargilco) changed the title Minor fix to response_stream.py sample [Work in progress] Minor fix to response_stream.py sample Oct 2, 2026
@dargilco Darren Cohen (dargilco) changed the title [Work in progress] Minor fix to response_stream.py sample [Work in progress] Minor fixes to code comments Oct 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 3 Medium severity

Open (3)
What changed in this PR

This PR primarily corrects grammar in Python samples/docstrings (notably “a Agent” → “an Agent”) and adjusts the markdown flow in the response_stream.py sample.

Changes:

  • Fixes article/grammar issues across samples, packages, and tests (“a agent/Agent” → “an agent/Agent”).
  • Reorders/rewraps the “Pattern 3: Combined Usage” explanation in response_stream.py.
  • Minor docstring wording cleanup in multiple modules.
File Description
python/​samples/​03-workflows/​agents/​group_chat_workflow_as_agent.py Grammar fix in sample description bullet.
python/​samples/​03-workflows/​agents/​custom_agent_executors.py Grammar fix in Writer docstring bullet list.
python/​samples/​02-agents/​response_stream.py Reflows markdown around “Pattern 3” and “Chaining” explanations.
python/​samples/​02-agents/​providers/​anthropic/​anthropic_skills.py Comment grammar fix.
python/​samples/​02-agents/​observability/​workflow_observability.py Docstring grammar fix.
python/​packages/​orchestrations/​agent_framework_orchestrations/​_magentic.py Docstring grammar fix.
python/​packages/​declarative/​agent_framework_declarative/​_workflows/​_factory.py Docstring grammar fix.
python/​packages/​declarative/​agent_framework_declarative/​_loader.py Docstring grammar fixes across multiple factory methods.
python/​packages/​core/​agent_framework/​_workflows/​_typing_utils.py Docstring grammar fix.
python/​packages/​core/​agent_framework/​_agents.py Docstring grammar fix for Agent initializers.
python/​packages/​ag-ui/​tests/​ag_ui/​test_tooling.py Test helper docstring grammar fix.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@@ -118,18 +118,16 @@
- You get the complete response without ever seeing individual updates

print(update.text) # See each update
final = await response_stream.get_final_response() # Get the aggregated result
```
When you first iterate the stream and then call `get_final_response()`, the following occurs:
Reverts 79f5bc2 and 6306057.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot changed the title [Work in progress] Minor fixes to code comments Python: [Work in progress] Minor fixes to code comments Oct 2, 2026

This branch was successfully deployed

1 active deployment
github-app-auth — 40088fec Deployed Oct 2, 2026 by dargilco via add_label #24332
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants