arize-phoenix 5.6.0__py3-none-any.whl → 5.8.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-5.6.0.dist-info → arize_phoenix-5.8.0.dist-info}/METADATA +4 -6
- {arize_phoenix-5.6.0.dist-info → arize_phoenix-5.8.0.dist-info}/RECORD +39 -30
- {arize_phoenix-5.6.0.dist-info → arize_phoenix-5.8.0.dist-info}/WHEEL +1 -1
- phoenix/config.py +58 -0
- phoenix/server/api/helpers/playground_clients.py +758 -0
- phoenix/server/api/helpers/playground_registry.py +70 -0
- phoenix/server/api/helpers/playground_spans.py +422 -0
- phoenix/server/api/input_types/ChatCompletionInput.py +38 -0
- phoenix/server/api/input_types/GenerativeModelInput.py +17 -0
- phoenix/server/api/input_types/InvocationParameters.py +155 -13
- phoenix/server/api/input_types/TemplateOptions.py +10 -0
- phoenix/server/api/mutations/__init__.py +4 -0
- phoenix/server/api/mutations/chat_mutations.py +355 -0
- phoenix/server/api/queries.py +41 -52
- phoenix/server/api/schema.py +42 -10
- phoenix/server/api/subscriptions.py +378 -595
- phoenix/server/api/types/ChatCompletionSubscriptionPayload.py +46 -0
- phoenix/server/api/types/GenerativeProvider.py +27 -3
- phoenix/server/api/types/Span.py +37 -0
- phoenix/server/api/types/TemplateLanguage.py +9 -0
- phoenix/server/app.py +75 -13
- phoenix/server/grpc_server.py +3 -1
- phoenix/server/main.py +14 -1
- phoenix/server/static/.vite/manifest.json +31 -31
- phoenix/server/static/assets/{components-C70HJiXz.js → components-MllbfxfJ.js} +168 -150
- phoenix/server/static/assets/{index-DLe1Oo3l.js → index-BVO2YcT1.js} +2 -2
- phoenix/server/static/assets/{pages-C8-Sl7JI.js → pages-BHfC6jnL.js} +464 -310
- phoenix/server/static/assets/{vendor-CtqfhlbC.js → vendor-BEuNhfwH.js} +1 -1
- phoenix/server/static/assets/{vendor-arizeai-C_3SBz56.js → vendor-arizeai-Bskhzyjm.js} +1 -1
- phoenix/server/static/assets/{vendor-codemirror-wfdk9cjp.js → vendor-codemirror-DLlXCf0x.js} +1 -1
- phoenix/server/static/assets/{vendor-recharts-BiVnSv90.js → vendor-recharts-CRqhvLYg.js} +1 -1
- phoenix/server/templates/index.html +1 -0
- phoenix/services.py +4 -0
- phoenix/session/session.py +15 -1
- phoenix/utilities/template_formatters.py +11 -1
- phoenix/version.py +1 -1
- {arize_phoenix-5.6.0.dist-info → arize_phoenix-5.8.0.dist-info}/entry_points.txt +0 -0
- {arize_phoenix-5.6.0.dist-info → arize_phoenix-5.8.0.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-5.6.0.dist-info → arize_phoenix-5.8.0.dist-info}/licenses/LICENSE +0 -0
phoenix/server/api/schema.py
CHANGED
|
@@ -1,17 +1,49 @@
|
|
|
1
|
+
from itertools import chain
|
|
2
|
+
from typing import Any, Iterable, Iterator, Optional, Union
|
|
3
|
+
|
|
1
4
|
import strawberry
|
|
5
|
+
from strawberry.extensions import SchemaExtension
|
|
6
|
+
from strawberry.types.base import StrawberryObjectDefinition, StrawberryType
|
|
2
7
|
|
|
3
8
|
from phoenix.server.api.exceptions import get_mask_errors_extension
|
|
4
9
|
from phoenix.server.api.mutations import Mutation
|
|
5
10
|
from phoenix.server.api.queries import Query
|
|
6
11
|
from phoenix.server.api.subscriptions import Subscription
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
# See https://strawberry.rocks/docs/guides/schema-export
|
|
10
|
-
# It should be kept in sync with the server's runtime-initialized
|
|
11
|
-
# instance. To do so, search for the usage of `strawberry.Schema(...)`.
|
|
12
|
-
schema = strawberry.Schema(
|
|
13
|
-
query=Query,
|
|
14
|
-
mutation=Mutation,
|
|
15
|
-
extensions=[get_mask_errors_extension()],
|
|
16
|
-
subscription=Subscription,
|
|
12
|
+
from phoenix.server.api.types.ChatCompletionSubscriptionPayload import (
|
|
13
|
+
ChatCompletionSubscriptionPayload,
|
|
17
14
|
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def build_graphql_schema(
|
|
18
|
+
extensions: Optional[Iterable[Union[type[SchemaExtension], SchemaExtension]]] = None,
|
|
19
|
+
) -> strawberry.Schema:
|
|
20
|
+
"""
|
|
21
|
+
Builds a strawberry schema.
|
|
22
|
+
"""
|
|
23
|
+
return strawberry.Schema(
|
|
24
|
+
query=Query,
|
|
25
|
+
mutation=Mutation,
|
|
26
|
+
extensions=chain(extensions or [], [get_mask_errors_extension()]),
|
|
27
|
+
subscription=Subscription,
|
|
28
|
+
types=_implementing_types(ChatCompletionSubscriptionPayload),
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _implementing_types(interface: Any) -> Iterator[StrawberryType]:
|
|
33
|
+
"""
|
|
34
|
+
Iterates over strawberry types implementing the given strawberry interface.
|
|
35
|
+
"""
|
|
36
|
+
assert isinstance(
|
|
37
|
+
strawberry_definition := getattr(interface, "__strawberry_definition__", None),
|
|
38
|
+
StrawberryObjectDefinition,
|
|
39
|
+
)
|
|
40
|
+
assert strawberry_definition.is_interface
|
|
41
|
+
for subcls in interface.__subclasses__():
|
|
42
|
+
if isinstance(
|
|
43
|
+
getattr(subcls, "__strawberry_definition__", None),
|
|
44
|
+
StrawberryObjectDefinition,
|
|
45
|
+
):
|
|
46
|
+
yield subcls
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
_EXPORTED_GRAPHQL_SCHEMA = build_graphql_schema() # used to export the GraphQL schema to file
|