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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file respan_instrumentation_aleph_alpha-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_aleph_alpha-0.1.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c80917e06767240855b6aace3fb59b93cc615524a8f76480d00d3459d66601a
|
|
| MD5 |
69e335aa9ca0d892fe63b312156083a4
|
|
| BLAKE2b-256 |
21a5872a3fe14397ab6a9149bbb58c1e4243495df95e531322f62161ded7db76
|
File details
Details for the file respan_instrumentation_aleph_alpha-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_aleph_alpha-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddce368fbd78a6417bcffbbc5bddc05a53f2a211f3e904353c3e1f6378a84997
|
|
| MD5 |
52c581718d9b5fc8038cfaaf1b6d1886
|
|
| BLAKE2b-256 |
fa5195bc90174e5a2af58f6e97fa5ab3cb2308afe4f1cba4b16a483524b78432
|