配置完成后,您的 Microsoft Agent Framework 代理将自动向 LangSmith 发送追踪数据:
from agent_framework import ChatAgentfrom agent_framework.observability import configure_otel_providersfrom agent_framework.openai import OpenAIChatClient# 启用 OpenTelemetry 追踪configure_otel_providers(enable_sensitive_data=True)agent = ChatAgent( chat_client=OpenAIChatClient(model_id="gpt-4o"),)result = await agent.run("What's the the capital of Bavaria?")print(result.text)