langtrace-python-sdk 3.3.7__py3-none-any.whl → 3.3.9__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/instrumentation/mistral/patch.py +2 -5
- langtrace_python_sdk/utils/with_root_span.py +10 -8
- langtrace_python_sdk/version.py +1 -1
- {langtrace_python_sdk-3.3.7.dist-info → langtrace_python_sdk-3.3.9.dist-info}/METADATA +1 -1
- {langtrace_python_sdk-3.3.7.dist-info → langtrace_python_sdk-3.3.9.dist-info}/RECORD +8 -8
- {langtrace_python_sdk-3.3.7.dist-info → langtrace_python_sdk-3.3.9.dist-info}/WHEEL +0 -0
- {langtrace_python_sdk-3.3.7.dist-info → langtrace_python_sdk-3.3.9.dist-info}/entry_points.txt +0 -0
- {langtrace_python_sdk-3.3.7.dist-info → langtrace_python_sdk-3.3.9.dist-info}/licenses/LICENSE +0 -0
@@ -46,7 +46,7 @@ from langtrace_python_sdk.instrumentation.openai.patch import extract_content
|
|
46
46
|
|
47
47
|
|
48
48
|
def chat_complete(original_method, version, tracer, is_async=False, is_streaming=False):
|
49
|
-
|
49
|
+
|
50
50
|
def traced_method(wrapped, instance, args, kwargs):
|
51
51
|
service_provider = SERVICE_PROVIDERS["MISTRAL"]
|
52
52
|
llm_prompts = []
|
@@ -65,7 +65,6 @@ def chat_complete(original_method, version, tracer, is_async=False, is_streaming
|
|
65
65
|
|
66
66
|
attributes = LLMSpanAttributes(**span_attributes)
|
67
67
|
|
68
|
-
|
69
68
|
span = tracer.start_span(
|
70
69
|
name=get_span_name(APIS[api]["METHOD"]),
|
71
70
|
kind=SpanKind.CLIENT,
|
@@ -87,7 +86,6 @@ def chat_complete(original_method, version, tracer, is_async=False, is_streaming
|
|
87
86
|
span.set_status(StatusCode.OK)
|
88
87
|
span.end()
|
89
88
|
return result
|
90
|
-
|
91
89
|
|
92
90
|
except Exception as error:
|
93
91
|
span.record_exception(error)
|
@@ -186,7 +184,6 @@ def _set_response_attributes(span, kwargs, result):
|
|
186
184
|
for choice in result.choices
|
187
185
|
]
|
188
186
|
set_event_completion(span, responses)
|
189
|
-
|
190
187
|
# Get the usage
|
191
188
|
if hasattr(result, "usage") and result.usage is not None:
|
192
|
-
set_usage_attributes(span, result.usage)
|
189
|
+
set_usage_attributes(span, dict(result.usage))
|
@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
15
15
|
"""
|
16
16
|
|
17
|
+
import base64
|
17
18
|
import asyncio
|
18
19
|
import os
|
19
20
|
from deprecated import deprecated
|
@@ -145,7 +146,9 @@ class SendUserFeedback:
|
|
145
146
|
_langtrace_api_key: str
|
146
147
|
|
147
148
|
def __init__(self):
|
148
|
-
self._langtrace_host = os.environ.get(
|
149
|
+
self._langtrace_host = os.environ.get(
|
150
|
+
"LANGTRACE_API_HOST", LANGTRACE_REMOTE_URL
|
151
|
+
)
|
149
152
|
# When the host is set to /api/trace, remove the /api/trace
|
150
153
|
if self._langtrace_host.endswith("/api/trace"):
|
151
154
|
self._langtrace_host = self._langtrace_host.replace("/api/trace", "")
|
@@ -162,14 +165,13 @@ class SendUserFeedback:
|
|
162
165
|
print(Fore.RESET)
|
163
166
|
return
|
164
167
|
|
165
|
-
# convert spanId and traceId to
|
166
|
-
|
167
|
-
|
168
|
-
data["spanId"] = f"0x{formatted_span_hex_number}"
|
168
|
+
# convert spanId and traceId to Base64
|
169
|
+
span_bytes = int(data["spanId"], 10).to_bytes(8, "big")
|
170
|
+
data["spanId"] = base64.b64encode(span_bytes).decode("ascii")
|
169
171
|
|
170
|
-
|
171
|
-
|
172
|
-
data["traceId"] =
|
172
|
+
# Convert traceId to base64
|
173
|
+
trace_bytes = int(data["traceId"], 10).to_bytes(16, "big")
|
174
|
+
data["traceId"] = base64.b64encode(trace_bytes).decode("ascii")
|
173
175
|
|
174
176
|
evaluation = self.get_evaluation(data["spanId"])
|
175
177
|
headers = {"x-api-key": self._langtrace_api_key}
|
langtrace_python_sdk/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "3.3.
|
1
|
+
__version__ = "3.3.9"
|
@@ -105,7 +105,7 @@ examples/weaviate_example/__init__.py,sha256=8JMDBsRSEV10HfTd-YC7xb4txBjD3la56sn
|
|
105
105
|
examples/weaviate_example/query_text.py,sha256=wPHQTc_58kPoKTZMygVjTj-2ZcdrIuaausJfMxNQnQc,127162
|
106
106
|
langtrace_python_sdk/__init__.py,sha256=VZM6i71NR7pBQK6XvJWRelknuTYUhqwqE7PlicKa5Wg,1166
|
107
107
|
langtrace_python_sdk/langtrace.py,sha256=TtRWuUiWUB0S7JiQpUsF9lZsiyqPG3m9mMDX-QlDgAw,12601
|
108
|
-
langtrace_python_sdk/version.py,sha256=
|
108
|
+
langtrace_python_sdk/version.py,sha256=yEHnZnJtVwSuoRBWEbpTXI-KzATzAJQjuf0BcvE1EkQ,22
|
109
109
|
langtrace_python_sdk/constants/__init__.py,sha256=3CNYkWMdd1DrkGqzLUgNZXjdAlM6UFMlf_F-odAToyc,146
|
110
110
|
langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=d-3Qn5C_NTy1NkmdavZvy-6vePwTC5curN6QMy2haHc,50
|
111
111
|
langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -189,7 +189,7 @@ langtrace_python_sdk/instrumentation/milvus/instrumentation.py,sha256=bpf6uRIJ44
|
|
189
189
|
langtrace_python_sdk/instrumentation/milvus/patch.py,sha256=0yY5aQz0x7hpQZ8U-0qfyk_KIizW60s0e2CZrXe3FNk,4729
|
190
190
|
langtrace_python_sdk/instrumentation/mistral/__init__.py,sha256=mkGALBQvq0jSfwDl6TU09SFwnVs6O4zkUi-yVmd3SNg,90
|
191
191
|
langtrace_python_sdk/instrumentation/mistral/instrumentation.py,sha256=qtCkHCSOaiicUChbmTID4lcK1rbeW8oRSbpda2ogbgM,2328
|
192
|
-
langtrace_python_sdk/instrumentation/mistral/patch.py,sha256=
|
192
|
+
langtrace_python_sdk/instrumentation/mistral/patch.py,sha256=5EzqMeIEcMUH8P-l9-ijpRNWSc6mYwe9Gz0VY4PLrS0,6559
|
193
193
|
langtrace_python_sdk/instrumentation/ollama/__init__.py,sha256=g2zJsXnDHinXPzTc-WxDeTtHmr9gmAj3K6l_00kP8c8,82
|
194
194
|
langtrace_python_sdk/instrumentation/ollama/instrumentation.py,sha256=jdsvkqUJAAUNLVPtAkn_rG26HXetVQXWtjn4a6eWZro,2029
|
195
195
|
langtrace_python_sdk/instrumentation/ollama/patch.py,sha256=7ETx0tQic5h_kH1f-IeptFwgNTBb4hSkTkWsB18Avm0,5375
|
@@ -221,7 +221,7 @@ langtrace_python_sdk/utils/prompt_registry.py,sha256=n5dQMVLBw8aJZY8Utvf67bncc25
|
|
221
221
|
langtrace_python_sdk/utils/sdk_version_checker.py,sha256=F-VVVH7Fmhr5LcY0IIe-34zIi5RQcx26uuxFpPzZesM,1782
|
222
222
|
langtrace_python_sdk/utils/silently_fail.py,sha256=wzmvRDZppaRZgVP8C1xpq2GlWXYCwubhaeWvEbQP1SI,1196
|
223
223
|
langtrace_python_sdk/utils/types.py,sha256=l-N6o7cnWUyrD6dBvW7W3Pf5CkPo5QaoT__k1XLbrQg,383
|
224
|
-
langtrace_python_sdk/utils/with_root_span.py,sha256=
|
224
|
+
langtrace_python_sdk/utils/with_root_span.py,sha256=EW0WQfxESntf23dJt0E0rFdHV-7BRniW1Ce6nrCoEPY,8291
|
225
225
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
226
226
|
tests/conftest.py,sha256=0Jo6iCZTXbdvyJVhG9UpYGkLabL75378oauCzmt-Sa8,603
|
227
227
|
tests/utils.py,sha256=8ZBYvxBH6PynipT1sqenfyjTGLhEV7SORQH1NJjnpsM,2500
|
@@ -264,8 +264,8 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
|
|
264
264
|
tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
|
265
265
|
tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
|
266
266
|
tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
|
267
|
-
langtrace_python_sdk-3.3.
|
268
|
-
langtrace_python_sdk-3.3.
|
269
|
-
langtrace_python_sdk-3.3.
|
270
|
-
langtrace_python_sdk-3.3.
|
271
|
-
langtrace_python_sdk-3.3.
|
267
|
+
langtrace_python_sdk-3.3.9.dist-info/METADATA,sha256=ZFliHANcgt7Nt3sraMuYfw7_C4vheqrKZEz7P-yL30o,15642
|
268
|
+
langtrace_python_sdk-3.3.9.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
269
|
+
langtrace_python_sdk-3.3.9.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
|
270
|
+
langtrace_python_sdk-3.3.9.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
271
|
+
langtrace_python_sdk-3.3.9.dist-info/RECORD,,
|
File without changes
|
{langtrace_python_sdk-3.3.7.dist-info → langtrace_python_sdk-3.3.9.dist-info}/entry_points.txt
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.7.dist-info → langtrace_python_sdk-3.3.9.dist-info}/licenses/LICENSE
RENAMED
File without changes
|