From a9116f8f683481aaa81bfc827e46b21e220f6a2d Mon Sep 17 00:00:00 2001 From: aifanatic Date: Tue, 3 Nov 2026 23:10:20 -0600 Subject: [PATCH] Python: Use a real chat client in Purview chat middleware examples Co-Authored-By: Claude Opus 5.5 --- python/packages/purview/README.md | 3 +-- .../packages/purview/agent_framework_purview/_middleware.py | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/packages/purview/README.md b/python/packages/purview/README.md index ba44ca26d85..b5d860a6eeb 100644 --- a/python/packages/purview/README.md +++ b/python/packages/purview/README.md @@ -384,8 +384,7 @@ If blocked content must not be retained, set `store` to `False` so the framework conversation, and attach a history provider: ```python -client = ChatClient(...) -client.chat_middleware = [PurviewChatPolicyMiddleware(credential, settings)] +client = OpenAIChatClient(middleware=[PurviewChatPolicyMiddleware(credential, settings)]) agent = Agent( client=client, diff --git a/python/packages/purview/agent_framework_purview/_middleware.py b/python/packages/purview/agent_framework_purview/_middleware.py index 2d3faf08cf1..8665b9699ad 100644 --- a/python/packages/purview/agent_framework_purview/_middleware.py +++ b/python/packages/purview/agent_framework_purview/_middleware.py @@ -277,12 +277,13 @@ class PurviewChatPolicyMiddleware(ChatMiddleware): Usage: .. code-block:: python + from agent_framework.microsoft import PurviewChatPolicyMiddleware, PurviewSettings - from agent_framework import ChatClient + from agent_framework.openai import OpenAIChatClient credential = ... # TokenCredential, AsyncTokenCredential, or callable settings = PurviewSettings(app_name="My App") - client = ChatClient(..., middleware=[PurviewChatPolicyMiddleware(credential, settings)]) + client = OpenAIChatClient(middleware=[PurviewChatPolicyMiddleware(credential, settings)]) """ def __init__(