From 35154bbd6397be757ab9a6504954373a594996a3 Mon Sep 17 00:00:00 2001 From: Darshit Suratwala Date: Mon, 22 Jul 2024 13:49:48 -0700 Subject: [PATCH] chore: adding open ai chunking and tool choice --- setup.py | 2 +- src/python/langtrace/trace_attributes/__init__.py | 1 + .../trace_attributes/models/llm_span_attributes.py | 7 ++++++- src/typescript/package-lock.json | 4 ++-- src/typescript/package.json | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index c75b54d..0d1f6b2 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name="trace-attributes", # Choose a unique name for PyPI - version="6.0.2", + version="6.0.3", author="Karthik Kalyanaraman", author_email="karthik@scale3labs.com", description="LangTrace - Trace Attributes", diff --git a/src/python/langtrace/trace_attributes/__init__.py b/src/python/langtrace/trace_attributes/__init__.py index 7d3efb0..8872fae 100644 --- a/src/python/langtrace/trace_attributes/__init__.py +++ b/src/python/langtrace/trace_attributes/__init__.py @@ -46,6 +46,7 @@ class SpanAttributes: LLM_USER = "gen_ai.user" LLM_TOOLS = "gen_ai.request.tools" + LLM_TOOL_CHOICE = "gen_ai.request.tool_choice" LLM_TOOL_RESULTS = "gen_ai.request.tool_results" LLM_TOP_K = "gen_ai.request.top_k" diff --git a/src/python/langtrace/trace_attributes/models/llm_span_attributes.py b/src/python/langtrace/trace_attributes/models/llm_span_attributes.py index 289515d..8c63c37 100644 --- a/src/python/langtrace/trace_attributes/models/llm_span_attributes.py +++ b/src/python/langtrace/trace_attributes/models/llm_span_attributes.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: llm_span_attributes.json -# timestamp: 2024-07-10T15:09:12+00:00 +# timestamp: 2024-07-22T20:39:30+00:00 from __future__ import annotations @@ -91,6 +91,11 @@ class LLMSpanAttributes(BaseModel): alias='gen_ai.request.encoding_formats', description="Encoding formats from the input request. Allowed values: ['float', 'int8','uint8', 'binary', 'ubinary', 'base64']", ) + gen_ai_completion_chunk: Optional[str] = Field( + None, + alias='gen_ai.completion.chunk', + description='Chunk text from the response', + ) gen_ai_request_dimensions: Optional[float] = Field( None, alias='gen_ai.request.dimensions', diff --git a/src/typescript/package-lock.json b/src/typescript/package-lock.json index 6f0eccb..d59462f 100644 --- a/src/typescript/package-lock.json +++ b/src/typescript/package-lock.json @@ -1,12 +1,12 @@ { "name": "@langtrase/trace-attributes", - "version": "6.0.4", + "version": "6.0.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@langtrase/trace-attributes", - "version": "6.0.4", + "version": "6.0.6", "license": "MIT", "dependencies": { "json-schema-to-typescript": "^14.1.0", diff --git a/src/typescript/package.json b/src/typescript/package.json index 36a50d4..bb24627 100644 --- a/src/typescript/package.json +++ b/src/typescript/package.json @@ -1,6 +1,6 @@ { "name": "@langtrase/trace-attributes", - "version": "6.0.5", + "version": "6.0.6", "description": "LangTrace - Trace Attributes", "main": "dist/index.js", "types": "dist/index.d.ts",