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.1.tar.gz.

File metadata

File hashes

Hashes for splunk_otel_util_genai_translator_langsmith-0.1.1.tar.gz
Algorithm Hash digest
SHA256 224836081ee7d2ffc07775f63205a525133a3ca20ff16ae2c42cbefd435220a3
MD5 02cc9a2adbb45d5bbb2b30a77ab4c322
BLAKE2b-256 253b5bc46ac0912bb870c4878bf9165ec05930b654da735445be8337c9307615

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for splunk_otel_util_genai_translator_langsmith-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61d1c451adebfff3e28c8d200c4fd78e8aef262401f70ffd28a6464798ccc8c2
MD5 dd13b5997ebdeb34d7a4e3cfa48fc998
BLAKE2b-256 4fc67b05a7c7be8cfcf0f8ecb85c98271ad5a60f78932ce7e641d1f56cadd1a5

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