mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
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:
committed by
GitHub
Unverified
parent
73761aa4a3
commit
83e6229c11
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user