Skip to main content

Langsmith to GenAI Semantic Convention Translator

pypi

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

Known Limitations

  • Root agent/workflow span duplicates the full conversation. LangSmith serializes the entire MessagesState accumulator as the root span’s output, so gen_ai.output.messages on the top-level invoke_agent span contains every turn of the conversation rather than just the final reply. Child chat and nested agent spans carry the correct per-turn messages.

  • Agent vs. workflow classification depends on naming. LangSmith reports every orchestration span with run_type=chain regardless of whether it represents an agent or a higher-level workflow. The translator infers the intent from the span name: roots whose name contains agent or executor (or that already carry gen_ai.agent.name) are classified as invoke_agent; other root chains are classified as invoke_workflow; inner chains become step. To get correct classification, name your agents accordingly — e.g. create_agent(name="weather_agent") or compile(name="research_agent") for single-agent graphs, and a neutral name like compile(name="weather_assistant") for multi-agent workflows.

References

Metadata

Release files for splunk-otel-util-genai-translator-langsmith 0.1.5

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

Source distribution (sdist)

Source distribution for splunk-otel-util-genai-translator-langsmith 0.1.5
File Size Uploaded Provenance Actions
splunk_otel_util_genai_translator_langsmith-0.1.5.tar.gz 38.7 kB Without provenance Details for splunk_otel_util_genai_translator_langsmith-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for splunk-otel-util-genai-translator-langsmith 0.1.5
File Interpreter ABI Platform Actions
splunk_otel_util_genai_translator_langsmith-0.1.5-py3-none-any.whl Python 3 none any Details for splunk_otel_util_genai_translator_langsmith-0.1.5-py3-none-any.whl

Total release size: 78.7 kB

Release files / splunk_otel_util_genai_translator_langsmith-0.1.5.tar.gz

Download URL splunk_otel_util_genai_translator_langsmith-0.1.5.tar.gz
Size 38.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c39d0701a35f5812bc0c03acb4eff08bdf3cad2e137ea1dce581bb1ab57d32ca
BLAKE2b-256 checksum
How to use checksums
69b6a714a14500514a8f50f0e49d5bbb421db4b75e0fce3ac7a5cda041e6bc6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.17.1 {"ci":true,"cpu":"x86_64","distro":{"id":"trixie","libc":{"lib":"glibc","version":"2.41"},"name":"Debian GNU/Linux","version":"13"},"implementation":{"name":"CPython","version":"3.11.15"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.5.6 7 Apr 2026","python":"3.11.15","system":{"name":"Linux","release":"5.15.0-1084-aws"}} HTTPX2/2.9.0

Release files / splunk_otel_util_genai_translator_langsmith-0.1.5-py3-none-any.whl

Download URL splunk_otel_util_genai_translator_langsmith-0.1.5-py3-none-any.whl
Size 40.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3f8346eac630b02835fece2899e45d45becd4f2eb4adce9bd0fb6d66394af81
BLAKE2b-256 checksum
How to use checksums
f4c2766abef78ef7afb7846f5bdb7ccff7b6849288c7f8401726de8ce859c776
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.17.1 {"ci":true,"cpu":"x86_64","distro":{"id":"trixie","libc":{"lib":"glibc","version":"2.41"},"name":"Debian GNU/Linux","version":"13"},"implementation":{"name":"CPython","version":"3.11.15"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.5.6 7 Apr 2026","python":"3.11.15","system":{"name":"Linux","release":"5.15.0-1084-aws"}} HTTPX2/2.9.0

Security for splunk-otel-util-genai-translator-langsmith 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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