Python: updated docstrings (#1225)

* updated docstrings

* fix tests and mypy

* hosted file search docstring update

* updated versions
This commit is contained in:
Eduard van Valkenburg
2025-10-06 18:04:39 +02:00
committed by GitHub
Unverified
parent b2ab9931fd
commit 714e7b50d4
32 changed files with 592 additions and 319 deletions
@@ -14,6 +14,7 @@ from agent_framework import (
Role,
chat_middleware,
function_middleware,
use_chat_middleware,
use_function_invocation,
)
@@ -326,6 +327,7 @@ class TestChatMiddleware:
async def test_function_middleware(
context: FunctionInvocationContext, next: Callable[[FunctionInvocationContext], Awaitable[None]]
) -> None:
nonlocal execution_order
execution_order.append(f"function_middleware_before_{context.function.name}")
await next(context)
execution_order.append(f"function_middleware_after_{context.function.name}")
@@ -336,7 +338,7 @@ class TestChatMiddleware:
return f"Weather in {location}: sunny"
# Create function-invocation enabled chat client
chat_client = use_function_invocation(MockBaseChatClient)()
chat_client = use_chat_middleware(use_function_invocation(MockBaseChatClient))()
# Set function middleware directly on the chat client
chat_client.middleware = [test_function_middleware]
@@ -580,14 +580,6 @@ def test_chat_response_update():
assert response_update.text == "I'm doing well, thank you!"
def test_chat_response_update_with_method():
u = ChatResponseUpdate(text="Hello", message_id="1")
v = u.with_(contents=[TextContent(" world")])
assert v is not u
assert v.text == "Hello world"
assert v.message_id == "1"
def test_chat_response_updates_to_chat_response_one():
"""Test converting ChatResponseUpdate to ChatResponse."""
# Create a ChatMessage