Skip to main content

respan-instrumentation-aleph-alpha

Respan instrumentation plugin for the official Aleph Alpha Python SDK.

The package patches aleph_alpha_client.Client and AsyncClient model calls and emits canonical Respan spans through the active OTEL pipeline. It captures sync and async chat, sync and async completion, async streaming chat and completion, embeddings, semantic embeddings, instructable embeddings, evaluation, explanation, prompt and completion content, token usage, tool definitions, and model tool calls.

Installation

pip install respan-ai respan-instrumentation-aleph-alpha aleph-alpha-client

Usage

import os

from aleph_alpha_client import ChatRequest, Client, Message
from aleph_alpha_client.chat import Role
from respan import Respan
from respan_instrumentation_aleph_alpha import AlephAlphaInstrumentor

respan = Respan(instrumentations=[AlephAlphaInstrumentor()])
client = Client(token=os.environ["ALEPH_ALPHA_API_KEY"])

response = client.chat(
    request=ChatRequest(
        model="llama-3.1-8b-instruct",
        messages=[Message(role=Role.User, content="Say hello in one sentence.")],
    ),
    model="llama-3.1-8b-instruct",
)
print(response.message.content)
respan.flush()

Metadata

Release files for respan-instrumentation-aleph-alpha 0.1.1

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

Source distribution (sdist)

Source distribution for respan-instrumentation-aleph-alpha 0.1.1
File Size Uploaded
respan_instrumentation_aleph_alpha-0.1.1.tar.gz 9.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-aleph-alpha 0.1.1
File Interpreter ABI Platform
respan_instrumentation_aleph_alpha-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.6 kB

Release files / respan_instrumentation_aleph_alpha-0.1.1.tar.gz

Download URL respan_instrumentation_aleph_alpha-0.1.1.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
94b48cdafc3e92a3058026d13f0741bb43cf50797a5c757f3ac2240dd62d38a3
BLAKE2b-256 checksum
How to use checksums
4f25b47b8e03a326a40090cf497f56770cf1c181e7f12c6f8d5ceea03748f193
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_aleph_alpha-0.1.1-py3-none-any.whl

Download URL respan_instrumentation_aleph_alpha-0.1.1-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d980c34bc0baef9d823d1117ed83baf4caa7e5a8e5c4b0bd702311ef0ae3cfac
BLAKE2b-256 checksum
How to use checksums
13b4aa273d8acd31ecfdf5bb0759d00915380486e8611cd61159164205da2750
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release 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