opentelemetry-instrumentation-openai 0.25.4__tar.gz → 0.25.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.25.4 → opentelemetry_instrumentation_openai-0.25.5}/PKG-INFO +1 -1
  2. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/shared/chat_wrappers.py +22 -6
  3. opentelemetry_instrumentation_openai-0.25.5/opentelemetry/instrumentation/openai/version.py +1 -0
  4. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/pyproject.toml +1 -1
  5. opentelemetry_instrumentation_openai-0.25.4/opentelemetry/instrumentation/openai/version.py +0 -1
  6. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/README.md +0 -0
  7. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/__init__.py +0 -0
  8. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/shared/__init__.py +0 -0
  9. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -0
  10. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/shared/config.py +0 -0
  11. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +0 -0
  12. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -0
  13. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/utils.py +0 -0
  14. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/v0/__init__.py +0 -0
  15. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/v1/__init__.py +0 -0
  16. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.5}/opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -0
  17. {opentelemetry_instrumentation_openai-0.25.4 → opentelemetry_instrumentation_openai-0.25.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.25.4
3
+ Version: 0.25.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
@@ -336,12 +336,28 @@ def _set_prompts(span, messages):
336
336
  if isinstance(content, list):
337
337
  content = json.dumps(content)
338
338
  _set_span_attribute(span, f"{prefix}.content", content)
339
- if msg.get("tool_calls"):
340
- _set_span_attribute(
341
- span, f"{prefix}.tool_calls", json.dumps(msg.get("tool_calls"))
342
- )
343
- if msg.get("tool_call_id"):
344
- _set_span_attribute(span, f"{prefix}.tool_call_id", msg.get("tool_call_id"))
339
+ tool_calls = msg.get("tool_calls")
340
+ if tool_calls:
341
+ for i, tool_call in enumerate(tool_calls):
342
+ if is_openai_v1():
343
+ tool_call = model_as_dict(tool_call)
344
+
345
+ function = tool_call.get("function")
346
+ _set_span_attribute(
347
+ span,
348
+ f"{prefix}.tool_calls.{i}.id",
349
+ tool_call.get("id"),
350
+ )
351
+ _set_span_attribute(
352
+ span,
353
+ f"{prefix}.tool_calls.{i}.name",
354
+ function.get("name"),
355
+ )
356
+ _set_span_attribute(
357
+ span,
358
+ f"{prefix}.tool_calls.{i}.arguments",
359
+ function.get("arguments"),
360
+ )
345
361
 
346
362
 
347
363
  def _set_completions(span, choices):
@@ -8,7 +8,7 @@ show_missing = true
8
8
 
9
9
  [tool.poetry]
10
10
  name = "opentelemetry-instrumentation-openai"
11
- version = "0.25.4"
11
+ version = "0.25.5"
12
12
  description = "OpenTelemetry OpenAI instrumentation"
13
13
  authors = [
14
14
  "Gal Kleinman <gal@traceloop.com>",