mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: [BREAKING] cleanup of thread API and serialization (#893)
* cleanup of threads and serialization * fix for sliding window * fix redis test * updated from comments * updated context provider and threads * updated lock * add asyncio default * fix redis tests * fix tests * fix tests * renamed to invoking * fixed tests * fix for instructions
This commit is contained in:
committed by
GitHub
Unverified
parent
bf5931932e
commit
10d10364a9
@@ -35,6 +35,7 @@ class MiddlewareType(Enum):
|
||||
|
||||
__all__ = [
|
||||
"AgentMiddleware",
|
||||
"AgentMiddlewares",
|
||||
"AgentRunContext",
|
||||
"ChatContext",
|
||||
"ChatMiddleware",
|
||||
@@ -230,6 +231,7 @@ Middleware: TypeAlias = (
|
||||
| ChatMiddleware
|
||||
| ChatMiddlewareCallable
|
||||
)
|
||||
AgentMiddlewares: TypeAlias = AgentMiddleware | AgentMiddlewareCallable
|
||||
|
||||
|
||||
# Middleware type markers for decorators
|
||||
@@ -1009,7 +1011,7 @@ def use_chat_middleware(chat_client_class: type[TChatClient]) -> type[TChatClien
|
||||
pipeline = ChatMiddlewarePipeline(chat_middleware_list) # type: ignore[arg-type]
|
||||
context = ChatContext(
|
||||
chat_client=self,
|
||||
messages=self.prepare_messages(messages),
|
||||
messages=self.prepare_messages(messages, chat_options),
|
||||
chat_options=chat_options,
|
||||
is_streaming=False,
|
||||
kwargs=kwargs,
|
||||
@@ -1059,7 +1061,7 @@ def use_chat_middleware(chat_client_class: type[TChatClient]) -> type[TChatClien
|
||||
pipeline = ChatMiddlewarePipeline(all_middleware) # type: ignore[arg-type]
|
||||
context = ChatContext(
|
||||
chat_client=self,
|
||||
messages=self.prepare_messages(messages),
|
||||
messages=self.prepare_messages(messages, chat_options),
|
||||
chat_options=chat_options,
|
||||
is_streaming=True,
|
||||
kwargs=kwargs,
|
||||
|
||||
Reference in New Issue
Block a user