Skip to main content

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()

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_agentspec-0.1.1.tar.gz (6.0 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_agentspec-0.1.1.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_agentspec-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f082460ed805ade17cb6bce903447aeefac2c61692cb65adb93ec68f58bc2b67
MD5 90ca47f55def299c06d94f57de570d9d
BLAKE2b-256 4dbb6efc83f4b2b649ce886360e0bfb67af433bdc2b1fe766e403bda8c154885

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for respan_instrumentation_agentspec-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6de512086e4d3b118e7054751c6089f17241a78d15eca7faa3f5fe0981b2e02e
MD5 0b7cf61efbaa26a23f5d6e2d6cd6452f
BLAKE2b-256 b8526bed06bc7c0990734ce6ebd4f837d9b381b4eb3919b5358a17f10b0f4734

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page