langtrace-python-sdk 2.2.26__py3-none-any.whl → 2.2.27__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- langtrace_python_sdk/utils/llm.py +7 -0
- langtrace_python_sdk/version.py +1 -1
- {langtrace_python_sdk-2.2.26.dist-info → langtrace_python_sdk-2.2.27.dist-info}/METADATA +1 -1
- {langtrace_python_sdk-2.2.26.dist-info → langtrace_python_sdk-2.2.27.dist-info}/RECORD +7 -7
- {langtrace_python_sdk-2.2.26.dist-info → langtrace_python_sdk-2.2.27.dist-info}/WHEEL +0 -0
- {langtrace_python_sdk-2.2.26.dist-info → langtrace_python_sdk-2.2.27.dist-info}/entry_points.txt +0 -0
- {langtrace_python_sdk-2.2.26.dist-info → langtrace_python_sdk-2.2.27.dist-info}/licenses/LICENSE +0 -0
|
@@ -18,6 +18,7 @@ from langtrace_python_sdk.constants import LANGTRACE_SDK_NAME
|
|
|
18
18
|
from langtrace_python_sdk.utils import set_span_attribute
|
|
19
19
|
from openai import NOT_GIVEN
|
|
20
20
|
from tiktoken import get_encoding
|
|
21
|
+
from tiktoken import get_encoding, list_encoding_names
|
|
21
22
|
|
|
22
23
|
from langtrace_python_sdk.constants.instrumentation.common import (
|
|
23
24
|
LANGTRACE_ADDITIONAL_SPAN_ATTRIBUTES_KEY,
|
|
@@ -30,6 +31,7 @@ import json
|
|
|
30
31
|
from opentelemetry import baggage
|
|
31
32
|
from opentelemetry.trace import Span
|
|
32
33
|
from opentelemetry.trace.status import StatusCode
|
|
34
|
+
|
|
33
35
|
import os
|
|
34
36
|
|
|
35
37
|
|
|
@@ -253,6 +255,11 @@ class StreamWrapper:
|
|
|
253
255
|
self._span_started = True
|
|
254
256
|
|
|
255
257
|
def cleanup(self):
|
|
258
|
+
if self.completion_tokens==0:
|
|
259
|
+
response_model = 'cl100k_base'
|
|
260
|
+
if self._response_model in list_encoding_names():
|
|
261
|
+
response_model = self._response_model
|
|
262
|
+
self.completion_tokens = estimate_tokens_using_tiktoken("".join(self.result_content), response_model)
|
|
256
263
|
if self._span_started:
|
|
257
264
|
set_span_attribute(
|
|
258
265
|
self.span,
|
langtrace_python_sdk/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.2.
|
|
1
|
+
__version__ = "2.2.27"
|
|
@@ -79,7 +79,7 @@ examples/weaviate_example/__init__.py,sha256=8JMDBsRSEV10HfTd-YC7xb4txBjD3la56sn
|
|
|
79
79
|
examples/weaviate_example/query_text.py,sha256=wPHQTc_58kPoKTZMygVjTj-2ZcdrIuaausJfMxNQnQc,127162
|
|
80
80
|
langtrace_python_sdk/__init__.py,sha256=VZM6i71NR7pBQK6XvJWRelknuTYUhqwqE7PlicKa5Wg,1166
|
|
81
81
|
langtrace_python_sdk/langtrace.py,sha256=kcSZal0BVw2FWhndpQZ3o8xJSnRHdW7aqG5f1X78zHo,8068
|
|
82
|
-
langtrace_python_sdk/version.py,sha256=
|
|
82
|
+
langtrace_python_sdk/version.py,sha256=YIb1GvBsRr6723DUcRaOBOMg9peNoF7_LdCAWzgux1I,23
|
|
83
83
|
langtrace_python_sdk/constants/__init__.py,sha256=P8QvYwt5czUNDZsKS64vxm9Dc41ptGbuF1TFtAF6nv4,44
|
|
84
84
|
langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=5MNjnAOg-4am78J3gVMH6FSwq5N8TOj72ugkhsw4vi0,46
|
|
85
85
|
langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -160,7 +160,7 @@ langtrace_python_sdk/instrumentation/weaviate/patch.py,sha256=nr7USyY6overK3GQCo
|
|
|
160
160
|
langtrace_python_sdk/types/__init__.py,sha256=M-_6eLNR8GhjFZH3iMay4s3j7EcsT-hRAM5IWluS58A,3403
|
|
161
161
|
langtrace_python_sdk/utils/__init__.py,sha256=SwYYPIh2AzEpI3zbwowQU2zJlwRwoVdWOCcrAKnkI9g,873
|
|
162
162
|
langtrace_python_sdk/utils/langtrace_sampler.py,sha256=BupNndHbU9IL_wGleKetz8FdcveqHMBVz1bfKTTW80w,1753
|
|
163
|
-
langtrace_python_sdk/utils/llm.py,sha256=
|
|
163
|
+
langtrace_python_sdk/utils/llm.py,sha256=k-xrIfwTZdWjKJHlCFsKUjQVNabN8X_VwH0g3ta5JwQ,14570
|
|
164
164
|
langtrace_python_sdk/utils/misc.py,sha256=CD9NWRLxLpFd0YwlHJqzlpFNedXVWtAKGOjQWnDCo8k,838
|
|
165
165
|
langtrace_python_sdk/utils/prompt_registry.py,sha256=n5dQMVLBw8aJZY8Utvf67bncc25ELf6AH9BYw8_hSzo,2619
|
|
166
166
|
langtrace_python_sdk/utils/sdk_version_checker.py,sha256=FzjIWZjn53cX0LEVPdipQd1fO9lG8iGVUEVUs9Hyk6M,1713
|
|
@@ -209,8 +209,8 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
|
|
|
209
209
|
tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
|
|
210
210
|
tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
|
|
211
211
|
tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
|
|
212
|
-
langtrace_python_sdk-2.2.
|
|
213
|
-
langtrace_python_sdk-2.2.
|
|
214
|
-
langtrace_python_sdk-2.2.
|
|
215
|
-
langtrace_python_sdk-2.2.
|
|
216
|
-
langtrace_python_sdk-2.2.
|
|
212
|
+
langtrace_python_sdk-2.2.27.dist-info/METADATA,sha256=w2twi1G2i8O8nf8NuCN0wLSJvrq7pv-k4WUISBDFIwU,14836
|
|
213
|
+
langtrace_python_sdk-2.2.27.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
214
|
+
langtrace_python_sdk-2.2.27.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
|
|
215
|
+
langtrace_python_sdk-2.2.27.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
216
|
+
langtrace_python_sdk-2.2.27.dist-info/RECORD,,
|
|
File without changes
|
{langtrace_python_sdk-2.2.26.dist-info → langtrace_python_sdk-2.2.27.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{langtrace_python_sdk-2.2.26.dist-info → langtrace_python_sdk-2.2.27.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|