opentelemetry-instrumentation-openai 0.33.0__tar.gz → 0.33.1__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.
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/PKG-INFO +1 -1
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/shared/chat_wrappers.py +5 -1
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/v1/__init__.py +27 -1
- opentelemetry_instrumentation_openai-0.33.1/opentelemetry/instrumentation/openai/version.py +1 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/pyproject.toml +2 -2
- opentelemetry_instrumentation_openai-0.33.0/opentelemetry/instrumentation/openai/version.py +0 -1
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/README.md +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/__init__.py +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/shared/__init__.py +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/shared/completion_wrappers.py +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/shared/config.py +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/utils.py +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/v0/__init__.py +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +0 -0
- {opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +0 -0
{opentelemetry_instrumentation_openai-0.33.0 → opentelemetry_instrumentation_openai-0.33.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opentelemetry-instrumentation-openai
|
|
3
|
-
Version: 0.33.
|
|
3
|
+
Version: 0.33.1
|
|
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
|
|
@@ -432,7 +432,11 @@ def _set_completions(span, choices):
|
|
|
432
432
|
return
|
|
433
433
|
|
|
434
434
|
_set_span_attribute(span, f"{prefix}.role", message.get("role"))
|
|
435
|
-
|
|
435
|
+
|
|
436
|
+
if message.get("refusal"):
|
|
437
|
+
_set_span_attribute(span, f"{prefix}.refusal", message.get("refusal"))
|
|
438
|
+
else:
|
|
439
|
+
_set_span_attribute(span, f"{prefix}.content", message.get("content"))
|
|
436
440
|
|
|
437
441
|
function_call = message.get("function_call")
|
|
438
442
|
if function_call:
|
|
@@ -197,6 +197,32 @@ class OpenAIV1Instrumentor(BaseInstrumentor):
|
|
|
197
197
|
"Assistants.create",
|
|
198
198
|
assistants_create_wrapper(tracer),
|
|
199
199
|
)
|
|
200
|
+
wrap_function_wrapper(
|
|
201
|
+
"openai.resources.beta.chat.completions",
|
|
202
|
+
"Completions.parse",
|
|
203
|
+
chat_wrapper(
|
|
204
|
+
tracer,
|
|
205
|
+
tokens_histogram,
|
|
206
|
+
chat_choice_counter,
|
|
207
|
+
duration_histogram,
|
|
208
|
+
chat_exception_counter,
|
|
209
|
+
streaming_time_to_first_token,
|
|
210
|
+
streaming_time_to_generate,
|
|
211
|
+
),
|
|
212
|
+
)
|
|
213
|
+
wrap_function_wrapper(
|
|
214
|
+
"openai.resources.beta.chat.completions",
|
|
215
|
+
"AsyncCompletions.parse",
|
|
216
|
+
achat_wrapper(
|
|
217
|
+
tracer,
|
|
218
|
+
tokens_histogram,
|
|
219
|
+
chat_choice_counter,
|
|
220
|
+
duration_histogram,
|
|
221
|
+
chat_exception_counter,
|
|
222
|
+
streaming_time_to_first_token,
|
|
223
|
+
streaming_time_to_generate,
|
|
224
|
+
),
|
|
225
|
+
)
|
|
200
226
|
wrap_function_wrapper(
|
|
201
227
|
"openai.resources.beta.threads.runs",
|
|
202
228
|
"Runs.create",
|
|
@@ -217,7 +243,7 @@ class OpenAIV1Instrumentor(BaseInstrumentor):
|
|
|
217
243
|
"Messages.list",
|
|
218
244
|
messages_list_wrapper(tracer),
|
|
219
245
|
)
|
|
220
|
-
except AttributeError:
|
|
246
|
+
except (AttributeError, ModuleNotFoundError):
|
|
221
247
|
pass
|
|
222
248
|
|
|
223
249
|
def _uninstrument(self, **kwargs):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.33.1"
|
|
@@ -8,7 +8,7 @@ show_missing = true
|
|
|
8
8
|
|
|
9
9
|
[tool.poetry]
|
|
10
10
|
name = "opentelemetry-instrumentation-openai"
|
|
11
|
-
version = "0.33.
|
|
11
|
+
version = "0.33.1"
|
|
12
12
|
description = "OpenTelemetry OpenAI instrumentation"
|
|
13
13
|
authors = [
|
|
14
14
|
"Gal Kleinman <gal@traceloop.com>",
|
|
@@ -39,7 +39,7 @@ pytest = "^8.2.2"
|
|
|
39
39
|
pytest-sugar = "1.0.0"
|
|
40
40
|
vcrpy = "^6.0.1"
|
|
41
41
|
pytest-recording = "^0.13.1"
|
|
42
|
-
openai = {extras = ["datalib"], version = "
|
|
42
|
+
openai = {extras = ["datalib"], version = ">=1.50.0"}
|
|
43
43
|
opentelemetry-sdk = "^1.27.0"
|
|
44
44
|
pytest-asyncio = "^0.23.7"
|
|
45
45
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.33.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|