Respan instrumentation plugin for smolagents
Project description
respan-instrumentation-smolagents
Respan instrumentation plugin for smolagents. Wraps OpenInference's smolagents instrumentor and translates spans into the Respan tracing shape automatically.
Configuration
1. Install
pip install respan-ai respan-instrumentation-smolagents
2. Set Environment Variables
| Variable | Required | Description |
|---|---|---|
RESPAN_API_KEY |
Yes | Your Respan API key. Authenticates trace export. |
RESPAN_BASE_URL |
No | Defaults to https://api.respan.ai/api. |
Quickstart
import os
from dotenv import load_dotenv
from respan import Respan
from respan_instrumentation_smolagents import SmolagentsInstrumentor
from smolagents import CodeAgent, LiteLLMModel
load_dotenv()
respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api")
respan = Respan(
api_key=respan_api_key,
base_url=respan_base_url,
instrumentations=[SmolagentsInstrumentor()],
)
model = LiteLLMModel(
model_id="openai/gpt-4o-mini",
api_key=respan_api_key,
api_base=respan_base_url,
)
agent = CodeAgent(tools=[], model=model)
print(agent.run("Return a one-sentence explanation of recursion."))
respan.flush()
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_smolagents-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_smolagents-0.1.0.tar.gz
- Upload date:
- Size: 5.1 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 |
d30b40c3648dc69b3ba3004ae704ba6fc2cb95be76841ee98e4809660eb6dff1
|
|
| MD5 |
8b975cf97b9b481016ad58523334f0e6
|
|
| BLAKE2b-256 |
e5da625bf9f12889a46413877d30c50daccdbbdb448242e2d73d26942a37d057
|
File details
Details for the file respan_instrumentation_smolagents-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_smolagents-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.2 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 |
26f6db4262578132c4b0d59ff4907956d58afbd615f7b4b507f58df488701101
|
|
| MD5 |
242f84a99664a9914af2038b72b146d2
|
|
| BLAKE2b-256 |
86838b262357de7e772fe060bdbebc3650f908b204f06dd43f5ddfd1a4c427a1
|