Skip to main content

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


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.0.tar.gz (5.1 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.0.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_smolagents-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d30b40c3648dc69b3ba3004ae704ba6fc2cb95be76841ee98e4809660eb6dff1
MD5 8b975cf97b9b481016ad58523334f0e6
BLAKE2b-256 e5da625bf9f12889a46413877d30c50daccdbbdb448242e2d73d26942a37d057

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for respan_instrumentation_smolagents-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26f6db4262578132c4b0d59ff4907956d58afbd615f7b4b507f58df488701101
MD5 242f84a99664a9914af2038b72b146d2
BLAKE2b-256 86838b262357de7e772fe060bdbebc3650f908b204f06dd43f5ddfd1a4c427a1

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 Pingdom Monitoring Sentry Error logging StatusPage Status page