langtrace-python-sdk 3.3.12__py3-none-any.whl → 3.3.14__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/dspy/instrumentation.py +2 -2
- langtrace_python_sdk/instrumentation/gemini/patch.py +3 -3
- langtrace_python_sdk/instrumentation/langchain_core/patch.py +1 -1
- langtrace_python_sdk/instrumentation/vertexai/patch.py +1 -1
- langtrace_python_sdk/langtrace.py +1 -1
- langtrace_python_sdk/utils/llm.py +1 -1
- langtrace_python_sdk/version.py +1 -1
- {langtrace_python_sdk-3.3.12.dist-info → langtrace_python_sdk-3.3.14.dist-info}/METADATA +1 -1
- {langtrace_python_sdk-3.3.12.dist-info → langtrace_python_sdk-3.3.14.dist-info}/RECORD +12 -12
- {langtrace_python_sdk-3.3.12.dist-info → langtrace_python_sdk-3.3.14.dist-info}/WHEEL +0 -0
- {langtrace_python_sdk-3.3.12.dist-info → langtrace_python_sdk-3.3.14.dist-info}/entry_points.txt +0 -0
- {langtrace_python_sdk-3.3.12.dist-info → langtrace_python_sdk-3.3.14.dist-info}/licenses/LICENSE +0 -0
@@ -27,12 +27,12 @@ class DspyInstrumentation(BaseInstrumentor):
|
|
27
27
|
The DspyInstrumentor class represents the DSPy instrumentation"""
|
28
28
|
|
29
29
|
def instrumentation_dependencies(self) -> Collection[str]:
|
30
|
-
return ["dspy
|
30
|
+
return ["dspy >= 2.0.0"]
|
31
31
|
|
32
32
|
def _instrument(self, **kwargs):
|
33
33
|
tracer_provider = kwargs.get("tracer_provider")
|
34
34
|
tracer = get_tracer(__name__, "", tracer_provider)
|
35
|
-
version = v("dspy
|
35
|
+
version = v("dspy")
|
36
36
|
_W(
|
37
37
|
"dspy.teleprompt.bootstrap",
|
38
38
|
"BootstrapFewShot.compile",
|
@@ -137,7 +137,7 @@ def set_response_attributes(
|
|
137
137
|
if hasattr(result, "text"):
|
138
138
|
set_event_completion(span, [{"role": "assistant", "content": result.text}])
|
139
139
|
|
140
|
-
if hasattr(result, "usage_metadata"):
|
140
|
+
if hasattr(result, "usage_metadata") and result.usage_metadata is not None:
|
141
141
|
usage = result.usage_metadata
|
142
142
|
input_tokens = usage.prompt_token_count
|
143
143
|
output_tokens = usage.candidates_token_count
|
@@ -152,7 +152,7 @@ def build_streaming_response(span, response):
|
|
152
152
|
item_to_yield = item
|
153
153
|
complete_response += str(item.text)
|
154
154
|
yield item_to_yield
|
155
|
-
if hasattr(item, "usage_metadata"):
|
155
|
+
if hasattr(item, "usage_metadata") and item.usage_metadata is not None:
|
156
156
|
usage = item.usage_metadata
|
157
157
|
input_tokens = usage.prompt_token_count
|
158
158
|
output_tokens = usage.candidates_token_count
|
@@ -171,7 +171,7 @@ async def abuild_streaming_response(span, response):
|
|
171
171
|
item_to_yield = item
|
172
172
|
complete_response += str(item.text)
|
173
173
|
yield item_to_yield
|
174
|
-
if hasattr(item, "usage_metadata"):
|
174
|
+
if hasattr(item, "usage_metadata") and item.usage_metadata is not None:
|
175
175
|
usage = item.usage_metadata
|
176
176
|
input_tokens = usage.prompt_token_count
|
177
177
|
output_tokens = usage.candidates_token_count
|
@@ -98,7 +98,7 @@ def generic_patch(
|
|
98
98
|
result = wrapped(*args, **kwargs)
|
99
99
|
if trace_output:
|
100
100
|
span.set_attribute("langchain.outputs", to_json_string(result))
|
101
|
-
if hasattr(result, "usage_metadata"):
|
101
|
+
if hasattr(result, "usage_metadata") and result.usage_metadata is not None:
|
102
102
|
span.set_attribute(
|
103
103
|
SpanAttributes.LLM_USAGE_PROMPT_TOKENS,
|
104
104
|
result.usage_metadata["input_tokens"],
|
@@ -77,7 +77,7 @@ def set_response_attributes(span: Span, result):
|
|
77
77
|
if hasattr(result, "text"):
|
78
78
|
set_event_completion(span, [{"role": "assistant", "content": result.text}])
|
79
79
|
|
80
|
-
if hasattr(result, "usage_metadata"):
|
80
|
+
if hasattr(result, "usage_metadata") and result.usage_metadata is not None:
|
81
81
|
usage = result.usage_metadata
|
82
82
|
input_tokens = usage.prompt_token_count
|
83
83
|
output_tokens = usage.candidates_token_count
|
@@ -275,7 +275,7 @@ def init(
|
|
275
275
|
"weaviate-client": WeaviateInstrumentation(),
|
276
276
|
"sqlalchemy": SQLAlchemyInstrumentor(),
|
277
277
|
"ollama": OllamaInstrumentor(),
|
278
|
-
"dspy
|
278
|
+
"dspy": DspyInstrumentation(),
|
279
279
|
"crewai": CrewAIInstrumentation(),
|
280
280
|
"vertexai": VertexAIInstrumentation(),
|
281
281
|
"google-cloud-aiplatform": VertexAIInstrumentation(),
|
@@ -421,7 +421,7 @@ class StreamWrapper:
|
|
421
421
|
self.completion_tokens = chunk.usage.completion_tokens
|
422
422
|
|
423
423
|
# VertexAI
|
424
|
-
if hasattr(chunk, "usage_metadata"):
|
424
|
+
if hasattr(chunk, "usage_metadata") and chunk.usage_metadata is not None:
|
425
425
|
self.completion_tokens = chunk.usage_metadata.candidates_token_count
|
426
426
|
self.prompt_tokens = chunk.usage_metadata.prompt_token_count
|
427
427
|
|
langtrace_python_sdk/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "3.3.
|
1
|
+
__version__ = "3.3.14"
|
@@ -105,8 +105,8 @@ examples/vertexai_example/main.py,sha256=gndId5X5ksD-ycxnAWMdEqIDbLc3kz5Vt8vm4YP
|
|
105
105
|
examples/weaviate_example/__init__.py,sha256=8JMDBsRSEV10HfTd-YC7xb4txBjD3la56snk-Bbg2Kw,618
|
106
106
|
examples/weaviate_example/query_text.py,sha256=wPHQTc_58kPoKTZMygVjTj-2ZcdrIuaausJfMxNQnQc,127162
|
107
107
|
langtrace_python_sdk/__init__.py,sha256=VZM6i71NR7pBQK6XvJWRelknuTYUhqwqE7PlicKa5Wg,1166
|
108
|
-
langtrace_python_sdk/langtrace.py,sha256=
|
109
|
-
langtrace_python_sdk/version.py,sha256=
|
108
|
+
langtrace_python_sdk/langtrace.py,sha256=AN6ecuL47c5eIkgYLW-0nDyEZPaqKfOYRbw7ceZzJss,12598
|
109
|
+
langtrace_python_sdk/version.py,sha256=CqO2fihQQDwHrmeVCLh8taqNG1MqN22CIlPvPJZ-nVc,23
|
110
110
|
langtrace_python_sdk/constants/__init__.py,sha256=3CNYkWMdd1DrkGqzLUgNZXjdAlM6UFMlf_F-odAToyc,146
|
111
111
|
langtrace_python_sdk/constants/exporter/langtrace_exporter.py,sha256=d-3Qn5C_NTy1NkmdavZvy-6vePwTC5curN6QMy2haHc,50
|
112
112
|
langtrace_python_sdk/constants/instrumentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -155,14 +155,14 @@ langtrace_python_sdk/instrumentation/crewai/__init__.py,sha256=_UBKfvQv7l0g2_wnm
|
|
155
155
|
langtrace_python_sdk/instrumentation/crewai/instrumentation.py,sha256=5Umzq8zjEnMEtjZZiMB4DQOPkxZ-1vts7RKC6JWpn24,2969
|
156
156
|
langtrace_python_sdk/instrumentation/crewai/patch.py,sha256=VoyOtGKYzaOIu7UnVNTemZeB3LrCIodrrYwmXLdxRw8,9133
|
157
157
|
langtrace_python_sdk/instrumentation/dspy/__init__.py,sha256=tM1srfi_QgyCzrde4izojMrRq2Wm7Dj5QUvVQXIJzkk,84
|
158
|
-
langtrace_python_sdk/instrumentation/dspy/instrumentation.py,sha256=
|
158
|
+
langtrace_python_sdk/instrumentation/dspy/instrumentation.py,sha256=qx2vBeuODI7rubf-0bkuNzDWu4bLI-E5uabrWTEuH6k,2923
|
159
159
|
langtrace_python_sdk/instrumentation/dspy/patch.py,sha256=H7zF4PVdtepOSpzJuEcckKUjnZQYKlY7yhn3dk6xbpY,10458
|
160
160
|
langtrace_python_sdk/instrumentation/embedchain/__init__.py,sha256=5L6n8-brMnRWZ0CMmHEuN1mrhIxrYLNtxRy0Ujc-hOY,103
|
161
161
|
langtrace_python_sdk/instrumentation/embedchain/instrumentation.py,sha256=dShwm0duy25IvL7g9I_v-2oYuyh2fadeiJqXtXBay-8,1987
|
162
162
|
langtrace_python_sdk/instrumentation/embedchain/patch.py,sha256=ovvBrtqUDwGSmSgK_S3pOOrDa4gkPSFG-HvmsxqmJE8,3627
|
163
163
|
langtrace_python_sdk/instrumentation/gemini/__init__.py,sha256=ilWmKA4Li-g3DX6R10WQ4v-51VljxToEnJpOQoQB5uQ,88
|
164
164
|
langtrace_python_sdk/instrumentation/gemini/instrumentation.py,sha256=eGWr2dy1f_9TVZiXSH_MlNQINyS4I28EsOTKREdMVio,1304
|
165
|
-
langtrace_python_sdk/instrumentation/gemini/patch.py,sha256=
|
165
|
+
langtrace_python_sdk/instrumentation/gemini/patch.py,sha256=PG5E5v253x2ufQ81-aUUFzDRYq-DDhiqwmNoplHPjsM,6261
|
166
166
|
langtrace_python_sdk/instrumentation/groq/__init__.py,sha256=ZXeq_nrej6Lm_uoMFEg8wbSejhjB2UJ5IoHQBPc2-C0,91
|
167
167
|
langtrace_python_sdk/instrumentation/groq/instrumentation.py,sha256=Ttf07XVKhdYY1_fqJc7QWiSdmgEhEVyQB_3Az2_wqYo,1832
|
168
168
|
langtrace_python_sdk/instrumentation/groq/patch.py,sha256=J0h8SXEw2LyMIJhKZTVydEysyKfSLWkCuhEharzDS4w,23161
|
@@ -174,7 +174,7 @@ langtrace_python_sdk/instrumentation/langchain_community/instrumentation.py,sha2
|
|
174
174
|
langtrace_python_sdk/instrumentation/langchain_community/patch.py,sha256=Vh9XxkXo_0eD3etrTTb-6ME6LroNJy5e75VYcfhc44U,6289
|
175
175
|
langtrace_python_sdk/instrumentation/langchain_core/__init__.py,sha256=kumE_reeqgM-ZvEZ6-XxyT-F-HAdKq_v_PKvsLb4EZQ,110
|
176
176
|
langtrace_python_sdk/instrumentation/langchain_core/instrumentation.py,sha256=szTCveG4IP64rlaY4iZATWv2f38k1_DtfbBU60YlfYk,6730
|
177
|
-
langtrace_python_sdk/instrumentation/langchain_core/patch.py,sha256=
|
177
|
+
langtrace_python_sdk/instrumentation/langchain_core/patch.py,sha256=GODPXS1RvYVuRDyxcP9dX5TBI_JniPtRe0WWdeIIzcY,10956
|
178
178
|
langtrace_python_sdk/instrumentation/langgraph/__init__.py,sha256=eitlHloY-aZ4ZuIEJx61AadEA3G7siyecP-V-lziAr8,101
|
179
179
|
langtrace_python_sdk/instrumentation/langgraph/instrumentation.py,sha256=lEm_rcOU4JqXGmhG1C2yrIiPbt9vntvxmU7pZg8NYtE,2313
|
180
180
|
langtrace_python_sdk/instrumentation/langgraph/patch.py,sha256=e1cFCDUB8Dwl2ekxgnZ36S2XkWROagRGtxF3Rz5F8RM,4931
|
@@ -209,14 +209,14 @@ langtrace_python_sdk/instrumentation/qdrant/instrumentation.py,sha256=vl2eKSP55a
|
|
209
209
|
langtrace_python_sdk/instrumentation/qdrant/patch.py,sha256=IgdozFyKqB8n72BjKvBDiMhYM4o75DReD0I8_uIQ7KY,5015
|
210
210
|
langtrace_python_sdk/instrumentation/vertexai/__init__.py,sha256=ZzKxB7bl0FaRlgJhhgAk5V8Bf20FmThWM_Z9u9Eyy1s,92
|
211
211
|
langtrace_python_sdk/instrumentation/vertexai/instrumentation.py,sha256=yz4trw0BqGbNUvlagsejk_j8pDvRHxxQFtYJVarNKqY,1393
|
212
|
-
langtrace_python_sdk/instrumentation/vertexai/patch.py,sha256=
|
212
|
+
langtrace_python_sdk/instrumentation/vertexai/patch.py,sha256=55xwmkFfeevEc4yOHPRxwdeRrsS6UptcZoMq-yeFrt4,4471
|
213
213
|
langtrace_python_sdk/instrumentation/weaviate/__init__.py,sha256=Mc-Je6evPo-kKQzerTG7bd1XO5JOh4YGTE3wBxaUBwg,99
|
214
214
|
langtrace_python_sdk/instrumentation/weaviate/instrumentation.py,sha256=Kwq5QQTUQNRHrWrMnNe9X0TcqtXGiNpBidsuToRTqG0,2417
|
215
215
|
langtrace_python_sdk/instrumentation/weaviate/patch.py,sha256=aWLDbNGz35V6XQUv4lkMD0O689suqh6KdTa33VDtUkE,6905
|
216
216
|
langtrace_python_sdk/types/__init__.py,sha256=2VykM6fNHRlkOaIEUCdK3VyaaVgk2rTIr9jMmCVj2Ag,4676
|
217
217
|
langtrace_python_sdk/utils/__init__.py,sha256=VVDOG-QLd59ZvSHp0avjof0sbxlZ1QQOf0KoOF7ofhQ,3310
|
218
218
|
langtrace_python_sdk/utils/langtrace_sampler.py,sha256=BupNndHbU9IL_wGleKetz8FdcveqHMBVz1bfKTTW80w,1753
|
219
|
-
langtrace_python_sdk/utils/llm.py,sha256=
|
219
|
+
langtrace_python_sdk/utils/llm.py,sha256=jFOypinssPg14KtiDUnut545DO_nqccOAPgeskFiJR4,14990
|
220
220
|
langtrace_python_sdk/utils/misc.py,sha256=LaQr5LOmZMiuwVdjYh7aIu6o2C_Xb1wgpQGNOVmRzfE,1918
|
221
221
|
langtrace_python_sdk/utils/prompt_registry.py,sha256=n5dQMVLBw8aJZY8Utvf67bncc25ELf6AH9BYw8_hSzo,2619
|
222
222
|
langtrace_python_sdk/utils/sdk_version_checker.py,sha256=F-VVVH7Fmhr5LcY0IIe-34zIi5RQcx26uuxFpPzZesM,1782
|
@@ -265,8 +265,8 @@ tests/pinecone/cassettes/test_query.yaml,sha256=b5v9G3ssUy00oG63PlFUR3JErF2Js-5A
|
|
265
265
|
tests/pinecone/cassettes/test_upsert.yaml,sha256=neWmQ1v3d03V8WoLl8FoFeeCYImb8pxlJBWnFd_lITU,38607
|
266
266
|
tests/qdrant/conftest.py,sha256=9n0uHxxIjWk9fbYc4bx-uP8lSAgLBVx-cV9UjnsyCHM,381
|
267
267
|
tests/qdrant/test_qdrant.py,sha256=pzjAjVY2kmsmGfrI2Gs2xrolfuaNHz7l1fqGQCjp5_o,3353
|
268
|
-
langtrace_python_sdk-3.3.
|
269
|
-
langtrace_python_sdk-3.3.
|
270
|
-
langtrace_python_sdk-3.3.
|
271
|
-
langtrace_python_sdk-3.3.
|
272
|
-
langtrace_python_sdk-3.3.
|
268
|
+
langtrace_python_sdk-3.3.14.dist-info/METADATA,sha256=keb-ijUSoM7Pcas5rJH4UMhaw4pwWTP8dW3ujw6G8GE,15643
|
269
|
+
langtrace_python_sdk-3.3.14.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
270
|
+
langtrace_python_sdk-3.3.14.dist-info/entry_points.txt,sha256=1_b9-qvf2fE7uQNZcbUei9vLpFZBbbh9LrtGw95ssAo,70
|
271
|
+
langtrace_python_sdk-3.3.14.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
272
|
+
langtrace_python_sdk-3.3.14.dist-info/RECORD,,
|
File without changes
|
{langtrace_python_sdk-3.3.12.dist-info → langtrace_python_sdk-3.3.14.dist-info}/entry_points.txt
RENAMED
File without changes
|
{langtrace_python_sdk-3.3.12.dist-info → langtrace_python_sdk-3.3.14.dist-info}/licenses/LICENSE
RENAMED
File without changes
|