Respan instrumentation plugin for the Writer Python SDK
Project description
respan-instrumentation-writer
Respan instrumentation plugin for the Writer Python SDK.
This package patches Writer client resource methods and emits spans using the Respan/Traceloop GenAI attribute shape used across this repository.
Install
pip install respan-instrumentation-writer
Quickstart
import os
from respan import Respan
from respan_instrumentation_writer import WriterInstrumentor
from writerai import Writer
respan = Respan(
api_key=os.environ["RESPAN_API_KEY"],
instrumentations=[WriterInstrumentor()],
)
client = Writer(api_key=os.environ["WRITER_API_KEY"])
completion = client.chat.chat(
model="palmyra-x5",
messages=[{"role": "user", "content": "Write one line about tracing."}],
max_tokens=64,
)
print(completion.choices[0].message.content)
respan.flush()
Notes
- The instrumentor patches both
WriterandAsyncWriterresources. chat.chat(), streamed chat, text completions, Knowledge Graph questions, application content generation, vision, translation, and direct Writer tool calls are traced.- Writer-specific SDK field names stay local to this package; emitted spans use canonical GenAI/LLM and Respan-owned attribute constants.
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_writer-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_writer-0.1.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7da6a1e6bd155ddc11b0e4b2c0dd491affd75a65a78eec7c6dbf50fc10137939
|
|
| MD5 |
a001bc848026f93b90d6812e476df25e
|
|
| BLAKE2b-256 |
966a429c9c4ebf72daca15dd9af7956ba27189f27400001acb2399f13d232431
|
File details
Details for the file respan_instrumentation_writer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_writer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.1 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 |
3df69b8c2403f6a914414b47052f0ad67f149896878ab738465363e33dc0d5ab
|
|
| MD5 |
bb8fcdebe39278d4bdefd094596430c4
|
|
| BLAKE2b-256 |
1484b2d979c721e230ab139d124f78406d6792150f7c9d60e7955789439ae5f6
|