Python: [BREAKING] added SerializationMixin and applied to contents, agents, chat client… (#1012)

* added SerializationMixin and applied to contents, agents, chat clients, removed AFBaseModel

* fix annotations type

* mypy fixes

* fix tests

* fix serializable subvalues and added large docstring

* updated indents in code block

* fixed exported urls
This commit is contained in:
Eduard van Valkenburg
2025-09-30 21:53:46 +02:00
committed by GitHub
Unverified
parent 3eb26632ce
commit 54ad135914
84 changed files with 2302 additions and 1957 deletions
@@ -3,7 +3,7 @@
import asyncio
import random
from collections.abc import AsyncIterable, MutableSequence
from typing import Any
from typing import Any, ClassVar
from agent_framework import (
BaseChatClient,
@@ -46,9 +46,7 @@ class EchoingChatClient(BaseChatClient):
and implementing the required _inner_get_response() and _inner_get_streaming_response() methods.
"""
OTEL_PROVIDER_NAME: str = "EchoingChatClient"
prefix: str = "Echo:"
OTEL_PROVIDER_NAME: ClassVar[str] = "EchoingChatClient"
def __init__(self, *, prefix: str = "Echo:", **kwargs: Any) -> None:
"""Initialize the EchoingChatClient.
@@ -57,10 +55,8 @@ class EchoingChatClient(BaseChatClient):
prefix: Prefix to add to echoed messages.
**kwargs: Additional keyword arguments passed to BaseChatClient.
"""
super().__init__(
prefix=prefix, # type: ignore
**kwargs,
)
super().__init__(**kwargs)
self.prefix = prefix
async def _inner_get_response(
self,