Skip to content

Python: Correct ChatKit guide streaming arguments - #9523

Open
LI (ktz03) wants to merge 1 commit into
microsoft:mainfrom
ktz03:docs/chatkit-guide-stream-arguments-20261019
Open

LI (ktz03) wants to merge 1 commit into
microsoft:mainfrom
ktz03:docs/chatkit-guide-stream-arguments-20261019

Conversation

@ktz03

Copy link
Copy Markdown
Contributor

Motivation & Context

The ChatKit package agent guide passes an Agent and a message list to stream_agent_response. The helper instead accepts a stream of AgentResponseUpdate objects and a ChatKit thread ID, so the documented call raises TypeError before any model/client call.

Description & Review Guide

  • What are the major changes? Obtain agent.run(messages, stream=True) first, then pass that response stream and thread_id to the ChatKit helper.
  • What is the impact of these changes? Documentation only, matching the working package README call pattern. The old Usage block fails before invoking the client; the corrected block and unchanged README pattern both complete with a deterministic local client on Windows/CPython 3.14.3 and cached openai-chatkit 1.6.5. No service, frontend, HTTP request, real model, storage recovery, package build, full suite, fresh install or minimum-version matrix was exercised.
  • What do you want reviewers to focus on? The helper receives its documented response-stream and thread-ID arguments. The package README and runtime implementation are unchanged.

Related Issue

N/A - trivial change. This corrects an unambiguous example call to the existing API, matching the package README; no behavior, API or new guidance principle is introduced. The original integration and guide authors in #1273, #2174 and #3644 retain their contributions.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: Documentation, example verification, and this PR description.

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 links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • 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 19, 2026 08:53
@ktz03
LI (ktz03) deployed to github-app-auth October 19, 2026 08:53 — with GitHub Actions Active
@ktz03
LI (ktz03) deployed to github-app-auth October 19, 2026 08:53 — with GitHub Actions Active
@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python labels Oct 19, 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.

🟢 Approval recommended

The documentation-only correction matches the existing API contract, with no unresolved findings.

No open issues 🎉

What changed in this PR

Corrects the Python ChatKit guide’s streaming example to match the existing helper API and package README.

Changes:

  • Creates a response stream with agent.run(messages, stream=True).
  • Passes that stream and thread_id to stream_agent_response.
File Description
python/​packages/​chatkit/​AGENTS.md Corrects streaming arguments in the usage example.

Review effort: Balanced

This branch was successfully deployed

1 active deployment
github-app-auth — 275cffb4 Deployed Oct 19, 2026 by ktz03 via team_check #7043
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants