Skip to main content

Respan instrumentation plugin for Aleph Alpha

Project description

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

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_aleph_alpha-0.1.0.tar.gz (9.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_aleph_alpha-0.1.0.tar.gz.

File metadata

File hashes

Hashes for respan_instrumentation_aleph_alpha-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9c80917e06767240855b6aace3fb59b93cc615524a8f76480d00d3459d66601a
MD5 69e335aa9ca0d892fe63b312156083a4
BLAKE2b-256 21a5872a3fe14397ab6a9149bbb58c1e4243495df95e531322f62161ded7db76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for respan_instrumentation_aleph_alpha-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddce368fbd78a6417bcffbbc5bddc05a53f2a211f3e904353c3e1f6378a84997
MD5 52c581718d9b5fc8038cfaaf1b6d1886
BLAKE2b-256 fa5195bc90174e5a2af58f6e97fa5ab3cb2308afe4f1cba4b16a483524b78432

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