mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: small fixes in foundry (#297)
* small fixes in foundry * other samples updated * make it optional * added instructions and response format to create agent * mypy fix * shortened main readme and improved python readme
This commit is contained in:
committed by
GitHub
Unverified
parent
30fc2b6e9b
commit
c39845d473
@@ -2,6 +2,7 @@
|
||||
|
||||
import sys
|
||||
from collections.abc import AsyncIterable, Callable, MutableMapping, Sequence
|
||||
from contextlib import AbstractAsyncContextManager
|
||||
from enum import Enum
|
||||
from typing import Any, ClassVar, Literal, Protocol, TypeVar, runtime_checkable
|
||||
from uuid import uuid4
|
||||
@@ -417,7 +418,7 @@ class ChatClientAgent(AgentBase):
|
||||
|
||||
If the chat_client supports async context management, enter its context.
|
||||
"""
|
||||
if hasattr(self.chat_client, "__aenter__") and hasattr(self.chat_client, "__aexit__"):
|
||||
if isinstance(self.chat_client, AbstractAsyncContextManager):
|
||||
await self.chat_client.__aenter__() # type: ignore[reportUnknownMemberType]
|
||||
return self
|
||||
|
||||
@@ -426,7 +427,7 @@ class ChatClientAgent(AgentBase):
|
||||
|
||||
If the chat_client supports async context management, exit its context.
|
||||
"""
|
||||
if hasattr(self.chat_client, "__aenter__") and hasattr(self.chat_client, "__aexit__"):
|
||||
if isinstance(self.chat_client, AbstractAsyncContextManager):
|
||||
await self.chat_client.__aexit__(exc_type, exc_val, exc_tb) # type: ignore[reportUnknownMemberType]
|
||||
|
||||
async def run(
|
||||
|
||||
Reference in New Issue
Block a user