Skip to main content

bluejay-sdk

One client for the Bluejay API and for tracing your agent's calls into Bluejay conversations.

pip install bluejay-sdk               # API client + tracing
pip install "bluejay-sdk[livekit]"    # + LiveKit Agents
pip install "bluejay-sdk[pipecat]"    # + Pipecat
from bluejay import BluejayClient

client = BluejayClient()   # reads BLUEJAY_API_KEY; or BluejayClient(api_key="bj_...", base_url=...)

In asyncio code, use AsyncBluejayClient: the same client, with API methods to await.

Tracing

For API calls, create a client with BluejayClient(). For chat, LiveKit, or Pipecat, create the client once at process startup with tracing enabled:

client = BluejayClient(tracing=True)

This adds Bluejay's exporter to your OpenTelemetry setup or creates one.

It also traces model requests through these SDKs. When LiveKit or Pipecat is already tracing a model request, Bluejay uses the framework's span for that request.

SDK Traced
openai chat completions and responses: create, parse, stream; Azure OpenAI and OpenAI-compatible APIs
anthropic messages: create and stream
google-genai Gemini and Vertex AI: generate_content, generate_content_stream, chats
boto3 Bedrock converse and converse_stream

Each call is one span with the model, prompt, reply, tool calls, tokens and finish reason, in OpenTelemetry's gen_ai.* attributes. Inside session() or a voice integration it joins that call.

Voice agents

LiveKit: one line before the session.start() you already have. Spans, audio, transcript and tool calls all reach Bluejay, and the call becomes a conversation when it hangs up.

client.instrument_livekit(ctx, session, external_agent_id="support-bot")
await session.start(room=ctx.room, agent=SupportAgent())

Pipecat: add the Bluejay tap after your output transport and keep your existing context aggregators. Enable Pipecat's native spans on the worker and use the tap's session ID.

tap = client.instrument_pipecat(external_agent_id="support-bot")
pipeline = Pipeline([
    transport.input(), stt, user_aggregator, llm, tts,
    transport.output(), tap, assistant_aggregator,
])
worker = PipelineWorker(pipeline, enable_tracing=True, conversation_id=tap.session_id)

Text and chat agents

with client.session(chat_id, external_agent_id="chat-bot") as session:
    session.turn("USER", user_message)
    reply = run_agent(user_message)   # auto-traced model calls join this session
    session.turn("AGENT", reply)

session.end()   # optional: otherwise it builds after an hour idle

When the whole function is the session, decorate it. The first argument picks the id from the call. Use the same flow for SMS with the SMS conversation ID:

@client.session(lambda chat_id, message: chat_id, external_agent_id="chat-bot")
def handle(chat_id: str, message: str) -> str:
    client.turn("USER", message)
    reply = run_agent(message)
    client.turn("AGENT", reply)
    return reply

Every span needs a session and an agent: session() and the voice integrations set both. Reopen the same id on the next request and the turns land in one conversation.

Tools, custom spans and scores

@client.observe(kind="tool")
def lookup_appointment(member_id: str) -> dict: ...

@client.observe(kind="llm", model="mistral-large", provider="mistral_ai")
def ask_mistral(messages: list) -> str: ...

# a model call the SDK does not trace on its own (a provider's native SDK, raw HTTP):
# the span gets the same gen_ai.* attributes as an auto-instrumented call
with client.span("chat mistral-large", kind="llm", model="mistral-large", provider="mistral_ai", input=messages) as span:
    reply = mistral.chat.complete(model="mistral-large", messages=messages)
    span.set_output(reply.choices[0].message.content, finish_reason="stop",
                    input_tokens=reply.usage.prompt_tokens, output_tokens=reply.usage.completion_tokens)

client.score(session_id=chat_id, name="resolved", value=True)

Privacy

For advanced tracing options, create the client and configure tracing explicitly at startup.

client = BluejayClient()
client.init_tracing(redact_pii=True, mask=scrub)
client.instrument_livekit(ctx, session, external_agent_id="support-bot", record_audio=False)

The API

The API is on the same client, one namespace per resource, each with list, get, create, update and delete where they apply:

from bluejay import models

client.agents.list()
client.digital_humans.create(digital_humans=[...], simulation_ids=[...])
client.simulations.run(simulation_id=...)
client.simulation_results.list(simulation_run_id)
client.evaluate(external_agent_id="support-bot", start_time_utc=..., participants=[...],
                transcript=[models.Turn(speaker="USER", utterance="hi", start_offset_ms=0, end_offset_ms=500)])

See src/bluejay/api/reference.md for every method, and SDK_GENERATION.md for how the API client is generated and released.

Metadata

Release files for bluejay-sdk 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bluejay-sdk 0.4.0
File Size Uploaded Provenance Actions
bluejay_sdk-0.4.0.tar.gz 331.9 kB Without provenance Details for bluejay_sdk-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bluejay-sdk 0.4.0
File Interpreter ABI Platform Actions
bluejay_sdk-0.4.0-py3-none-any.whl Python 3 none any Details for bluejay_sdk-0.4.0-py3-none-any.whl

Total release size: 908.2 kB

Release files / bluejay_sdk-0.4.0.tar.gz

Download URL bluejay_sdk-0.4.0.tar.gz
Size 331.9 kB
Tags Source
SHA-256 checksum
How to use checksums
87c2e0e65ffaf87e159ee74d49212a89e8285865e39980cdca1efc6f323973ad
BLAKE2b-256 checksum
How to use checksums
afeb6a9bd8c6dbc0160d2f4203be34f02512a279e504494a33a4735ce07fdfb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bluejay_sdk-0.4.0-py3-none-any.whl

Download URL bluejay_sdk-0.4.0-py3-none-any.whl
Size 576.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
05a8cb56a65d2aca8aae1a179f300e27178c3abc968a382c6feb38a3c9813d2e
BLAKE2b-256 checksum
How to use checksums
964311c0f753bbbdab9d4bc0efee3a963331846ce8e2bba528cb78e97ad67224
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for bluejay-sdk 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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