Python: Added chat middleware and more examples (#883)

* Added example with stateful middleware

* Added chat middleware

* Updated middleware example with override scenario

* Small revert

* Small fixes

* Added kwargs to context objects

* Added README

* Added function middleware to chat client

* Small refactoring

* Reverted example files

* Made MiddlewareWrapper generic

* Added Middleware exception

* Small refactoring

* Small fix
This commit is contained in:
Dmytro Struk
2025-09-26 08:10:56 -07:00
committed by GitHub
Unverified
parent 863c8d7471
commit eec7f192eb
19 changed files with 2667 additions and 267 deletions
@@ -13,6 +13,7 @@ from agent_framework import (
ChatResponseUpdate,
Role,
TextContent,
use_chat_middleware,
use_function_invocation,
)
@@ -37,6 +38,7 @@ custom client with ChatAgent through the create_agent() method.
@use_function_invocation
@use_chat_middleware
class EchoingChatClient(BaseChatClient):
"""A custom chat client that echoes messages back with modifications.