opentelemetry-instrumentation-groq 0.38.12__py3-none-any.whl → 0.39.0__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.

Potentially problematic release.


This version of opentelemetry-instrumentation-groq might be problematic. Click here for more details.

@@ -196,24 +196,35 @@ def _set_response_attributes(span, response, token_histogram):
196
196
  span, SpanAttributes.LLM_USAGE_TOTAL_TOKENS, usage.get("total_tokens")
197
197
  )
198
198
  set_span_attribute(
199
- span,
200
- SpanAttributes.LLM_USAGE_COMPLETION_TOKENS, completion_tokens
201
- )
202
- set_span_attribute(
203
- span, SpanAttributes.LLM_USAGE_PROMPT_TOKENS, prompt_tokens
199
+ span, SpanAttributes.LLM_USAGE_COMPLETION_TOKENS, completion_tokens
204
200
  )
201
+ set_span_attribute(span, SpanAttributes.LLM_USAGE_PROMPT_TOKENS, prompt_tokens)
205
202
 
206
- if isinstance(prompt_tokens, int) and prompt_tokens >= 0 and token_histogram is not None:
207
- token_histogram.record(prompt_tokens, attributes={
208
- SpanAttributes.LLM_TOKEN_TYPE: "input",
209
- SpanAttributes.LLM_RESPONSE_MODEL: response.get("model")
210
- })
203
+ if (
204
+ isinstance(prompt_tokens, int)
205
+ and prompt_tokens >= 0
206
+ and token_histogram is not None
207
+ ):
208
+ token_histogram.record(
209
+ prompt_tokens,
210
+ attributes={
211
+ SpanAttributes.LLM_TOKEN_TYPE: "input",
212
+ SpanAttributes.LLM_RESPONSE_MODEL: response.get("model"),
213
+ },
214
+ )
211
215
 
212
- if isinstance(completion_tokens, int) and completion_tokens >= 0 and token_histogram is not None:
213
- token_histogram.record(completion_tokens, attributes={
214
- SpanAttributes.LLM_TOKEN_TYPE: "output",
215
- SpanAttributes.LLM_RESPONSE_MODEL: response.get("model")
216
- })
216
+ if (
217
+ isinstance(completion_tokens, int)
218
+ and completion_tokens >= 0
219
+ and token_histogram is not None
220
+ ):
221
+ token_histogram.record(
222
+ completion_tokens,
223
+ attributes={
224
+ SpanAttributes.LLM_TOKEN_TYPE: "output",
225
+ SpanAttributes.LLM_RESPONSE_MODEL: response.get("model"),
226
+ },
227
+ )
217
228
 
218
229
  choices = response.get("choices")
219
230
  if should_send_prompts() and choices:
@@ -575,7 +586,7 @@ class GroqInstrumentor(BaseInstrumentor):
575
586
  token_histogram,
576
587
  choice_counter,
577
588
  duration_histogram,
578
- ) = (None, None, None, None)
589
+ ) = (None, None, None)
579
590
 
580
591
  for wrapped_method in WRAPPED_METHODS:
581
592
  wrap_package = wrapped_method.get("package")
@@ -1 +1 @@
1
- __version__ = "0.38.12"
1
+ __version__ = "0.39.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: opentelemetry-instrumentation-groq
3
- Version: 0.38.12
3
+ Version: 0.39.0
4
4
  Summary: OpenTelemetry Groq instrumentation
5
5
  License: Apache-2.0
6
6
  Author: Gal Kleinman
@@ -0,0 +1,8 @@
1
+ opentelemetry/instrumentation/groq/__init__.py,sha256=E1blGTym8YomMT-bsUCrVSneSy-CZmHdtCWup19OpFw,20433
2
+ opentelemetry/instrumentation/groq/config.py,sha256=eN2YxQdWlAF-qWPwZZr0xFM-8tx9zUjmiparuB64jcU,170
3
+ opentelemetry/instrumentation/groq/utils.py,sha256=1ESL4NCp8Mjww8cGEzQO_AEqGiSK4JSiMFYUhwBnuao,2151
4
+ opentelemetry/instrumentation/groq/version.py,sha256=U2L37sYJw_uQwWPXBYX6WnIpKCp_QIueKc2oqgdescE,23
5
+ opentelemetry_instrumentation_groq-0.39.0.dist-info/METADATA,sha256=dIXlqnosXTxWZwa9emuxyULBkFOXxeMJXdNxcehNds4,2117
6
+ opentelemetry_instrumentation_groq-0.39.0.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
7
+ opentelemetry_instrumentation_groq-0.39.0.dist-info/entry_points.txt,sha256=uezQe06CpIK8xTZZSK0lF29nOKkz_w6VR4sQnb4IAFQ,87
8
+ opentelemetry_instrumentation_groq-0.39.0.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- opentelemetry/instrumentation/groq/__init__.py,sha256=zRi0qEDmT-iBS2zGKUecx53flOP4criJWS9mtBsEYRc,20313
2
- opentelemetry/instrumentation/groq/config.py,sha256=eN2YxQdWlAF-qWPwZZr0xFM-8tx9zUjmiparuB64jcU,170
3
- opentelemetry/instrumentation/groq/utils.py,sha256=1ESL4NCp8Mjww8cGEzQO_AEqGiSK4JSiMFYUhwBnuao,2151
4
- opentelemetry/instrumentation/groq/version.py,sha256=gpkGdnTLaPDm4EDchNcqGB_vMNU9fOQmJQEoxhopIa0,24
5
- opentelemetry_instrumentation_groq-0.38.12.dist-info/METADATA,sha256=m4CV2lRX477Ro4rrrMkEWGXhscntjFjRAwDUjumPMnc,2118
6
- opentelemetry_instrumentation_groq-0.38.12.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
7
- opentelemetry_instrumentation_groq-0.38.12.dist-info/entry_points.txt,sha256=uezQe06CpIK8xTZZSK0lF29nOKkz_w6VR4sQnb4IAFQ,87
8
- opentelemetry_instrumentation_groq-0.38.12.dist-info/RECORD,,