opentelemetry-instrumentation-openai 0.28.1__py3-none-any.whl → 0.28.2__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-openai might be problematic. Click here for more details.

@@ -446,7 +446,7 @@ def _set_streaming_token_metrics(
446
446
  # setting the default model_name as gpt-4. As this uses the embedding "cl100k_base" that
447
447
  # is used by most of the other model.
448
448
  model_name = (
449
- request_kwargs.get("model") or complete_response.get("model") or "gpt-4"
449
+ complete_response.get("model") or request_kwargs.get("model") or "gpt-4"
450
450
  )
451
451
  for msg in request_kwargs.get("messages"):
452
452
  if msg.get("content"):
@@ -181,7 +181,7 @@ def _set_token_usage(span, request_kwargs, complete_response):
181
181
  # prompt_usage
182
182
  if request_kwargs and request_kwargs.get("prompt"):
183
183
  prompt_content = request_kwargs.get("prompt")
184
- model_name = request_kwargs.get("model") or None
184
+ model_name = complete_response.get("model") or None
185
185
 
186
186
  if model_name:
187
187
  prompt_usage = get_token_count_from_string(prompt_content, model_name)
@@ -1 +1 @@
1
- __version__ = "0.28.1"
1
+ __version__ = "0.28.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: opentelemetry-instrumentation-openai
3
- Version: 0.28.1
3
+ Version: 0.28.2
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
@@ -1,7 +1,7 @@
1
1
  opentelemetry/instrumentation/openai/__init__.py,sha256=w0gjgORccQ3EsMiK2dzZg6V7J3pa6PcAuDvy1oofQ5A,1503
2
2
  opentelemetry/instrumentation/openai/shared/__init__.py,sha256=HcS1Ar6WX9DPtlJuiPji3u7XV_SwYerTf5O32Kfe1FQ,8839
3
- opentelemetry/instrumentation/openai/shared/chat_wrappers.py,sha256=J1s8DqJoSPpOZE__21Iq0QrhFPf3WhIeDqcoIaUPtPU,26721
4
- opentelemetry/instrumentation/openai/shared/completion_wrappers.py,sha256=DO4K0DU3xvCAmBMcp3pS3iDTKHLY6Pc_4Y7GnlnRo0g,6840
3
+ opentelemetry/instrumentation/openai/shared/chat_wrappers.py,sha256=9Db3PzB9ZsxqrcalLnGNtgd1GBxYMwWvIZmjixjGGmY,26721
4
+ opentelemetry/instrumentation/openai/shared/completion_wrappers.py,sha256=CZngvHkGtLUh-Ne4uzM6VH8LiajZsKVOV1glhmSwij0,6843
5
5
  opentelemetry/instrumentation/openai/shared/config.py,sha256=_4AkHau8C44uBc6-fNBl9EzCGPBuj9yDIngTuwSW6ZE,199
6
6
  opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py,sha256=YI0lFGulaE8N2F1hdTGHj52kHwUy6KQPIt7Lw9AWJHc,7069
7
7
  opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py,sha256=A4qdJIeJdA45SfiLaFj3Vo0Ndcqqfuew1BDsGdnJU3E,2122
@@ -10,8 +10,8 @@ opentelemetry/instrumentation/openai/v0/__init__.py,sha256=02-bXv0aZbscMYO2W3jsH
10
10
  opentelemetry/instrumentation/openai/v1/__init__.py,sha256=kqGsXkjyjIDNRfTSzJKjLdvvGUOViW2shZ73cM4PfS0,7693
11
11
  opentelemetry/instrumentation/openai/v1/assistant_wrappers.py,sha256=BMiZykQ3u2xrWpo2g3qZOxTJqy317JXRGO4zCVu4bZ8,6277
12
12
  opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py,sha256=kXOuDAt7If23EhWpH2r6L0eUVFvVWQBYrWGu3qJNKR0,2779
13
- opentelemetry/instrumentation/openai/version.py,sha256=ZRQKbgDaGz_yuLk-cUKuk6ZBKCSRKZC8nQd041NRNXk,23
14
- opentelemetry_instrumentation_openai-0.28.1.dist-info/METADATA,sha256=nKQ_8jFI8hlWFSVHxYwUE_3XVrjJNFS8ISQkk4--r8Y,2255
15
- opentelemetry_instrumentation_openai-0.28.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
16
- opentelemetry_instrumentation_openai-0.28.1.dist-info/entry_points.txt,sha256=vTBfiX5yXji5YHikuJHEOoBZ1TFdPQ1EI4ctd2pZSeE,93
17
- opentelemetry_instrumentation_openai-0.28.1.dist-info/RECORD,,
13
+ opentelemetry/instrumentation/openai/version.py,sha256=K-TM2fq9AmH_Dk8Cadam72wILDZ_6qftLHvY9P1Fc3I,23
14
+ opentelemetry_instrumentation_openai-0.28.2.dist-info/METADATA,sha256=TGrtjnQKNLinLjtIVI4YSVDWdTa2ZT56-iWvmNM_6rc,2255
15
+ opentelemetry_instrumentation_openai-0.28.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
16
+ opentelemetry_instrumentation_openai-0.28.2.dist-info/entry_points.txt,sha256=vTBfiX5yXji5YHikuJHEOoBZ1TFdPQ1EI4ctd2pZSeE,93
17
+ opentelemetry_instrumentation_openai-0.28.2.dist-info/RECORD,,