Langsmith -> GenAI translator emitter for OpenTelemetry GenAI
Project description
This package provides automatic translation of Langsmith-specific span attributes to OpenTelemetry GenAI semantic convention compliant format.
Overview
Langsmith is the observability platform for LangChain applications, providing tracing, evaluation, and monitoring capabilities. This translator bridges Langsmith’s attribute format to the standardized GenAI semantic conventions.
Installation
pip install splunk-otel-util-genai-translator-langsmith
Usage
The translator automatically enables when the package is installed. No additional configuration is required.
To explicitly enable or configure:
from opentelemetry.util.genai.langsmith import enable_langsmith_translator
# Enable with default configuration
enable_langsmith_translator()
# Enable with custom attribute transformations
enable_langsmith_translator(
attribute_transformations={
"rename": {
"my.custom.attr": "gen_ai.custom.attr"
}
}
)
Disabling Auto-Enable
Set the environment variable OTEL_INSTRUMENTATION_GENAI_LANGSMITH_DISABLE=true to disable automatic registration.
Attribute Mappings
The translator performs the following attribute mappings:
Content & Messages
langsmith.entity.input → gen_ai.input.messages
langsmith.entity.output → gen_ai.output.messages
gen_ai.prompt → gen_ai.input.messages
gen_ai.completion → gen_ai.output.messages
Model & System
langsmith.metadata.ls_provider → gen_ai.system
langsmith.metadata.ls_model_name → gen_ai.request.model
langsmith.metadata.ls_model_type → gen_ai.operation.name
Request Parameters
langsmith.metadata.ls_temperature → gen_ai.request.temperature
langsmith.metadata.ls_max_tokens → gen_ai.request.max_tokens
langsmith.metadata.ls_top_p → gen_ai.request.top_p
langsmith.metadata.ls_top_k → gen_ai.request.top_k
Token Usage
langsmith.token_usage.prompt_tokens → gen_ai.usage.input_tokens
langsmith.token_usage.completion_tokens → gen_ai.usage.output_tokens
langsmith.token_usage.total_tokens → gen_ai.usage.total_tokens
Tool Calling
langsmith.tool.name → gen_ai.tool.call.name
langsmith.tool.id → gen_ai.tool.call.id
langsmith.tool.arguments → gen_ai.tool.call.arguments
langsmith.tool.output → gen_ai.tool.call.result
Session & Run Tracking
langsmith.session_id → gen_ai.conversation.id
langsmith.thread_id → gen_ai.conversation.id
langsmith.run_id → gen_ai.run.id
References
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 splunk_otel_util_genai_translator_langsmith-0.1.1.tar.gz.
File metadata
- Download URL: splunk_otel_util_genai_translator_langsmith-0.1.1.tar.gz
- Upload date:
- Size: 34.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.11.14 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
224836081ee7d2ffc07775f63205a525133a3ca20ff16ae2c42cbefd435220a3
|
|
| MD5 |
02cc9a2adbb45d5bbb2b30a77ab4c322
|
|
| BLAKE2b-256 |
253b5bc46ac0912bb870c4878bf9165ec05930b654da735445be8337c9307615
|
File details
Details for the file splunk_otel_util_genai_translator_langsmith-0.1.1-py3-none-any.whl.
File metadata
- Download URL: splunk_otel_util_genai_translator_langsmith-0.1.1-py3-none-any.whl
- Upload date:
- Size: 35.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.11.14 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61d1c451adebfff3e28c8d200c4fd78e8aef262401f70ffd28a6464798ccc8c2
|
|
| MD5 |
dd13b5997ebdeb34d7a4e3cfa48fc998
|
|
| BLAKE2b-256 |
4fc67b05a7c7be8cfcf0f8ecb85c98271ad5a60f78932ce7e641d1f56cadd1a5
|