Respan instrumentation plugin for AutoGen AgentChat
Project description
respan-instrumentation-autogen
Respan instrumentation plugin for AutoGen AgentChat. Wraps OpenInference's AutoGen AgentChat instrumentor and translates spans into the Respan tracing shape automatically.
Configuration
1. Install
pip install respan-ai respan-instrumentation-autogen
2. Set Environment Variables
| Variable | Required | Description |
|---|---|---|
RESPAN_API_KEY |
Yes | Your Respan API key. Authenticates gateway requests and trace export. |
RESPAN_BASE_URL |
No | Defaults to https://api.respan.ai/api. |
RESPAN_MODEL |
No | Defaults to gpt-4o-mini. |
Quickstart
import asyncio
import os
from dotenv import load_dotenv
load_dotenv()
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from respan import Respan
from respan_instrumentation_autogen import AutoGenInstrumentor
respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api")
respan_model = os.getenv("RESPAN_MODEL", "gpt-4o-mini")
respan = Respan(
api_key=respan_api_key,
base_url=respan_base_url,
instrumentations=[AutoGenInstrumentor()],
)
model_client = OpenAIChatCompletionClient(
model=respan_model,
api_key=respan_api_key,
base_url=respan_base_url,
)
async def main() -> None:
agent = AssistantAgent(
name="assistant",
model_client=model_client,
system_message="You are a helpful assistant.",
)
result = await agent.run(task="Write one sentence about recursive functions.")
print(result.messages[-1].content)
await model_client.close()
respan.flush()
asyncio.run(main())
Further Reading
See the Respan example projects for runnable scripts.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_instrumentation_autogen-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_autogen-0.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.12.12 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f323da994d22e406eebcf8592eed0e532ae7ceaa4f74f288c50e81d975c23d10
|
|
| MD5 |
04b8fe1225ceed7d836b2ebb53498d71
|
|
| BLAKE2b-256 |
fe915e926af82826ca3efa8fad26120ddf2e879166c0feb497dea7b5dfb69665
|
File details
Details for the file respan_instrumentation_autogen-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_autogen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.4 CPython/3.12.12 Darwin/25.0.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dea548d9eabcb73fbae01240839886124acb36b5d52c84cdce0bef90118e7c3a
|
|
| MD5 |
066c54e2193f184cff4b0cfd37019e13
|
|
| BLAKE2b-256 |
dd5ca205f2b7c3d79a628e09cef37aee6e044a391be660d1684fbcf4801a089f
|