opentelemetry-instrumentation-openai 0.38.1__tar.gz → 0.38.2__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-openai might be problematic. Click here for more details.

Files changed (17) hide show
  1. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/PKG-INFO +1 -1
  2. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/shared/__init__.py +10 -3
  3. opentelemetry_instrumentation_openai-0.38.2/opentelemetry/instrumentation/openai/version.py +1 -0
  4. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/pyproject.toml +1 -1
  5. opentelemetry_instrumentation_openai-0.38.1/opentelemetry/instrumentation/openai/version.py +0 -1
  6. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/README.md +0 -0
  7. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/__init__.py +0 -0
  8. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/shared/chat_wrappers.py +0 -0
  9. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -0
  10. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/shared/config.py +0 -0
  11. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +0 -0
  12. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -0
  13. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/utils.py +0 -0
  14. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/v0/__init__.py +0 -0
  15. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/v1/__init__.py +0 -0
  16. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -0
  17. {opentelemetry_instrumentation_openai-0.38.1 → opentelemetry_instrumentation_openai-0.38.2}/opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: opentelemetry-instrumentation-openai
3
- Version: 0.38.1
3
+ Version: 0.38.2
4
4
  Summary: OpenTelemetry OpenAI instrumentation
5
5
  License: Apache-2.0
6
6
  Author: Gal Kleinman
@@ -11,7 +11,9 @@ from opentelemetry.trace.propagation import set_span_in_context
11
11
  from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
12
12
 
13
13
  from opentelemetry.instrumentation.openai.shared.config import Config
14
- from opentelemetry.semconv._incubating.attributes.gen_ai_attributes import GEN_AI_RESPONSE_ID
14
+ from opentelemetry.semconv._incubating.attributes.gen_ai_attributes import (
15
+ GEN_AI_RESPONSE_ID,
16
+ )
15
17
  from opentelemetry.semconv_ai import SpanAttributes
16
18
  from opentelemetry.instrumentation.openai.utils import (
17
19
  dont_throw,
@@ -38,8 +40,13 @@ def should_send_prompts():
38
40
 
39
41
 
40
42
  def _set_span_attribute(span, name, value):
41
- if value is not None and value != "" and value != openai.NOT_GIVEN:
42
- span.set_attribute(name, value)
43
+ if value is None or value == "":
44
+ return
45
+
46
+ if hasattr(openai, "NOT_GIVEN") and value == openai.NOT_GIVEN:
47
+ return
48
+
49
+ span.set_attribute(name, value)
43
50
 
44
51
 
45
52
  def _set_client_attributes(span, instance):
@@ -8,7 +8,7 @@ show_missing = true
8
8
 
9
9
  [tool.poetry]
10
10
  name = "opentelemetry-instrumentation-openai"
11
- version = "0.38.1"
11
+ version = "0.38.2"
12
12
  description = "OpenTelemetry OpenAI instrumentation"
13
13
  authors = [
14
14
  "Gal Kleinman <gal@traceloop.com>",