opentelemetry-instrumentation-openai 0.3.5__py3-none-any.whl → 0.4.0__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.
- opentelemetry/instrumentation/openai/__init__.py +13 -0
- opentelemetry/instrumentation/openai/version.py +1 -1
- {opentelemetry_instrumentation_openai-0.3.5.dist-info → opentelemetry_instrumentation_openai-0.4.0.dist-info}/METADATA +2 -2
- opentelemetry_instrumentation_openai-0.4.0.dist-info/RECORD +5 -0
- opentelemetry_instrumentation_openai-0.3.5.dist-info/RECORD +0 -5
- {opentelemetry_instrumentation_openai-0.3.5.dist-info → opentelemetry_instrumentation_openai-0.4.0.dist-info}/WHEEL +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
|
+
import json
|
|
3
4
|
import types
|
|
4
5
|
import pkg_resources
|
|
5
6
|
from typing import Collection
|
|
@@ -122,6 +123,18 @@ def _set_input_attributes(span, llm_request_type, kwargs):
|
|
|
122
123
|
prompt[0] if isinstance(prompt, list) else prompt,
|
|
123
124
|
)
|
|
124
125
|
|
|
126
|
+
functions = kwargs.get("functions")
|
|
127
|
+
if functions:
|
|
128
|
+
for i, function in enumerate(functions):
|
|
129
|
+
prefix = f"{SpanAttributes.LLM_REQUEST_FUNCTIONS}.{i}"
|
|
130
|
+
_set_span_attribute(span, f"{prefix}.name", function.get("name"))
|
|
131
|
+
_set_span_attribute(
|
|
132
|
+
span, f"{prefix}.description", function.get("description")
|
|
133
|
+
)
|
|
134
|
+
_set_span_attribute(
|
|
135
|
+
span, f"{prefix}.parameters", json.dumps(function.get("parameters"))
|
|
136
|
+
)
|
|
137
|
+
|
|
125
138
|
return
|
|
126
139
|
|
|
127
140
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.
|
|
1
|
+
__version__ = "0.4.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opentelemetry-instrumentation-openai
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: OpenTelemetry OpenAI instrumentation
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: Gal Kleinman
|
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
15
|
Requires-Dist: opentelemetry-api (>=1.21.0,<2.0.0)
|
|
16
16
|
Requires-Dist: opentelemetry-instrumentation (>=0.42b0,<0.43)
|
|
17
|
-
Requires-Dist: opentelemetry-semantic-conventions-ai (>=0.0.
|
|
17
|
+
Requires-Dist: opentelemetry-semantic-conventions-ai (>=0.0.12,<0.0.13)
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
|
|
20
20
|
# opentelemetry-instrumentation-openai
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
opentelemetry/instrumentation/openai/__init__.py,sha256=wnKPqZQpo3C3gg8aQcgZF4H-nIxvmkIpQ8Qv94cUxGE,12691
|
|
2
|
+
opentelemetry/instrumentation/openai/version.py,sha256=42STGor_9nKYXumfeV5tiyD_M8VdcddX7CEexmibPBk,22
|
|
3
|
+
opentelemetry_instrumentation_openai-0.4.0.dist-info/METADATA,sha256=NIxcUDgC3YWFVvY0fW6IqsD6oUxCY3M8dDiQWo3-n7I,834
|
|
4
|
+
opentelemetry_instrumentation_openai-0.4.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
5
|
+
opentelemetry_instrumentation_openai-0.4.0.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
opentelemetry/instrumentation/openai/__init__.py,sha256=pza3S9cxuNI7vXoagHcbN3LySbv4nqV3RhYjdpiZLEY,12128
|
|
2
|
-
opentelemetry/instrumentation/openai/version.py,sha256=ThnCuF3X7rsQSd5PAea_jfYA70ZmhLvkFcLBxBPwZnY,22
|
|
3
|
-
opentelemetry_instrumentation_openai-0.3.5.dist-info/METADATA,sha256=aWjjEYV8ulJZw0SnbM96jvYSqH9ufmqVqDelGbf8GSI,832
|
|
4
|
-
opentelemetry_instrumentation_openai-0.3.5.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
5
|
-
opentelemetry_instrumentation_openai-0.3.5.dist-info/RECORD,,
|
|
File without changes
|