opentelemetry-instrumentation-openai 0.21.4__tar.gz → 0.21.5__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.21.4 → opentelemetry_instrumentation_openai-0.21.5}/PKG-INFO +1 -1
  2. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/shared/chat_wrappers.py +6 -6
  3. opentelemetry_instrumentation_openai-0.21.5/opentelemetry/instrumentation/openai/version.py +1 -0
  4. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/pyproject.toml +1 -1
  5. opentelemetry_instrumentation_openai-0.21.4/opentelemetry/instrumentation/openai/version.py +0 -1
  6. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/README.md +0 -0
  7. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/__init__.py +0 -0
  8. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/shared/__init__.py +0 -0
  9. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -0
  10. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/shared/config.py +0 -0
  11. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +0 -0
  12. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -0
  13. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/utils.py +0 -0
  14. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/v0/__init__.py +0 -0
  15. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/v1/__init__.py +0 -0
  16. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -0
  17. {opentelemetry_instrumentation_openai-0.21.4 → opentelemetry_instrumentation_openai-0.21.5}/opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: opentelemetry-instrumentation-openai
3
- Version: 0.21.4
3
+ Version: 0.21.5
4
4
  Summary: OpenTelemetry OpenAI instrumentation
5
5
  Home-page: https://github.com/traceloop/openllmetry/tree/main/packages/opentelemetry-instrumentation-openai
6
6
  License: Apache-2.0
@@ -294,10 +294,11 @@ def _set_chat_metrics(
294
294
  def _set_choice_counter_metrics(choice_counter, choices, shared_attributes):
295
295
  choice_counter.add(len(choices), attributes=shared_attributes)
296
296
  for choice in choices:
297
- attributes_with_reason = {
298
- **shared_attributes,
299
- "llm.response.finish_reason": choice["finish_reason"],
300
- }
297
+ attributes_with_reason = {**shared_attributes}
298
+ if choice.get("finish_reason"):
299
+ attributes_with_reason["llm.response.finish_reason"] = choice.get(
300
+ "finish_reason"
301
+ )
301
302
  choice_counter.add(1, attributes=attributes_with_reason)
302
303
 
303
304
 
@@ -463,8 +464,6 @@ class ChatStream(ObjectProxy):
463
464
  ):
464
465
  super().__init__(response)
465
466
 
466
- print("HEYY", response.__class__.__name__)
467
-
468
467
  self._span = span
469
468
  self._instance = instance
470
469
  self._token_counter = token_counter
@@ -563,6 +562,7 @@ class ChatStream(ObjectProxy):
563
562
  is_streaming=True,
564
563
  )
565
564
 
565
+ @dont_throw
566
566
  def _close_span(self):
567
567
  if not is_azure_openai(self._instance):
568
568
  _set_streaming_token_metrics(
@@ -8,7 +8,7 @@ show_missing = true
8
8
 
9
9
  [tool.poetry]
10
10
  name = "opentelemetry-instrumentation-openai"
11
- version = "0.21.4"
11
+ version = "0.21.5"
12
12
  description = "OpenTelemetry OpenAI instrumentation"
13
13
  authors = [
14
14
  "Gal Kleinman <gal@traceloop.com>",