Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename attributes to match otel conventions #59

Merged
merged 17 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
230 changes: 147 additions & 83 deletions schemas/llm_span_attributes.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
"additionalProperties": false,
"properties": {
"langtrace.service.name": {
"type": "string"
"type": "string",
"description": "Name of the service. Includes all supported service providers by langtrace"
},
"langtrace.service.type": {
"type": "string"
"type": "string",
"description": "Type of the service. Allowed values: [llm, vectordb, framework]"
},
"langtrace.service.version": {
"type": "string"
"type": "string",
"description": "Version of the service provider client"
},
"langtrace.version": {
"type": "string"
Expand All @@ -20,121 +23,177 @@
"type": "string"
},
"url.full": {
"type": "string"
"type": "string",
"description": "Full URL of the request"
},
"llm.api": {
"type": "string"
"url.path": {
"type": "string",
"description": "Path of the request"
},
"llm.model": {
"type": "string"
"gen_ai.request.model": {
"type": "string",
"description": "Model name from the input request"
},
"llm.temperature": {
"type": "number",
"format": "float"
"gen_ai.response.model": {
"type": "string",
"description": "Model name from the response"
},
"llm.top_p": {
"gen_ai.request.temperature": {
"type": "number",
"format": "float"
"format": "float",
"description": "Temperature value from the input request"
},
"llm.top_k": {
"type": "number",
"format": "float"
"gen_ai.request.logit_bias": {
"type": "string",
"description": "Likelihood bias of the specified tokens the input request."
},
"llm.user": {
"type": "string"
"gen_ai.request.logprobs": {
"type": "boolean",
"description": "Logprobs flag returns log probabilities."
},
"llm.system.fingerprint": {
"type": "string"
"gen_ai.request.top_logprobs": {
"type": "number",
"format": "float",
"description": "Integer between 0 and 5 specifying the number of most likely tokens to return."
},
"llm.prompts": {
"type": "string"
"gen_ai.request.top_p": {
"type": "number",
"format": "float",
"description": "Top P value from the input request"
},
"llm.responses": {
"type": "string"
"gen_ai.request.top_k": {
"type": "number",
"format": "float",
"description": "Top K results to return from the input request"
},
"llm.token.counts": {
"type": "string"
"gen_ai.user": {
"type": "string",
"description": "User ID from the input request"
},
"llm.stream": {
"type": "boolean"
"gen_ai.prompt": {
"type": "string",
"description": "Prompt text from the input request"
},
"llm.encoding.formats": {
"type": "string"
"gen_ai.completion": {
"type": "string",
"description": "Completion text from the response. This will be an array of json objects with the following format {\"role\": \"\", \"content\": \"\"}. Role can be one of the following values: [system, user, assistant, tool]"
},
"llm.dimensions": {
"type": "string"
"gen_ai.request.stream": {
"type": "boolean",
"description": "Stream flag from the input request"
},
"llm.generation_id": {
"type": "string"
"gen_ai.request.encoding_formats": {
"type": "array",
"items": {
"type": "string"
},
"description": "Encoding formats from the input request. Allowed values: ['float', 'int8','uint8', 'binary', 'ubinary', 'base64']"
},
"llm.response_id": {
"type": "string"
"gen_ai.request.dimensions": {
"type": "number",
"format": "int32",
"description": "Dimensions from the input request"
},
"llm.citations": {
"type": "string"
"gen_ai.response_id": {
"type": "string",
"description": "Response ID from the output response"
},
"llm.documents": {
"type": "string"
"gen_ai.response.finish_reasons": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of reasons the model stopped generating tokens, corresponding to each generation received"
},
"llm.is_search_required": {
"type": "boolean"
"gen_ai.system_fingerprint": {
"type": "string",
"description": "System fingerprint of the system that generated the response"
},
"llm.search_results": {
"type": "string"
"gen_ai.request.documents": {
"type": "string",
"description": "Array of documents from the input request json stringified"
},
"llm.tool_calls": {
"type": "string"
"gen_ai.request.is_search_required": {
"type": "boolean",
"description": "Search flag from the input request"
},
"llm.max_tokens": {
"type": "string"
"gen_ai.request.tool_choice": {
"type": "string",
"description": "Tool choice from the input request"
},
"llm.max_input_tokens": {
"type": "string"
"gen_ai.response.tool_calls": {
"type": "string",
"description": "Array of tool calls from the response json stringified"
},
"llm.conversation_id": {
"type": "string"
"gen_ai.request.max_tokens": {
"type": "number",
"format": "int32",
"description": "The maximum number of tokens the LLM generates for a request."
},
"llm.seed": {
"type": "string"
"gen_ai.usage.prompt_tokens": {
"type": "number",
"format": "int32",
"description": "The number of tokens used in the llm prompt."
},
"llm.frequency_penalty": {
"type": "string"
"gen_ai.usage.completion_tokens": {
"type": "number",
"format": "int32",
"description": "The number of tokens in the llm response."
},
"llm.presence_penalty": {
"type": "string"
"gen_ai.usage.search_units": {
"type": "number",
"format": "int32",
"description": "The number of search units used in the request."
},
"llm.connectors": {
"type": "string"
"gen_ai.request.seed": {
"type": "string",
"description": "Seed from the input request"
},
"llm.tools": {
"type": "string"
"gen_ai.request.frequency_penalty": {
"type": "number",
"format": "float",
"description": "Frequency penalty from the input request"
},
"llm.tool_results": {
"type": "string"
"gen_ai.request.presence_penalty": {
"type": "number",
"format": "float",
"description": "Presence penalty from the input request"
},
"llm.embedding_inputs": {
"type": "string"
"gen_ai.request.connectors": {
"type": "string",
"description": "An array of connectors from the input request json stringified"
},
"llm.embedding_dataset_id": {
"type": "string"
"gen_ai.request.tools": {
"type": "string",
"description": "An array of tools from the input request json stringified"
},
"llm.embedding_input_type": {
"type": "string"
"gen_ai.request.tool_results": {
"type": "string",
"description": "An array of tool results from the input request json stringified"
},
"llm.embedding_job_name": {
"type": "string"
"gen_ai.request.embedding_inputs": {
"type": "string",
"description": "An array of embedding inputs from the input request json stringified"
},
"llm.retrieval.query": {
"type": "string"
"gen_ai.request.embedding_dataset_id": {
"type": "string",
"description": "Embedding dataset ID from the input request"
},
"llm.retrieval.results": {
"type": "string"
"gen_ai.request.embedding_input_type": {
"type": "string",
"description": "Embedding input type from the input request. Allowed values: [ 'search_document', 'search_query', 'classification', 'clustering']"
},
"llm.image.size": {
"type": "string"
"gen_ai.request.embedding_job_name": {
"type": "string",
"description": "Embedding job name from the input request"
},
"llm.response_format": {
"type": "string"
"gen_ai.image.size": {
"type": "string",
"description": "Image size from the input request. Allowed values: ['256x256', '512x512', '1024x1024']"
},
"gen_ai.request.response_format": {
"type": "string",
"description": "Response format from the input request. Allowed values: ['url', 'b64_json']"
},
"http.max.retries": {
"type": "integer",
Expand All @@ -144,8 +203,13 @@
"type": "integer",
"format": "int64"
},
"langtrace.testId": {
"type": "string"
"gen_ai.cohere.rerank.query": {
"type": "string",
"description": "Query from the input request for the rerank api"
},
"gen_ai.cohere.rerank.results": {
"type": "string",
"description": "Results from the rerank api"
}
},
"required": [
Expand All @@ -154,6 +218,6 @@
"langtrace.sdk.name",
"langtrace.version",
"url.full",
"llm.api"
"url.path"
]
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name="trace-attributes", # Choose a unique name for PyPI
version="5.0.4",
version="6.0.0",
author="Karthik Kalyanaraman",
author_email="[email protected]",
description="LangTrace - Trace Attributes",
Expand Down
Loading