opentelemetry-instrumentation-openai 0.40.6__py3-none-any.whl → 0.40.8__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/shared/chat_wrappers.py +1 -0
- opentelemetry/instrumentation/openai/v0/__init__.py +2 -1
- opentelemetry/instrumentation/openai/v1/__init__.py +2 -1
- opentelemetry/instrumentation/openai/version.py +1 -1
- {opentelemetry_instrumentation_openai-0.40.6.dist-info → opentelemetry_instrumentation_openai-0.40.8.dist-info}/METADATA +1 -1
- {opentelemetry_instrumentation_openai-0.40.6.dist-info → opentelemetry_instrumentation_openai-0.40.8.dist-info}/RECORD +8 -8
- {opentelemetry_instrumentation_openai-0.40.6.dist-info → opentelemetry_instrumentation_openai-0.40.8.dist-info}/WHEEL +0 -0
- {opentelemetry_instrumentation_openai-0.40.6.dist-info → opentelemetry_instrumentation_openai-0.40.8.dist-info}/entry_points.txt +0 -0
|
@@ -369,6 +369,7 @@ async def _set_prompts(span, messages):
|
|
|
369
369
|
|
|
370
370
|
for i, msg in enumerate(messages):
|
|
371
371
|
prefix = f"{SpanAttributes.LLM_PROMPTS}.{i}"
|
|
372
|
+
msg = msg if isinstance(msg, dict) else model_as_dict(msg)
|
|
372
373
|
|
|
373
374
|
_set_span_attribute(span, f"{prefix}.role", msg.get("role"))
|
|
374
375
|
if msg.get("content"):
|
|
@@ -4,6 +4,7 @@ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
|
|
4
4
|
from opentelemetry.trace import get_tracer
|
|
5
5
|
from opentelemetry.metrics import get_meter
|
|
6
6
|
from wrapt import wrap_function_wrapper
|
|
7
|
+
from opentelemetry.semconv._incubating.metrics import gen_ai_metrics as GenAIMetrics
|
|
7
8
|
|
|
8
9
|
from opentelemetry.instrumentation.openai.shared.chat_wrappers import (
|
|
9
10
|
chat_wrapper,
|
|
@@ -61,7 +62,7 @@ class OpenAIV0Instrumentor(BaseInstrumentor):
|
|
|
61
62
|
)
|
|
62
63
|
|
|
63
64
|
streaming_time_to_first_token = meter.create_histogram(
|
|
64
|
-
name=
|
|
65
|
+
name=GenAIMetrics.GEN_AI_SERVER_TIME_TO_FIRST_TOKEN,
|
|
65
66
|
unit="s",
|
|
66
67
|
description="Time to first token in streaming chat completions",
|
|
67
68
|
)
|
|
@@ -4,6 +4,7 @@ from opentelemetry.instrumentation.instrumentor import BaseInstrumentor
|
|
|
4
4
|
from opentelemetry.trace import get_tracer
|
|
5
5
|
|
|
6
6
|
from opentelemetry.metrics import get_meter
|
|
7
|
+
from opentelemetry.semconv._incubating.metrics import gen_ai_metrics as GenAIMetrics
|
|
7
8
|
|
|
8
9
|
from wrapt import wrap_function_wrapper
|
|
9
10
|
|
|
@@ -76,7 +77,7 @@ class OpenAIV1Instrumentor(BaseInstrumentor):
|
|
|
76
77
|
)
|
|
77
78
|
|
|
78
79
|
streaming_time_to_first_token = meter.create_histogram(
|
|
79
|
-
name=
|
|
80
|
+
name=GenAIMetrics.GEN_AI_SERVER_TIME_TO_FIRST_TOKEN,
|
|
80
81
|
unit="s",
|
|
81
82
|
description="Time to first token in streaming chat completions",
|
|
82
83
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.40.
|
|
1
|
+
__version__ = "0.40.8"
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
opentelemetry/instrumentation/openai/__init__.py,sha256=g_RyqxN0DEaPegyaFfoZVskxnaPMGx6Yrc9wZvkx7r8,2086
|
|
2
2
|
opentelemetry/instrumentation/openai/shared/__init__.py,sha256=X10dKV5-rs7GgxrcYtmEpoehCJEgUnHvWH6DV8MbzC0,10014
|
|
3
|
-
opentelemetry/instrumentation/openai/shared/chat_wrappers.py,sha256=
|
|
3
|
+
opentelemetry/instrumentation/openai/shared/chat_wrappers.py,sha256=9UQj5jAkxtxKH1s_7ldcSvfqnYZuuMRxwx4SBGS4lp8,28529
|
|
4
4
|
opentelemetry/instrumentation/openai/shared/completion_wrappers.py,sha256=PYQNUaW37pPunsBE8Fj-nbSlwSJ54RN80muf3hjoMTU,7367
|
|
5
5
|
opentelemetry/instrumentation/openai/shared/config.py,sha256=dCQviJ1a5cpFlrP0HcKgE7lpiXB98ssnumLy_CIMibQ,355
|
|
6
6
|
opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py,sha256=8l_TA_ncJWJr7Pr-1TcQV9eKNfJgdmi-9kOd8eOIwZI,7486
|
|
7
7
|
opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py,sha256=A4qdJIeJdA45SfiLaFj3Vo0Ndcqqfuew1BDsGdnJU3E,2122
|
|
8
8
|
opentelemetry/instrumentation/openai/utils.py,sha256=B085XRVvCjigZlRewFRwEFTG2hdx5gv5qVakVxgYaVo,4086
|
|
9
|
-
opentelemetry/instrumentation/openai/v0/__init__.py,sha256=
|
|
10
|
-
opentelemetry/instrumentation/openai/v1/__init__.py,sha256=
|
|
9
|
+
opentelemetry/instrumentation/openai/v0/__init__.py,sha256=d_08exBxvYLKy_lToq6UztpLwdBkrKijkSjdGh31xXM,5566
|
|
10
|
+
opentelemetry/instrumentation/openai/v1/__init__.py,sha256=1R7YJ9iFYU2UAwxkZMz1I32buXr6lIdIc09ezamfVOs,8779
|
|
11
11
|
opentelemetry/instrumentation/openai/v1/assistant_wrappers.py,sha256=WRpOuUc5Wi7KFMt8gPMy0b0l7N4EGQIeYAkOxPPZgWI,7733
|
|
12
12
|
opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py,sha256=4HsnPwR450NA5w-KDgMfQjK8U4do_M-sMMPU4LjXyiQ,3444
|
|
13
|
-
opentelemetry/instrumentation/openai/version.py,sha256=
|
|
14
|
-
opentelemetry_instrumentation_openai-0.40.
|
|
15
|
-
opentelemetry_instrumentation_openai-0.40.
|
|
16
|
-
opentelemetry_instrumentation_openai-0.40.
|
|
17
|
-
opentelemetry_instrumentation_openai-0.40.
|
|
13
|
+
opentelemetry/instrumentation/openai/version.py,sha256=YCOaBVvXJhedTftAK1X-FK52MRECqggzUNpA7OlefWc,23
|
|
14
|
+
opentelemetry_instrumentation_openai-0.40.8.dist-info/METADATA,sha256=gutDyh1zdME8gcu2LzQsCx7vYu8RoP_qhwocLH-TUzo,2186
|
|
15
|
+
opentelemetry_instrumentation_openai-0.40.8.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
16
|
+
opentelemetry_instrumentation_openai-0.40.8.dist-info/entry_points.txt,sha256=vTBfiX5yXji5YHikuJHEOoBZ1TFdPQ1EI4ctd2pZSeE,93
|
|
17
|
+
opentelemetry_instrumentation_openai-0.40.8.dist-info/RECORD,,
|
|
File without changes
|