Python APIautogen-agentchat

Core

Instrumentation

Python · Instrumentation

openinference-instrumentation-autogen-agentchat

OpenInference Autogen-Agentchat Instrumentation

Module
openinference.instrumentation.autogen_agentchat
Version
0.1.29
Python
>=3.10, <3.16
Instruments
autogen-agentchat >= 0.5.1

Install

pip install openinference-instrumentation-autogen-agentchat

Usage

Instrument once, at startup, before the library is used. The AutogenAgentChatInstrumentor reference below lists the options.

from opentelemetry.sdk.trace import TracerProvider
from openinference.instrumentation import TraceConfig
from openinference.instrumentation.autogen_agentchat import AutogenAgentChatInstrumentor

tracer_provider = TracerProvider()
# ...add a span processor that exports to Phoenix or any OTLP backend.

AutogenAgentChatInstrumentor().instrument(
    tracer_provider=tracer_provider,
    config=TraceConfig(hide_inputs=True),  # optional
)

openinference.instrumentation.autogen_agentchat

AutogenAgentChatInstrumentor

classSource ↗
class AutogenAgentChatInstrumentor(BaseInstrumentor)

An instrumentor for autogen-agentchat

instrument

method
def instrument(
    *,
    tracer_provider: Optional[TracerProvider] = None,
    config: Optional[TraceConfig] = None,
    skip_dep_check: bool = False,
) -> None

Start tracing autogen-agentchat: patch it so its calls make OpenInference spans. Calling it again does nothing. Inherited from OpenTelemetry’s BaseInstrumentor.

Parameters

NameDescription
tracer_provider

The tracer provider the spans are made with. Defaults to the global one, opentelemetry.trace.get_tracer_provider().

config

What the spans record: hide inputs, outputs or messages, or limit image sizes. Defaults to TraceConfig(), which reads the OPENINFERENCE_* environment variables. See TraceConfig.

skip_dep_check

Instrument even if the installed version of autogen-agentchat is outside the supported range.

uninstrument

method
def uninstrument() -> None

Stop tracing: undo the patches instrument() made. Inherited from OpenTelemetry’s BaseInstrumentor.

instrumentation_dependencies

methodSource ↗
def instrumentation_dependencies() -> Collection[str]