Skip to main content

Respan instrumentation plugin for CrewAI

Project description

respan-instrumentation-crewai

Respan instrumentation plugin for CrewAI. Wraps opentelemetry-instrumentation-crewai to automatically trace agent runs, task executions, and tool calls.

Configuration

1. Install

pip install respan-instrumentation-crewai

2. Set Environment Variables

Variable Required Description
RESPAN_API_KEY Yes Your Respan API key.
RESPAN_BASE_URL No Defaults to https://api.respan.ai.

Quickstart

3. Run Script

from dotenv import load_dotenv

load_dotenv()

from respan import Respan
from respan_instrumentation_crewai import CrewAIInstrumentor

respan = Respan(instrumentations=[CrewAIInstrumentor()])

from crewai import Agent, Task, Crew

agent = Agent(
    role="Poet",
    goal="Write a short haiku about recursion in programming",
    backstory="You are a programmer who writes haikus.",
)

task = Task(
    description="Write a haiku about recursion in programming.",
    expected_output="A single haiku (3 lines: 5-7-5 syllables).",
    agent=agent,
)

crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
print(result.raw)

respan.flush()

4. View Dashboard

After running the script, traces appear on your Respan dashboard.

Further Reading

See the examples/crewai/ directory for runnable examples.

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_crewai-0.1.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

respan_instrumentation_crewai-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file respan_instrumentation_crewai-0.1.0.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_crewai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 223d04f6c8fe29ad96b1d2fb3e3353ef5ddcd3961f8116e9cc0c96c0339e2cad
MD5 e59610cdbcfa2e5e9fd5b92272963f7e
BLAKE2b-256 123ca66c787365c0a26f6ef19a7bf90aa5e63ee1a1c5081a759ed6eaf6237a24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for respan_instrumentation_crewai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f126b68b9f329141f4853250b3d6cc97dd636786e7e68473d946b8dc31a6c69
MD5 de484b9636cf8bf369c8a28db0e7d58d
BLAKE2b-256 9a515e3a68000ae8d5ae67229426cf38358fe251c8ac5f12f3913d171b66c8ad

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