Skip to main content

Langsmith -> GenAI translator emitter for OpenTelemetry GenAI

Project description

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.inputgen_ai.input.messages

  • langsmith.entity.outputgen_ai.output.messages

  • gen_ai.promptgen_ai.input.messages

  • gen_ai.completiongen_ai.output.messages

Model & System

  • langsmith.metadata.ls_providergen_ai.system

  • langsmith.metadata.ls_model_namegen_ai.request.model

  • langsmith.metadata.ls_model_typegen_ai.operation.name

Request Parameters

  • langsmith.metadata.ls_temperaturegen_ai.request.temperature

  • langsmith.metadata.ls_max_tokensgen_ai.request.max_tokens

  • langsmith.metadata.ls_top_pgen_ai.request.top_p

  • langsmith.metadata.ls_top_kgen_ai.request.top_k

Token Usage

  • langsmith.token_usage.prompt_tokensgen_ai.usage.input_tokens

  • langsmith.token_usage.completion_tokensgen_ai.usage.output_tokens

  • langsmith.token_usage.total_tokensgen_ai.usage.total_tokens

Tool Calling

  • langsmith.tool.namegen_ai.tool.call.name

  • langsmith.tool.idgen_ai.tool.call.id

  • langsmith.tool.argumentsgen_ai.tool.call.arguments

  • langsmith.tool.outputgen_ai.tool.call.result

Session & Run Tracking

  • langsmith.session_idgen_ai.conversation.id

  • langsmith.thread_idgen_ai.conversation.id

  • langsmith.run_idgen_ai.run.id

References

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

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file splunk_otel_util_genai_translator_langsmith-0.1.0.tar.gz.

File metadata

File hashes

Hashes for splunk_otel_util_genai_translator_langsmith-0.1.0.tar.gz
Algorithm Hash digest
SHA256 03a7c926b837e8b6c50e405bba3728aff47244ced34235b0b02206f49a710050
MD5 3c9637a1ee5094fe5e1b8318e39fe191
BLAKE2b-256 499dae37fab1749ba0d401a0d87a7ce535a17de7fb05bea2ee08fb2f942a127f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for splunk_otel_util_genai_translator_langsmith-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61f8cb43ea10cb6ce5505064313ea52e256f7e8e06d791f324ea3c74f37e4b51
MD5 f609b1d02daa85366c39cfdd33df2a34
BLAKE2b-256 7f1a9436f3ddc3b4631e0a23a0c89fa956c4e405bf8093f5a693a6e725648c65

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