Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

respan_instrumentation_smolagents-0.1.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file respan_instrumentation_smolagents-0.1.1.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_smolagents-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8e656affcb5078541d0bba0784a478d3a7ca4eae64e9a7f58e8845deafed9006
MD5 7412b86bac5b5088ce0b31fdc1559004
BLAKE2b-256 61f00c023794e67d1fa513e806745b72afc619c2a3eeddf2d2e7ada1c934b834

See more details on using hashes here.

File details

Details for the file respan_instrumentation_smolagents-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for respan_instrumentation_smolagents-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bfd652bddcbb0f16cb439dbe5cf625e1c4cea4b6e7aa762240f3334cde6e5589
MD5 df5834acf81d3e6adb9c06f47a19adc1
BLAKE2b-256 4bd3ffbdf99c00ed55a72b946a2d85aaf17872ab80e061d1838ad2530d60dd0c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page