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 @@
import importlib.metadata
from agent_framework.observability import OBSERVABILITY_SETTINGS
from agent_framework.observability import enable_instrumentation
from agentlightning import AgentOpsTracer # type: ignore
try:
@@ -22,13 +22,12 @@ class AgentFrameworkTracer(AgentOpsTracer): # type: ignore
def init(self) -> None:
"""Initialize the agent-framework-lab-lightning for training."""
OBSERVABILITY_SETTINGS.enable_instrumentation = True
enable_instrumentation()
super().init()
def teardown(self) -> None:
"""Teardown the agent-framework-lab-lightning for training."""
super().teardown()
OBSERVABILITY_SETTINGS.enable_instrumentation = False
__all__: list[str] = ["AgentFrameworkTracer"]
@@ -9,8 +9,8 @@ import pytest
agentlightning = pytest.importorskip("agentlightning")
from agent_framework import AgentExecutor, AgentRunEvent, ChatAgent, WorkflowBuilder
from agent_framework.lab.lightning import AgentFrameworkTracer
from agent_framework import AgentExecutor, AgentRunEvent, ChatAgent, WorkflowBuilder, Workflow
from agent_framework_lab_lightning import AgentFrameworkTracer
from agent_framework.openai import OpenAIChatClient
from agentlightning import TracerTraceToTriplet
from openai.types.chat import ChatCompletion, ChatCompletionMessage
@@ -106,7 +106,7 @@ def workflow_two_agents():
yield workflow
async def test_openai_workflow_two_agents(workflow_two_agents):
async def test_openai_workflow_two_agents(workflow_two_agents: Workflow):
events = await workflow_two_agents.run("Please analyze the quarterly sales data")
# Get all AgentRunEvent data
@@ -121,7 +121,7 @@ async def test_openai_workflow_two_agents(workflow_two_agents):
)
async def test_observability(workflow_two_agents):
async def test_observability(workflow_two_agents: Workflow):
r"""Expected trace tree:
[workflow.run]