opentelemetry-instrumentation-openai 0.26.1__py3-none-any.whl → 0.26.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.
- opentelemetry/instrumentation/openai/shared/__init__.py +3 -3
- opentelemetry/instrumentation/openai/shared/chat_wrappers.py +7 -4
- opentelemetry/instrumentation/openai/shared/completion_wrappers.py +1 -1
- opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py +1 -1
- opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py +1 -1
- opentelemetry/instrumentation/openai/v0/__init__.py +1 -1
- opentelemetry/instrumentation/openai/v1/__init__.py +1 -1
- opentelemetry/instrumentation/openai/v1/assistant_wrappers.py +1 -1
- opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py +1 -1
- opentelemetry/instrumentation/openai/version.py +1 -1
- {opentelemetry_instrumentation_openai-0.26.1.dist-info → opentelemetry_instrumentation_openai-0.26.2.dist-info}/METADATA +2 -2
- opentelemetry_instrumentation_openai-0.26.2.dist-info/RECORD +17 -0
- opentelemetry_instrumentation_openai-0.26.1.dist-info/RECORD +0 -17
- {opentelemetry_instrumentation_openai-0.26.1.dist-info → opentelemetry_instrumentation_openai-0.26.2.dist-info}/WHEEL +0 -0
- {opentelemetry_instrumentation_openai-0.26.1.dist-info → opentelemetry_instrumentation_openai-0.26.2.dist-info}/entry_points.txt +0 -0
|
@@ -9,7 +9,7 @@ from importlib.metadata import version
|
|
|
9
9
|
from opentelemetry import context as context_api
|
|
10
10
|
|
|
11
11
|
from opentelemetry.instrumentation.openai.shared.config import Config
|
|
12
|
-
from opentelemetry.
|
|
12
|
+
from opentelemetry.semconv_ai import SpanAttributes
|
|
13
13
|
from opentelemetry.instrumentation.openai.utils import (
|
|
14
14
|
dont_throw,
|
|
15
15
|
is_openai_v1,
|
|
@@ -144,7 +144,7 @@ def _set_response_attributes(span, response):
|
|
|
144
144
|
_set_span_attribute(
|
|
145
145
|
span,
|
|
146
146
|
f"{SpanAttributes.LLM_PROMPTS}.{PROMPT_ERROR}",
|
|
147
|
-
json.dumps(response.get("error"))
|
|
147
|
+
json.dumps(response.get("error")),
|
|
148
148
|
)
|
|
149
149
|
return
|
|
150
150
|
|
|
@@ -183,7 +183,7 @@ def _log_prompt_filter(span, response_dict):
|
|
|
183
183
|
_set_span_attribute(
|
|
184
184
|
span,
|
|
185
185
|
f"{SpanAttributes.LLM_PROMPTS}.{PROMPT_FILTER_KEY}",
|
|
186
|
-
json.dumps(response_dict.get("prompt_filter_results"))
|
|
186
|
+
json.dumps(response_dict.get("prompt_filter_results")),
|
|
187
187
|
)
|
|
188
188
|
|
|
189
189
|
|
|
@@ -7,7 +7,7 @@ from wrapt import ObjectProxy
|
|
|
7
7
|
|
|
8
8
|
from opentelemetry import context as context_api
|
|
9
9
|
from opentelemetry.metrics import Counter, Histogram
|
|
10
|
-
from opentelemetry.
|
|
10
|
+
from opentelemetry.semconv_ai import (
|
|
11
11
|
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY,
|
|
12
12
|
SpanAttributes,
|
|
13
13
|
LLMRequestTypeValues,
|
|
@@ -378,8 +378,9 @@ def _set_completions(span, choices):
|
|
|
378
378
|
|
|
379
379
|
if choice.get("content_filter_results"):
|
|
380
380
|
_set_span_attribute(
|
|
381
|
-
span,
|
|
382
|
-
|
|
381
|
+
span,
|
|
382
|
+
f"{prefix}.{CONTENT_FILTER_KEY}",
|
|
383
|
+
json.dumps(choice.get("content_filter_results")),
|
|
383
384
|
)
|
|
384
385
|
|
|
385
386
|
if choice.get("finish_reason") == "content_filter":
|
|
@@ -794,7 +795,9 @@ def _accumulate_stream_items(item, complete_response):
|
|
|
794
795
|
if choice.get("finish_reason"):
|
|
795
796
|
complete_choice["finish_reason"] = choice.get("finish_reason")
|
|
796
797
|
if choice.get("content_filter_results"):
|
|
797
|
-
complete_choice["content_filter_results"] = choice.get(
|
|
798
|
+
complete_choice["content_filter_results"] = choice.get(
|
|
799
|
+
"content_filter_results"
|
|
800
|
+
)
|
|
798
801
|
|
|
799
802
|
delta = choice.get("delta")
|
|
800
803
|
|
|
@@ -3,7 +3,7 @@ import time
|
|
|
3
3
|
|
|
4
4
|
from opentelemetry import context as context_api
|
|
5
5
|
from opentelemetry.metrics import Counter, Histogram
|
|
6
|
-
from opentelemetry.
|
|
6
|
+
from opentelemetry.semconv_ai import (
|
|
7
7
|
SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY,
|
|
8
8
|
SpanAttributes,
|
|
9
9
|
LLMRequestTypeValues,
|
|
@@ -12,7 +12,7 @@ from opentelemetry.instrumentation.openai.utils import (
|
|
|
12
12
|
)
|
|
13
13
|
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
|
|
14
14
|
from opentelemetry.metrics import Counter, Histogram
|
|
15
|
-
from opentelemetry.
|
|
15
|
+
from opentelemetry.semconv_ai import SUPPRESS_LANGUAGE_MODEL_INSTRUMENTATION_KEY
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
@_with_image_gen_metric_wrapper
|
|
@@ -19,7 +19,7 @@ from opentelemetry.instrumentation.openai.shared.embeddings_wrappers import (
|
|
|
19
19
|
)
|
|
20
20
|
from opentelemetry.instrumentation.openai.utils import is_metrics_enabled
|
|
21
21
|
from opentelemetry.instrumentation.openai.version import __version__
|
|
22
|
-
from opentelemetry.
|
|
22
|
+
from opentelemetry.semconv_ai import Meters
|
|
23
23
|
|
|
24
24
|
_instruments = ("openai >= 0.27.0", "openai < 1.0.0")
|
|
25
25
|
|
|
@@ -33,7 +33,7 @@ from opentelemetry.instrumentation.openai.v1.assistant_wrappers import (
|
|
|
33
33
|
from opentelemetry.instrumentation.openai.utils import is_metrics_enabled
|
|
34
34
|
from opentelemetry.instrumentation.openai.version import __version__
|
|
35
35
|
|
|
36
|
-
from opentelemetry.
|
|
36
|
+
from opentelemetry.semconv_ai import Meters
|
|
37
37
|
|
|
38
38
|
_instruments = ("openai >= 1.0.0",)
|
|
39
39
|
|
|
@@ -8,7 +8,7 @@ from opentelemetry.instrumentation.openai.shared import (
|
|
|
8
8
|
from opentelemetry.trace import SpanKind
|
|
9
9
|
from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY
|
|
10
10
|
|
|
11
|
-
from opentelemetry.
|
|
11
|
+
from opentelemetry.semconv_ai import SpanAttributes, LLMRequestTypeValues
|
|
12
12
|
|
|
13
13
|
from opentelemetry.instrumentation.openai.utils import _with_tracer_wrapper, dont_throw
|
|
14
14
|
from opentelemetry.instrumentation.openai.shared.config import Config
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from opentelemetry.instrumentation.openai.shared import (
|
|
2
2
|
_set_span_attribute,
|
|
3
3
|
)
|
|
4
|
-
from opentelemetry.
|
|
4
|
+
from opentelemetry.semconv_ai import SpanAttributes
|
|
5
5
|
from openai import AssistantEventHandler
|
|
6
6
|
from typing_extensions import override
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.26.
|
|
1
|
+
__version__ = "0.26.2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opentelemetry-instrumentation-openai
|
|
3
|
-
Version: 0.26.
|
|
3
|
+
Version: 0.26.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
|
|
@@ -17,7 +17,7 @@ Provides-Extra: instruments
|
|
|
17
17
|
Requires-Dist: opentelemetry-api (>=1.26.0,<2.0.0)
|
|
18
18
|
Requires-Dist: opentelemetry-instrumentation (>=0.47b0,<0.48)
|
|
19
19
|
Requires-Dist: opentelemetry-semantic-conventions (>=0.47b0,<0.48)
|
|
20
|
-
Requires-Dist: opentelemetry-semantic-conventions-ai (==0.
|
|
20
|
+
Requires-Dist: opentelemetry-semantic-conventions-ai (==0.4.0)
|
|
21
21
|
Requires-Dist: tiktoken (>=0.6.0,<1)
|
|
22
22
|
Project-URL: Repository, https://github.com/traceloop/openllmetry/tree/main/packages/opentelemetry-instrumentation-openai
|
|
23
23
|
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
opentelemetry/instrumentation/openai/__init__.py,sha256=w0gjgORccQ3EsMiK2dzZg6V7J3pa6PcAuDvy1oofQ5A,1503
|
|
2
|
+
opentelemetry/instrumentation/openai/shared/__init__.py,sha256=S6QoxypTSF1dMg4gfS3A3M0TzU2HVz9D6J6CleUXI54,8832
|
|
3
|
+
opentelemetry/instrumentation/openai/shared/chat_wrappers.py,sha256=HEe0-vsCS8mDI585b6-Vybzy2EOpQ-FDpAz7LvVMWmQ,26776
|
|
4
|
+
opentelemetry/instrumentation/openai/shared/completion_wrappers.py,sha256=DO4K0DU3xvCAmBMcp3pS3iDTKHLY6Pc_4Y7GnlnRo0g,6840
|
|
5
|
+
opentelemetry/instrumentation/openai/shared/config.py,sha256=_4AkHau8C44uBc6-fNBl9EzCGPBuj9yDIngTuwSW6ZE,199
|
|
6
|
+
opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py,sha256=REcu_K8ogVIf8RR935w_UqS-ajGI0CNun73_P476i2o,6930
|
|
7
|
+
opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py,sha256=A4qdJIeJdA45SfiLaFj3Vo0Ndcqqfuew1BDsGdnJU3E,2122
|
|
8
|
+
opentelemetry/instrumentation/openai/utils.py,sha256=3ONjsia3xG4rRMOwjU91liOVpZxoRE39CxJ-C5HxIgQ,3464
|
|
9
|
+
opentelemetry/instrumentation/openai/v0/__init__.py,sha256=02-bXv0aZbscMYO2W3jsHpjU521vkVK5RzdfSeGXBzg,5475
|
|
10
|
+
opentelemetry/instrumentation/openai/v1/__init__.py,sha256=kqGsXkjyjIDNRfTSzJKjLdvvGUOViW2shZ73cM4PfS0,7693
|
|
11
|
+
opentelemetry/instrumentation/openai/v1/assistant_wrappers.py,sha256=BMiZykQ3u2xrWpo2g3qZOxTJqy317JXRGO4zCVu4bZ8,6277
|
|
12
|
+
opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py,sha256=kXOuDAt7If23EhWpH2r6L0eUVFvVWQBYrWGu3qJNKR0,2779
|
|
13
|
+
opentelemetry/instrumentation/openai/version.py,sha256=Crq5hftgS1Lj7H-8uxyxs5fX6lta4LLNjycaIacOoKo,23
|
|
14
|
+
opentelemetry_instrumentation_openai-0.26.2.dist-info/METADATA,sha256=0nknBiw_cPwIOv8lMbCZl2Gbfh47SB5Birqh8Fo1-Go,2255
|
|
15
|
+
opentelemetry_instrumentation_openai-0.26.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
16
|
+
opentelemetry_instrumentation_openai-0.26.2.dist-info/entry_points.txt,sha256=vTBfiX5yXji5YHikuJHEOoBZ1TFdPQ1EI4ctd2pZSeE,93
|
|
17
|
+
opentelemetry_instrumentation_openai-0.26.2.dist-info/RECORD,,
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
opentelemetry/instrumentation/openai/__init__.py,sha256=w0gjgORccQ3EsMiK2dzZg6V7J3pa6PcAuDvy1oofQ5A,1503
|
|
2
|
-
opentelemetry/instrumentation/openai/shared/__init__.py,sha256=j2wf_XzqXqGVdLYfHvddftvK2uy8V7_monZaa2nQKug,8830
|
|
3
|
-
opentelemetry/instrumentation/openai/shared/chat_wrappers.py,sha256=Eh3l3Jmmav7MP3jeomoXTINRH9aco7upT4WEzGI12RM,26729
|
|
4
|
-
opentelemetry/instrumentation/openai/shared/completion_wrappers.py,sha256=OuwS5vZwe_jTcWU7xnx8nVtqWCrGS1hcGbyKhQbf11g,6840
|
|
5
|
-
opentelemetry/instrumentation/openai/shared/config.py,sha256=_4AkHau8C44uBc6-fNBl9EzCGPBuj9yDIngTuwSW6ZE,199
|
|
6
|
-
opentelemetry/instrumentation/openai/shared/embeddings_wrappers.py,sha256=EUtQEl9MP56YVe5tPY1QXNR0yNXw1MvfCwrIzmGXTAg,6930
|
|
7
|
-
opentelemetry/instrumentation/openai/shared/image_gen_wrappers.py,sha256=GFgBqTiMcJFUmwKwkHDGpsnM3UXw_UJLBSVcxLbbr9Q,2122
|
|
8
|
-
opentelemetry/instrumentation/openai/utils.py,sha256=3ONjsia3xG4rRMOwjU91liOVpZxoRE39CxJ-C5HxIgQ,3464
|
|
9
|
-
opentelemetry/instrumentation/openai/v0/__init__.py,sha256=FYq3xhtaIdvy7mwCPzxaqNNGzfHEi0Q2JFQl51s6yNo,5475
|
|
10
|
-
opentelemetry/instrumentation/openai/v1/__init__.py,sha256=wDO1rjgeZRNVXXA3IJUdqYVXRsvst7_JTtAjBK-m1Gc,7693
|
|
11
|
-
opentelemetry/instrumentation/openai/v1/assistant_wrappers.py,sha256=4BDLcqOfwl0LFUdAjLE_PgRcWsQYKoCM_okWLCU8A9U,6277
|
|
12
|
-
opentelemetry/instrumentation/openai/v1/event_handler_wrapper.py,sha256=SAzYoun2yyOloofyOWtxpm8E2M9TL3Nm8TgKdNyXHuY,2779
|
|
13
|
-
opentelemetry/instrumentation/openai/version.py,sha256=u0eTmljUU0kO8AAW-e1ESQ49mK2SuhpCy7eCliBLlDU,23
|
|
14
|
-
opentelemetry_instrumentation_openai-0.26.1.dist-info/METADATA,sha256=lcrhMa87ycHNtrnU-NFS_iLvlowE5Xrakj5pao7ShSs,2255
|
|
15
|
-
opentelemetry_instrumentation_openai-0.26.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
16
|
-
opentelemetry_instrumentation_openai-0.26.1.dist-info/entry_points.txt,sha256=vTBfiX5yXji5YHikuJHEOoBZ1TFdPQ1EI4ctd2pZSeE,93
|
|
17
|
-
opentelemetry_instrumentation_openai-0.26.1.dist-info/RECORD,,
|
|
File without changes
|