arize-phoenix 7.10.3__py3-none-any.whl → 7.12.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 arize-phoenix might be problematic. Click here for more details.
- {arize_phoenix-7.10.3.dist-info → arize_phoenix-7.12.0.dist-info}/METADATA +1 -1
- {arize_phoenix-7.10.3.dist-info → arize_phoenix-7.12.0.dist-info}/RECORD +14 -14
- phoenix/server/api/helpers/playground_clients.py +21 -2
- phoenix/server/api/input_types/GenerativeModelInput.py +0 -4
- phoenix/server/api/types/GenerativeProvider.py +16 -0
- phoenix/server/static/.vite/manifest.json +9 -9
- phoenix/server/static/assets/{components-CMB_kvRq.js → components-Caw_U14D.js} +105 -105
- phoenix/server/static/assets/{index-baAGkuLZ.js → index-EgdbaF48.js} +2 -2
- phoenix/server/static/assets/{pages-Cw_XOLII.js → pages-BFZvquxr.js} +281 -267
- phoenix/version.py +1 -1
- {arize_phoenix-7.10.3.dist-info → arize_phoenix-7.12.0.dist-info}/WHEEL +0 -0
- {arize_phoenix-7.10.3.dist-info → arize_phoenix-7.12.0.dist-info}/entry_points.txt +0 -0
- {arize_phoenix-7.10.3.dist-info → arize_phoenix-7.12.0.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-7.10.3.dist-info → arize_phoenix-7.12.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,7 +6,7 @@ phoenix/exceptions.py,sha256=n2L2KKuecrdflB9MsCdAYCiSEvGJptIsfRkXMoJle7A,169
|
|
|
6
6
|
phoenix/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
7
7
|
phoenix/services.py,sha256=kpW1WL0kiB8XJsO6XycvZVJ-lBkNoenhQ7atCvBoSe8,5365
|
|
8
8
|
phoenix/settings.py,sha256=ht-0oN-sMV6SPXrk7Tu1EZlngpAYkGNLYPhO8DyrdQI,661
|
|
9
|
-
phoenix/version.py,sha256=
|
|
9
|
+
phoenix/version.py,sha256=epZfTrsMWfpY2no1bS7o-MeQ23JncNk7yI5RH-5Pqlg,23
|
|
10
10
|
phoenix/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
phoenix/core/embedding_dimension.py,sha256=zKGbcvwOXgLf-yrJBpQyKtd-LEOPRKHnUToyAU8Owis,87
|
|
12
12
|
phoenix/core/model.py,sha256=qBFraOtmwCCnWJltKNP18DDG0mULXigytlFsa6YOz6k,4837
|
|
@@ -135,7 +135,7 @@ phoenix/server/api/dataloaders/cache/two_tier_cache.py,sha256=cmo8FUT3E91R139IEz
|
|
|
135
135
|
phoenix/server/api/helpers/__init__.py,sha256=m2-xaSPqUiSs91k62JaRDjFNfl-1byxBfY-m_Vxw16U,272
|
|
136
136
|
phoenix/server/api/helpers/dataset_helpers.py,sha256=DoMBTg-qXTnC_K4Evx1WKpCCYgRbITpVqyY-8efJRf0,8984
|
|
137
137
|
phoenix/server/api/helpers/experiment_run_filters.py,sha256=DOnVwrmn39eAkk2mwuZP8kIcAnR5jrOgllEwWSjsw94,29893
|
|
138
|
-
phoenix/server/api/helpers/playground_clients.py,sha256=
|
|
138
|
+
phoenix/server/api/helpers/playground_clients.py,sha256=U9EwldYQtQrubT0cJDzUAo4Y7n18_xoU9uIKPYHiBHs,39890
|
|
139
139
|
phoenix/server/api/helpers/playground_registry.py,sha256=CPLMziFB2wmr-dfbx7VbzO2f8YIG_k5RftzvGXYGQ1w,2570
|
|
140
140
|
phoenix/server/api/helpers/playground_spans.py,sha256=qGk7V7IZK7EkRE1mvZyROpLN5kgOahOZifFzUWmqYFc,16546
|
|
141
141
|
phoenix/server/api/input_types/AddExamplesToDatasetInput.py,sha256=mIQz0S_z8YdrktKIY6RCvtNJ2yZF9pYvTGgasUsI-54,430
|
|
@@ -158,7 +158,7 @@ phoenix/server/api/input_types/DeleteDatasetInput.py,sha256=p7xjCyWnVCIXHnezmDiW
|
|
|
158
158
|
phoenix/server/api/input_types/DeleteExperimentsInput.py,sha256=4d9N0vSLYbuysAamGoPUP_m8vdVhwrZmXoi2vhy_HdI,141
|
|
159
159
|
phoenix/server/api/input_types/DimensionFilter.py,sha256=eBYcn7ECSJQlEePvbStqkHBRicbIL4vEAzFJwX7bacQ,3137
|
|
160
160
|
phoenix/server/api/input_types/DimensionInput.py,sha256=Vfx5FmiMKey4-EHDQsQRPzSAMRJMN5oVMLDUl4NKAa8,164
|
|
161
|
-
phoenix/server/api/input_types/GenerativeModelInput.py,sha256=
|
|
161
|
+
phoenix/server/api/input_types/GenerativeModelInput.py,sha256=n6OCkX44I1AIovMAHCxy8SvqPKDb_BYDPA-fn_JnckQ,634
|
|
162
162
|
phoenix/server/api/input_types/Granularity.py,sha256=dbBlD_GsIBa8_xrx4JlLuR59bQ0NRB5H-cv1zvcb-cw,2299
|
|
163
163
|
phoenix/server/api/input_types/InvocationParameters.py,sha256=I_FvPvY2sXxNd-kFSB96-1DOW7lo-VbqVWzppU_5hy8,5196
|
|
164
164
|
phoenix/server/api/input_types/PatchAnnotationInput.py,sha256=NWhkcbcGNPwfOYsN3wm5YFNNrSc5T-8Y5my74RK99HE,520
|
|
@@ -238,7 +238,7 @@ phoenix/server/api/types/ExperimentRunAnnotation.py,sha256=HEbPygBwbWg10fwY3VZyM
|
|
|
238
238
|
phoenix/server/api/types/ExportedFile.py,sha256=e3GTn7B5LgsTbqiwjhMCQH7VsiqXitrBO4aCMS1lHsg,163
|
|
239
239
|
phoenix/server/api/types/Functionality.py,sha256=tzV9xdhB8zqfsjWxP66NDC7EZsplYkYO7jRbLWJIeeg,382
|
|
240
240
|
phoenix/server/api/types/GenerativeModel.py,sha256=P7eBUMXbeqaLwSSGBKdZy3a5gOLd9I0fuP8o1st6H08,193
|
|
241
|
-
phoenix/server/api/types/GenerativeProvider.py,sha256=
|
|
241
|
+
phoenix/server/api/types/GenerativeProvider.py,sha256=Zg2WcCPiM5xmQrOrfm8-Lp9srRiqNaVGeBnyNBTr390,3925
|
|
242
242
|
phoenix/server/api/types/Inferences.py,sha256=wv88PjcK-KwnzmTdukiAX9EV2KX4GqsKXVAUm1JtnDA,3383
|
|
243
243
|
phoenix/server/api/types/InferencesRole.py,sha256=mLfeHpyhGUVX1-tWzT9IwC_cD18BZrD3RA4YsHYuSpA,595
|
|
244
244
|
phoenix/server/api/types/LabelFraction.py,sha256=zsDxdFALrNiGA1eNykeP8o65gbA0HOhRp54MPH_iRAM,93
|
|
@@ -287,10 +287,10 @@ phoenix/server/static/apple-touch-icon-76x76.png,sha256=CT_xT12I0u2i0WU8JzBZBuOQ
|
|
|
287
287
|
phoenix/server/static/apple-touch-icon.png,sha256=fOfpjqGpWYbJ0eAurKsyoZP1EAs6ZVooBJ_SGk2ZkDs,3801
|
|
288
288
|
phoenix/server/static/favicon.ico,sha256=bY0vvCKRftemZfPShwZtE93DiiQdaYaozkPGwNFr6H8,34494
|
|
289
289
|
phoenix/server/static/modernizr.js,sha256=mvK-XtkNqjOral-QvzoqsyOMECXIMu5BQwSVN_wcU9c,2564
|
|
290
|
-
phoenix/server/static/.vite/manifest.json,sha256
|
|
291
|
-
phoenix/server/static/assets/components-
|
|
292
|
-
phoenix/server/static/assets/index-
|
|
293
|
-
phoenix/server/static/assets/pages-
|
|
290
|
+
phoenix/server/static/.vite/manifest.json,sha256=-112B2hz7FbbbyjgMlsRk8-lZneQvQP4g-tM-IoZty0,2163
|
|
291
|
+
phoenix/server/static/assets/components-Caw_U14D.js,sha256=dlWsRhD1_3PxoeVVITya9Yp9IkfgDdo4dO21yKDZF5g,393511
|
|
292
|
+
phoenix/server/static/assets/index-EgdbaF48.js,sha256=FEa1qyVq5vNUWSUvLMoUWK2j1Ra7EdEOIWGLp8pXrgY,8729
|
|
293
|
+
phoenix/server/static/assets/pages-BFZvquxr.js,sha256=Y0tRNqTRt220FpZdHW7vQTOcCi87p8O3zSDS6BftByE,686674
|
|
294
294
|
phoenix/server/static/assets/vendor-DvC8cT4X.js,sha256=-EzJrg6BeYa58JPfaZC6KS5gvkJ8gC1n-Sb7lP-pOkw,2159677
|
|
295
295
|
phoenix/server/static/assets/vendor-DxkFTwjz.css,sha256=nZrkr0u6NNElFGvpWHk9GTHeGoibCXCli1bE7mXZGZg,1816
|
|
296
296
|
phoenix/server/static/assets/vendor-arizeai-Do1793cv.js,sha256=IFADVVEZ8VY9o4iqYighRedZTXSyi1uZMTFFsBeIYis,305184
|
|
@@ -337,9 +337,9 @@ phoenix/utilities/project.py,sha256=auVpARXkDb-JgeX5f2aStyFIkeKvGwN9l7qrFeJMVxI,
|
|
|
337
337
|
phoenix/utilities/re.py,sha256=6YyUWIkv0zc2SigsxfOWIHzdpjKA_TZo2iqKq7zJKvw,2081
|
|
338
338
|
phoenix/utilities/span_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
339
339
|
phoenix/utilities/template_formatters.py,sha256=gh9PJD6WEGw7TEYXfSst1UR4pWWwmjxMLrDVQ_CkpkQ,2779
|
|
340
|
-
arize_phoenix-7.
|
|
341
|
-
arize_phoenix-7.
|
|
342
|
-
arize_phoenix-7.
|
|
343
|
-
arize_phoenix-7.
|
|
344
|
-
arize_phoenix-7.
|
|
345
|
-
arize_phoenix-7.
|
|
340
|
+
arize_phoenix-7.12.0.dist-info/METADATA,sha256=PJlLicxrJuM_QJI6MgWWu0L29jZxMZEmq1GVREn6Jck,23390
|
|
341
|
+
arize_phoenix-7.12.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
342
|
+
arize_phoenix-7.12.0.dist-info/entry_points.txt,sha256=Pgpn8Upxx9P8z8joPXZWl2LlnAlGc3gcQoVchb06X1Q,94
|
|
343
|
+
arize_phoenix-7.12.0.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
|
|
344
|
+
arize_phoenix-7.12.0.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
|
|
345
|
+
arize_phoenix-7.12.0.dist-info/RECORD,,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import asyncio
|
|
2
4
|
import importlib.util
|
|
3
5
|
import inspect
|
|
@@ -7,8 +9,9 @@ import time
|
|
|
7
9
|
from abc import ABC, abstractmethod
|
|
8
10
|
from collections.abc import AsyncIterator, Callable, Iterator
|
|
9
11
|
from functools import wraps
|
|
10
|
-
from typing import TYPE_CHECKING, Any, Hashable, Mapping, Optional, Union
|
|
12
|
+
from typing import TYPE_CHECKING, Any, Hashable, Mapping, MutableMapping, Optional, Union
|
|
11
13
|
|
|
14
|
+
import wrapt
|
|
12
15
|
from openinference.instrumentation import safe_json_dumps
|
|
13
16
|
from openinference.semconv.trace import (
|
|
14
17
|
OpenInferenceLLMProviderValues,
|
|
@@ -51,11 +54,13 @@ from phoenix.server.api.types.ChatCompletionSubscriptionPayload import (
|
|
|
51
54
|
from phoenix.server.api.types.GenerativeProvider import GenerativeProviderKey
|
|
52
55
|
|
|
53
56
|
if TYPE_CHECKING:
|
|
57
|
+
import httpx
|
|
54
58
|
from anthropic.types import MessageParam, TextBlockParam, ToolResultBlockParam
|
|
55
59
|
from google.generativeai.types import ContentType
|
|
56
60
|
from openai import AsyncAzureOpenAI, AsyncOpenAI
|
|
57
61
|
from openai.types import CompletionUsage
|
|
58
62
|
from openai.types.chat import ChatCompletionMessageParam, ChatCompletionMessageToolCallParam
|
|
63
|
+
from opentelemetry.util.types import AttributeValue
|
|
59
64
|
|
|
60
65
|
SetSpanAttributesFn: TypeAlias = Callable[[Mapping[str, Any]], None]
|
|
61
66
|
ChatCompletionChunk: TypeAlias = Union[TextChunk, ToolCallChunk]
|
|
@@ -169,7 +174,7 @@ class PlaygroundStreamingClient(ABC):
|
|
|
169
174
|
model: GenerativeModelInput,
|
|
170
175
|
api_key: Optional[str] = None,
|
|
171
176
|
) -> None:
|
|
172
|
-
self._attributes: dict[str,
|
|
177
|
+
self._attributes: dict[str, AttributeValue] = dict()
|
|
173
178
|
|
|
174
179
|
@classmethod
|
|
175
180
|
@abstractmethod
|
|
@@ -246,6 +251,7 @@ class OpenAIBaseStreamingClient(PlaygroundStreamingClient):
|
|
|
246
251
|
self.client = client
|
|
247
252
|
self.model_name = model.name
|
|
248
253
|
self.rate_limiter = PlaygroundRateLimiter(model.provider_key, OpenAIRateLimitError)
|
|
254
|
+
self.client._client = _HttpxClient(self.client._client, self._attributes)
|
|
249
255
|
|
|
250
256
|
@classmethod
|
|
251
257
|
def dependencies(cls) -> list[Dependency]:
|
|
@@ -696,6 +702,7 @@ class AnthropicStreamingClient(PlaygroundStreamingClient):
|
|
|
696
702
|
self.client = anthropic.AsyncAnthropic(api_key=api_key)
|
|
697
703
|
self.model_name = model.name
|
|
698
704
|
self.rate_limiter = PlaygroundRateLimiter(model.provider_key, anthropic.RateLimitError)
|
|
705
|
+
self.client._client = _HttpxClient(self.client._client, self._attributes)
|
|
699
706
|
|
|
700
707
|
@classmethod
|
|
701
708
|
def dependencies(cls) -> list[Dependency]:
|
|
@@ -1005,3 +1012,15 @@ LLM_SYSTEM = SpanAttributes.LLM_SYSTEM
|
|
|
1005
1012
|
LLM_TOKEN_COUNT_PROMPT = SpanAttributes.LLM_TOKEN_COUNT_PROMPT
|
|
1006
1013
|
LLM_TOKEN_COUNT_COMPLETION = SpanAttributes.LLM_TOKEN_COUNT_COMPLETION
|
|
1007
1014
|
LLM_TOKEN_COUNT_TOTAL = SpanAttributes.LLM_TOKEN_COUNT_TOTAL
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
class _HttpxClient(wrapt.ObjectProxy): # type: ignore
|
|
1018
|
+
def __init__(self, wrapped: httpx.AsyncClient, attributes: MutableMapping[str, Any]):
|
|
1019
|
+
super().__init__(wrapped)
|
|
1020
|
+
self._self_attributes = attributes
|
|
1021
|
+
|
|
1022
|
+
async def send(self, request: httpx.Request, **kwargs: Any) -> Any:
|
|
1023
|
+
self._self_attributes["url.full"] = str(request.url)
|
|
1024
|
+
self._self_attributes["url.path"] = request.url.path.removeprefix(self.base_url.path)
|
|
1025
|
+
response = await self.__wrapped__.send(request, **kwargs)
|
|
1026
|
+
return response
|
|
@@ -17,7 +17,3 @@ class GenerativeModelInput:
|
|
|
17
17
|
""" The endpoint to use for the model. Only required for Azure OpenAI models. """
|
|
18
18
|
api_version: Optional[str] = UNSET
|
|
19
19
|
""" The API version to use for the model. """
|
|
20
|
-
|
|
21
|
-
def __post_init__(self) -> None:
|
|
22
|
-
if self.base_url and self.endpoint:
|
|
23
|
-
raise ValueError("Must not provide both a base URL and an endpoint at the same time.")
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from enum import Enum
|
|
2
3
|
from typing import Any, ClassVar, Optional, Union
|
|
3
4
|
|
|
@@ -34,6 +35,13 @@ class GenerativeProvider:
|
|
|
34
35
|
OpenInferenceLLMProviderValues.GOOGLE.value: GenerativeProviderKey.GEMINI,
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
model_provider_to_api_key_env_var_map: ClassVar[dict[GenerativeProviderKey, str]] = {
|
|
39
|
+
GenerativeProviderKey.AZURE_OPENAI: "AZURE_OPENAI_API_KEY",
|
|
40
|
+
GenerativeProviderKey.ANTHROPIC: "ANTHROPIC_API_KEY",
|
|
41
|
+
GenerativeProviderKey.OPENAI: "OPENAI_API_KEY",
|
|
42
|
+
GenerativeProviderKey.GEMINI: "GEMINI_API_KEY",
|
|
43
|
+
}
|
|
44
|
+
|
|
37
45
|
@strawberry.field
|
|
38
46
|
async def dependencies(self) -> list[str]:
|
|
39
47
|
from phoenix.server.api.helpers.playground_registry import (
|
|
@@ -58,6 +66,14 @@ class GenerativeProvider:
|
|
|
58
66
|
return default_client.dependencies_are_installed()
|
|
59
67
|
return False
|
|
60
68
|
|
|
69
|
+
@strawberry.field(description="The API key for the provider") # type: ignore
|
|
70
|
+
async def api_key_env_var(self) -> str:
|
|
71
|
+
return self.model_provider_to_api_key_env_var_map[self.key]
|
|
72
|
+
|
|
73
|
+
@strawberry.field(description="Whether the credentials are set on the server for the provider") # type: ignore
|
|
74
|
+
async def api_key_set(self) -> bool:
|
|
75
|
+
return os.environ.get(self.model_provider_to_api_key_env_var_map[self.key]) is not None
|
|
76
|
+
|
|
61
77
|
@classmethod
|
|
62
78
|
def _infer_model_provider_from_model_name(
|
|
63
79
|
cls,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_components-
|
|
3
|
-
"file": "assets/components-
|
|
2
|
+
"_components-Caw_U14D.js": {
|
|
3
|
+
"file": "assets/components-Caw_U14D.js",
|
|
4
4
|
"name": "components",
|
|
5
5
|
"imports": [
|
|
6
6
|
"_vendor-DvC8cT4X.js",
|
|
7
|
-
"_pages-
|
|
7
|
+
"_pages-BFZvquxr.js",
|
|
8
8
|
"_vendor-arizeai-Do1793cv.js",
|
|
9
9
|
"_vendor-codemirror-BzwZPyJM.js",
|
|
10
10
|
"_vendor-three-DwGkEfCM.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
|
-
"_pages-
|
|
14
|
-
"file": "assets/pages-
|
|
13
|
+
"_pages-BFZvquxr.js": {
|
|
14
|
+
"file": "assets/pages-BFZvquxr.js",
|
|
15
15
|
"name": "pages",
|
|
16
16
|
"imports": [
|
|
17
17
|
"_vendor-DvC8cT4X.js",
|
|
18
18
|
"_vendor-arizeai-Do1793cv.js",
|
|
19
|
-
"_components-
|
|
19
|
+
"_components-Caw_U14D.js",
|
|
20
20
|
"_vendor-codemirror-BzwZPyJM.js",
|
|
21
21
|
"_vendor-recharts-_Jb7JjhG.js"
|
|
22
22
|
]
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"name": "vendor-three"
|
|
70
70
|
},
|
|
71
71
|
"index.tsx": {
|
|
72
|
-
"file": "assets/index-
|
|
72
|
+
"file": "assets/index-EgdbaF48.js",
|
|
73
73
|
"name": "index",
|
|
74
74
|
"src": "index.tsx",
|
|
75
75
|
"isEntry": true,
|
|
76
76
|
"imports": [
|
|
77
77
|
"_vendor-DvC8cT4X.js",
|
|
78
78
|
"_vendor-arizeai-Do1793cv.js",
|
|
79
|
-
"_pages-
|
|
80
|
-
"_components-
|
|
79
|
+
"_pages-BFZvquxr.js",
|
|
80
|
+
"_components-Caw_U14D.js",
|
|
81
81
|
"_vendor-three-DwGkEfCM.js",
|
|
82
82
|
"_vendor-codemirror-BzwZPyJM.js",
|
|
83
83
|
"_vendor-shiki-Cl9QBraO.js",
|