Python: [Breaking] Simplified Content types to a single class with classmethod constructors. (#3252)

* ported Content to a new model

* fixed linting

* fixes

* fixed data format handling

* fix for 3.10 mypy

* fix

* fix int test
This commit is contained in:
Eduard van Valkenburg
2026-01-20 23:09:39 +01:00
committed by GitHub
Unverified
parent 73761aa4a3
commit 83e6229c11
132 changed files with 3949 additions and 4741 deletions
@@ -4,7 +4,7 @@
from unittest.mock import AsyncMock, patch
import pytest
from agent_framework import ChatMessage, Context, Role
from agent_framework import ChatMessage, Content, Context, Role
from agent_framework.exceptions import ServiceInitializationError
from agent_framework.mem0 import Mem0Provider
@@ -409,14 +409,13 @@ class TestMem0ProviderModelInvoking:
self, mock_mem0_client: AsyncMock
) -> None:
"""Test invoking with function approval response content messages returns context with None instructions."""
from agent_framework import FunctionApprovalResponseContent, FunctionCallContent
provider = Mem0Provider(user_id="user123", mem0_client=mock_mem0_client)
function_call = FunctionCallContent(call_id="1", name="test_func", arguments='{"arg1": "value1"}')
function_call = Content.from_function_call(call_id="1", name="test_func", arguments='{"arg1": "value1"}')
message = ChatMessage(
role=Role.USER,
contents=[
FunctionApprovalResponseContent(
Content.from_function_approval_response(
id="approval_1",
function_call=function_call,
approved=True,