opentelemetry-instrumentation-groq 0.36.1__tar.gz → 0.38.0__tar.gz

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: opentelemetry-instrumentation-groq
3
- Version: 0.36.1
3
+ Version: 0.38.0
4
4
  Summary: OpenTelemetry Groq instrumentation
5
5
  License: Apache-2.0
6
6
  Author: Gal Kleinman
@@ -21,6 +21,7 @@ from opentelemetry.instrumentation.groq.version import __version__
21
21
  from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
22
22
  from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY, unwrap
23
23
  from opentelemetry.metrics import Counter, Histogram, Meter, get_meter
24
+ from opentelemetry.semconv._incubating.attributes.gen_ai_attributes import GEN_AI_RESPONSE_ID
24
25
  from opentelemetry.semconv_ai import (
25
26
  SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY,
26
27
  LLMRequestTypeValues,
@@ -184,6 +185,7 @@ def _set_response_attributes(span, response):
184
185
  response = model_as_dict(response)
185
186
 
186
187
  set_span_attribute(span, SpanAttributes.LLM_RESPONSE_MODEL, response.get("model"))
188
+ set_span_attribute(span, GEN_AI_RESPONSE_ID, response.get("id"))
187
189
 
188
190
  usage = response.get("usage")
189
191
  if usage:
@@ -9,6 +9,8 @@ from opentelemetry.semconv_ai import SpanAttributes
9
9
  GEN_AI_SYSTEM = "gen_ai.system"
10
10
  GEN_AI_SYSTEM_GROQ = "groq"
11
11
 
12
+ _PYDANTIC_VERSION = version("pydantic")
13
+
12
14
 
13
15
  def set_span_attribute(span, name, value):
14
16
  if value is not None and value != "":
@@ -68,7 +70,7 @@ def error_metrics_attributes(exception):
68
70
 
69
71
 
70
72
  def model_as_dict(model):
71
- if version("pydantic") < "2.0.0":
73
+ if _PYDANTIC_VERSION < "2.0.0":
72
74
  return model.dict()
73
75
  if hasattr(model, "model_dump"):
74
76
  return model.model_dump()
@@ -8,7 +8,7 @@ show_missing = true
8
8
 
9
9
  [tool.poetry]
10
10
  name = "opentelemetry-instrumentation-groq"
11
- version = "0.36.1"
11
+ version = "0.38.0"
12
12
  description = "OpenTelemetry Groq instrumentation"
13
13
  authors = ["Gal Kleinman <gal@traceloop.com>", "Nir Gazit <nir@traceloop.com>"]
14
14
  repository = "https://github.com/traceloop/openllmetry/tree/main/packages/opentelemetry-instrumentation-groq"