langtrace-python-sdk 3.3.7__py3-none-any.whl → 3.3.8__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -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("LANGTRACE_API_HOST", LANGTRACE_REMOTE_URL)
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 hexadecimals
166
- span_hex_number = hex(int(data["spanId"], 10))[2:] # Convert to hex and remove the '0x' prefix
167
- formatted_span_hex_number = span_hex_number.zfill(16) # Pad with zeros to 16 characters
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
- trace_hex_number = hex(int(data["traceId"], 10))[2:] # Convert to hex and remove the '0x' prefix
171
- formatted_trace_hex_number = trace_hex_number.zfill(32) # Pad with zeros to 32 characters
172
- data["traceId"] = f"0x{formatted_trace_hex_number}"
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}
@@ -1 +1 @@
1
- __version__ = "3.3.7"
1
+ __version__ = "3.3.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: langtrace-python-sdk
3
- Version: 3.3.7
3
+ Version: 3.3.8
4
4
  Summary: Python SDK for LangTrace
5
5
  Project-URL: Homepage, https://github.com/Scale3-Labs/langtrace-python-sdk
6
6
  Author-email: Scale3 Labs <engineering@scale3labs.com>
@@ -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=3F4-qyOqFzf6p1RSj1DFFxsNoAZY7v8Lh4g109vr39E,22
108
+ langtrace_python_sdk/version.py,sha256=pQATGDyqrNBUFj1qQmGoPCfn2udX5OQy6wvCOuVPUfg,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
@@ -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=2iWu8XD1NOFqSFgDZDJiMHZ1JB4HzmYPLr_F3Ugul2k,8480
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.7.dist-info/METADATA,sha256=mPY5ZCzq5zv5tozpM1La21OLTU6I2phpk9zevTexhns,15642
268
- langtrace_python_sdk-3.3.7.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
269
- langtrace_python_sdk-3.3.7.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
270
- langtrace_python_sdk-3.3.7.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
271
- langtrace_python_sdk-3.3.7.dist-info/RECORD,,
267
+ langtrace_python_sdk-3.3.8.dist-info/METADATA,sha256=sfFy68YkEQs8-KFe2u4oLkL7tn1KohguWPdWBzC5uPs,15642
268
+ langtrace_python_sdk-3.3.8.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
269
+ langtrace_python_sdk-3.3.8.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
270
+ langtrace_python_sdk-3.3.8.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
271
+ langtrace_python_sdk-3.3.8.dist-info/RECORD,,