Respan instrumentation plugin for AgentSpec
Project description
respan-instrumentation-agentspec
Respan instrumentation plugin for AgentSpec (pyagentspec).
This package activates the upstream OpenInference AgentSpec span processor
through Respan's OpenInference translator, so AgentSpec spans are exported
through the same Respan OTLP pipeline used by Respan.
Installation
pip install respan-ai respan-instrumentation-agentspec "pyagentspec[langgraph]"
Usage
from pyagentspec.adapters.langgraph import AgentSpecLoader
from pyagentspec.agent import Agent
from pyagentspec.llms import OpenAiConfig
from respan import Respan
from respan_instrumentation_agentspec import AgentSpecInstrumentor
respan = Respan(
app_name="agentspec-haiku-agent",
instrumentations=[
AgentSpecInstrumentor(workflow_name="agentspec_haiku_agent")
],
)
try:
agent = Agent(
name="haiku_assistant",
description="A helpful assistant that writes haikus.",
llm_config=OpenAiConfig(name="openai", model_id="gpt-4.1-nano"),
system_prompt="You are a helpful assistant. Respond only with a haiku.",
)
langgraph_agent = AgentSpecLoader().load_component(agent)
result = langgraph_agent.invoke(
input={"messages": [{"role": "user", "content": "Write a haiku about tracing."}]}
)
print(result["messages"][-1].content)
finally:
respan.shutdown()
respan.flush()
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_agentspec-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_agentspec-0.1.0.tar.gz
- Upload date:
- Size: 4.3 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 |
8f3e91c3adb89cfdacb2c7c7291411fa2e342a26e35e09d5dd6ead173e44c7c9
|
|
| MD5 |
289f0fb2d9f2a1c1f5b7c9ddf375b81f
|
|
| BLAKE2b-256 |
8c4ce03f7dee873d455fdf17cce87eec4a39433bc01a549edafe4c76153b0270
|
File details
Details for the file respan_instrumentation_agentspec-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_agentspec-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 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 |
7bd045c2b07106e6da288528c0db12f3a285d24e58caa6e016f740e82ca93dc6
|
|
| MD5 |
015b49ccaca4b3a48ecec83756da22be
|
|
| BLAKE2b-256 |
f732e9208423e522c720dd27bcb05ddc1be5e5416b8e3057b6301fce81013526
|