Skip to main content

Documentation Index

Fetch the complete documentation index at: https://www.adaline.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

AutoGen

Use the Adaline AutoGen observer to send AutoGen runner activity into Adaline. The integration wraps an existing runner or agent and observes its run lifecycle without changing the task logic itself.
adaline-autogen is currently in early access and is not yet published on PyPI. Contact support@adaline.ai to get access.

Prerequisites

Before you start, make sure you have:
  • An Adaline account.
  • A workspace API key — create one under Settings → API keys.
  • Your project ID — copy it from Monitor → Copy Project ID.
See Integrate your AI agent for a full walkthrough. Set both as environment variables before running the examples on this page:
export ADALINE_API_KEY="your-api-key"
export ADALINE_PROJECT_ID="your-project-id"

Install

pip install adaline-client adaline-autogen autogen-agentchat
Install the AutoGen packages your application already uses alongside the Adaline integration package. If you use the OpenAI model client shown below, make sure the corresponding AutoGen OpenAI extension package is also installed in your environment.

Initialize Adaline

Create an Adaline client, then initialize a monitor for the target project.
import os

from adaline import Adaline

adaline = Adaline(api_key=os.environ["ADALINE_API_KEY"])
monitor = adaline.init_monitor(project_id=os.environ["ADALINE_PROJECT_ID"])
For production guidance — buffering, batching, retries, serverless flushing, and graceful shutdown — see Instrument with the Adaline SDK.

Wrap an AutoGen runner

Create an AdalineAutoGenObserver, then wrap the runner or agent you want to observe.
from adaline_autogen import AdalineAutoGenObserver

observer = AdalineAutoGenObserver(monitor=monitor)
wrapped_runner = observer.wrap_runner(runner)

Basic example

This example keeps the integration intentionally small: one AssistantAgent run observed through wrap_runner.
import asyncio
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient

from adaline_autogen import AdalineAutoGenObserver

async def main():
    observer = AdalineAutoGenObserver(
        monitor=monitor,
        tags=["autogen"],
    )

    model_client = OpenAIChatCompletionClient(model="gpt-4o-mini")
    agent = AssistantAgent(name="support_agent", model_client=model_client)
    wrapped_runner = observer.wrap_runner(agent)

    items = [
        item async for item in wrapped_runner.run_stream(task="Say hello in one word.")
    ]

    await monitor.flush()


asyncio.run(main())

Use an existing parent trace or span

The AutoGen observer accepts:
  • parent_trace
  • parent_span
Pass one or the other, but not both.

What the observer captures

The AutoGen integration is designed to capture observed runner activity, including:
  • runner-level roots created when a wrapped run starts
  • task input passed into the observed runner
  • child spans emitted during the wrapped run
  • framework and runner metadata stored as Adaline attributes
This page focuses on how to wrap the runner. The exact span tree depends on the AutoGen runner behavior and the events emitted during the run.

Next steps

Instrument with the Adaline SDK

Monitor lifecycle, buffering and batching, retries, serverless flushing, and graceful shutdown.

SDK reference

Full class and type reference for the TypeScript and Python SDKs.

All integrations

Browse every framework and AI-provider integration Adaline supports.

View your logs

Open Adaline to see traces and spans land in your project.