respan-instrumentation-dspy
Respan instrumentation plugin for DSPy.
This package registers a native DSPy callback and emits module, language model, tool, adapter, and evaluation spans into the Respan tracing pipeline.
Configuration
1. Install
pip install respan-instrumentation-dspy
2. Set Environment Variables
| Variable | Required | Description |
|---|---|---|
RESPAN_API_KEY |
Yes | Your Respan API key. Authenticates both proxy and tracing. |
RESPAN_BASE_URL |
No | Defaults to https://api.respan.ai/api. |
Quickstart
3. Run Script
import os
import dspy
from respan import Respan
from respan_instrumentation_dspy import DSPyInstrumentor
respan_api_key = os.environ["RESPAN_API_KEY"]
respan_base_url = os.getenv("RESPAN_BASE_URL", "https://api.respan.ai/api")
os.environ["OPENAI_API_KEY"] = respan_api_key
os.environ["OPENAI_BASE_URL"] = respan_base_url
os.environ["OPENAI_API_BASE"] = respan_base_url
respan = Respan(
api_key=respan_api_key,
base_url=respan_base_url,
app_name="dspy-quickstart",
instrumentations=[DSPyInstrumentor()],
)
dspy.configure(lm=dspy.LM("openai/gpt-4o-mini", cache=False))
question_answerer = dspy.Predict("question -> answer")
prediction = question_answerer(question="What is DSPy in one sentence?")
print(prediction.answer)
respan.flush()
4. View Dashboard
Open the Respan dashboard and inspect the dspy-quickstart trace.
Further Reading
Metadata
Release files for respan-instrumentation-dspy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| respan_instrumentation_dspy-0.1.1.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| respan_instrumentation_dspy-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.1 kB
Release files / respan_instrumentation_dspy-0.1.1.tar.gz
| Download URL | respan_instrumentation_dspy-0.1.1.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77105cb2dfb13db829dd548997989fcff099e1eb6c09fd1cbdc23ae9341c39cb
|
|
BLAKE2b-256 checksum How to use checksums |
ea55f286ce665a2a3ef0c4a41057467e7b07014c8b50a012a9918bb3069e8740
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / respan_instrumentation_dspy-0.1.1-py3-none-any.whl
| Download URL | respan_instrumentation_dspy-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bbd5097fd235fffba98e7b704cf73a6f35a8b5a6f1dd301295fa922c16872b41
|
|
BLAKE2b-256 checksum How to use checksums |
2c94404f9506452c64312878dcb5d7ca7307b4403c7b1118fb15cabfabe859c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|