arize-phoenix 4.12.0__py3-none-any.whl → 4.12.1rc1__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.

Files changed (39) hide show
  1. {arize_phoenix-4.12.0.dist-info → arize_phoenix-4.12.1rc1.dist-info}/METADATA +4 -3
  2. {arize_phoenix-4.12.0.dist-info → arize_phoenix-4.12.1rc1.dist-info}/RECORD +36 -27
  3. phoenix/server/api/context.py +3 -7
  4. phoenix/server/api/openapi/main.py +18 -2
  5. phoenix/server/api/openapi/schema.py +12 -12
  6. phoenix/server/api/routers/v1/__init__.py +36 -83
  7. phoenix/server/api/routers/v1/dataset_examples.py +102 -123
  8. phoenix/server/api/routers/v1/datasets.py +390 -506
  9. phoenix/server/api/routers/v1/evaluations.py +73 -66
  10. phoenix/server/api/routers/v1/experiment_evaluations.py +68 -91
  11. phoenix/server/api/routers/v1/experiment_runs.py +98 -155
  12. phoenix/server/api/routers/v1/experiments.py +132 -181
  13. phoenix/server/api/routers/v1/pydantic_compat.py +78 -0
  14. phoenix/server/api/routers/v1/spans.py +144 -173
  15. phoenix/server/api/routers/v1/traces.py +115 -128
  16. phoenix/server/api/routers/v1/utils.py +95 -0
  17. phoenix/server/api/types/Project.py +33 -0
  18. phoenix/server/app.py +172 -176
  19. phoenix/server/main.py +3 -0
  20. phoenix/server/static/.vite/manifest.json +78 -0
  21. phoenix/server/static/assets/components-C8sm_r1F.js +1142 -0
  22. phoenix/server/static/assets/index-BEKPzgQs.js +100 -0
  23. phoenix/server/static/assets/pages-bN7juCjh.js +2885 -0
  24. phoenix/server/static/assets/vendor-CUDAPm8e.js +641 -0
  25. phoenix/server/static/assets/vendor-DxkFTwjz.css +1 -0
  26. phoenix/server/static/assets/vendor-arizeai-Do2HOmcL.js +662 -0
  27. phoenix/server/static/assets/vendor-codemirror-CrdxOlMs.js +12 -0
  28. phoenix/server/static/assets/vendor-recharts-PKRvByVe.js +59 -0
  29. phoenix/server/static/assets/vendor-three-DwGkEfCM.js +2998 -0
  30. phoenix/server/templates/index.html +83 -24
  31. phoenix/server/thread_server.py +2 -2
  32. phoenix/session/client.py +3 -2
  33. phoenix/version.py +1 -1
  34. phoenix/server/openapi/docs.py +0 -221
  35. phoenix/server/static/index.css +0 -6
  36. phoenix/server/static/index.js +0 -8548
  37. {arize_phoenix-4.12.0.dist-info → arize_phoenix-4.12.1rc1.dist-info}/WHEEL +0 -0
  38. {arize_phoenix-4.12.0.dist-info → arize_phoenix-4.12.1rc1.dist-info}/licenses/IP_NOTICE +0 -0
  39. {arize_phoenix-4.12.0.dist-info → arize_phoenix-4.12.1rc1.dist-info}/licenses/LICENSE +0 -0
@@ -1,3 +1,47 @@
1
+ {%- set rendered_chunks = [] -%}
2
+ {%- set css_links = [] -%}
3
+ {%- set js_scripts = [] -%}
4
+ {%- macro collect_assets(chunk_name, level=0) -%}
5
+ {% if chunk_name not in rendered_chunks %}
6
+ {% set _ = rendered_chunks.append(chunk_name) %}
7
+ {% set chunk = manifest[chunk_name] %}
8
+ {% if chunk.css %}
9
+ {% for css_file in chunk.css %}
10
+ {% if css_file not in css_links %}
11
+ {% set _ = css_links.append((basename, css_file)) %}
12
+ {% endif %}
13
+ {% endfor %}
14
+ {% endif %}
15
+ {% if chunk.imports %}
16
+ {% for import in chunk.imports %}
17
+ {% set _ = collect_assets(import, level + 1) %}
18
+ {% endfor %}
19
+ {% endif %}
20
+ {% if chunk.file.endswith('.js') %}
21
+ {% if chunk.file not in js_scripts %}
22
+ {% set _ = js_scripts.append((basename, chunk.file, level == 0)) %}
23
+ {% endif %}
24
+ {% elif chunk.file.endswith('.css') %}
25
+ {% if chunk.file not in css_links %}
26
+ {% set _ = css_links.append((basename, chunk.file)) %}
27
+ {% endif %}
28
+ {% endif %}
29
+ {% endif %}
30
+ {%- endmacro -%}
31
+ {%- macro render_css() -%}
32
+ {%- for basename, css_file in css_links -%}
33
+ <link rel="stylesheet" href="{{ basename }}/{{ css_file }}">
34
+ {% endfor -%}
35
+ {%- endmacro -%}
36
+ {%- macro render_js() -%}
37
+ {%- for basename, js_file, is_entry in js_scripts -%}
38
+ {%- if is_entry -%}
39
+ <script type="module" src="{{ basename }}/{{ js_file }}"></script>
40
+ {% else -%}
41
+ <link rel="modulepreload" href="{{ basename }}/{{ js_file }}">
42
+ {% endif -%}
43
+ {%- endfor -%}
44
+ {%- endmacro -%}
1
45
  <!DOCTYPE html>
2
46
  <html>
3
47
  <head>
@@ -11,38 +55,53 @@
11
55
  <meta property="og:description" content="AI Observability & Evaluation" />
12
56
  <meta property="og:image" content="https://raw.githubusercontent.com/Arize-ai/phoenix-assets/main/images/socal/social-preview-horizontal.jpg" />
13
57
  <meta name="theme-color" content="#ffffff" />
14
- <link rel="stylesheet" src="{{basename}}/index.css"></link>
15
58
  <link
16
59
  rel="stylesheet"
17
60
  href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap"
18
61
  />
62
+ {% if not is_development -%}
63
+ {% set _ = collect_assets('index.tsx') -%}
64
+ {{- render_css() -}}
65
+ {%- endif -%}
19
66
  <script src="{{basename}}/modernizr.js"></script>
20
67
  </head>
21
68
  <body>
22
69
  <div id="root"></div>
23
70
  <script>(function() {
24
- // Request Info:
25
- // URL: {{request.url}}
26
- // Base URL: {{request.base_url}}
27
- // Root Path: {{root_path}}
28
- Object.defineProperty(window, "Config", {
29
- // Place any server-side injected config here
30
- // E.g. default UMAP parameters etc. that needs to be
31
- // injected into the client before React runs
32
- value: Object.freeze({
33
- basename: "{{basename}}",
34
- platformVersion: "{{platform_version}}",
35
- hasInferences: Boolean("{{has_inferences}}" == "True"),
36
- hasCorpus: Boolean("{{has_corpus}}" == "True"),
37
- UMAP: {
38
- minDist: parseFloat("{{min_dist}}"),
39
- nNeighbors: parseInt("{{n_neighbors}}"),
40
- nSamples: parseInt("{{n_samples}}"),
41
- }
42
- }),
43
- writable: false
44
- });
45
- })()</script>
46
- <script type="module" src="{{basename}}/index.js"></script>
71
+ // Request Info:
72
+ // URL: {{request.url}}
73
+ // Base URL: {{request.base_url}}
74
+ // Root Path: {{root_path}}
75
+ Object.defineProperty(window, "Config", {
76
+ // Place any server-side injected config here
77
+ // E.g. default UMAP parameters etc. that needs to be
78
+ // injected into the client before React runs
79
+ value: Object.freeze({
80
+ basename: "{{basename}}",
81
+ platformVersion: "{{platform_version}}",
82
+ hasInferences: Boolean("{{has_inferences}}" == "True"),
83
+ hasCorpus: Boolean("{{has_corpus}}" == "True"),
84
+ UMAP: {
85
+ minDist: parseFloat("{{min_dist}}"),
86
+ nNeighbors: parseInt("{{n_neighbors}}"),
87
+ nSamples: parseInt("{{n_samples}}"),
88
+ }
89
+ }),
90
+ writable: false
91
+ });
92
+ })()</script>
93
+ {% if is_development -%}
94
+ <script type="module">
95
+ import RefreshRuntime from 'http://localhost:5173/@react-refresh'
96
+ RefreshRuntime.injectIntoGlobalHook(window)
97
+ window.$RefreshReg$ = () => {}
98
+ window.$RefreshSig$ = () => (type) => type
99
+ window.__vite_plugin_react_preamble_installed__ = true
100
+ </script>
101
+ <script type="module" src="http://localhost:5173/@vite/client"></script>
102
+ <script type="module" src="http://localhost:5173/index.tsx"></script>
103
+ {%- else -%}
104
+ {{- render_js() -}}
105
+ {%- endif -%}
47
106
  </body>
48
107
  </html>
@@ -4,7 +4,7 @@ from threading import Thread
4
4
  from time import sleep, time
5
5
  from typing import Generator
6
6
 
7
- from starlette.applications import Starlette
7
+ from fastapi import FastAPI
8
8
  from uvicorn import Config, Server
9
9
  from uvicorn.config import LoopSetupType
10
10
 
@@ -24,7 +24,7 @@ class ThreadServer(Server):
24
24
 
25
25
  def __init__(
26
26
  self,
27
- app: Starlette,
27
+ app: FastAPI,
28
28
  host: str,
29
29
  port: int,
30
30
  root_path: str,
phoenix/session/client.py CHANGED
@@ -300,14 +300,15 @@ class Client(TraceDataExtractor):
300
300
  for otlp_span in otlp_spans:
301
301
  serialized = otlp_span.SerializeToString()
302
302
  content = gzip.compress(serialized)
303
- self._client.post(
303
+ response = self._client.post(
304
304
  url=urljoin(self._base_url, "v1/traces"),
305
305
  content=content,
306
306
  headers={
307
307
  "content-type": "application/x-protobuf",
308
308
  "content-encoding": "gzip",
309
309
  },
310
- ).raise_for_status()
310
+ )
311
+ response.raise_for_status()
311
312
 
312
313
  def _get_dataset_id_by_name(self, name: str) -> str:
313
314
  """
phoenix/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "4.12.0"
1
+ __version__ = "4.12.1rc1"
@@ -1,221 +0,0 @@
1
- import json
2
- from typing import Any, Dict, Optional
3
-
4
- from starlette.responses import HTMLResponse
5
-
6
- swagger_ui_default_parameters: Dict[str, Any] = {
7
- "dom_id": "#swagger-ui",
8
- "layout": "BaseLayout",
9
- "deepLinking": True,
10
- "showExtensions": True,
11
- "showCommonExtensions": True,
12
- }
13
-
14
-
15
- def get_swagger_ui_html(
16
- *,
17
- openapi_url: str = "/schema",
18
- title: str,
19
- swagger_js_url: str = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui-bundle.js",
20
- swagger_css_url: str = "https://cdn.jsdelivr.net/npm/swagger-ui-dist@5.9.0/swagger-ui.css",
21
- swagger_favicon_url: str = "/favicon.ico",
22
- oauth2_redirect_url: Optional[str] = None,
23
- init_oauth: Optional[str] = None,
24
- swagger_ui_parameters: Optional[Dict[str, Any]] = None,
25
- ) -> HTMLResponse:
26
- """
27
- Generate and return the HTML that loads Swagger UI for the interactive API
28
- docs (normally served at `/docs`).
29
- """
30
- current_swagger_ui_parameters = swagger_ui_default_parameters.copy()
31
- if swagger_ui_parameters:
32
- current_swagger_ui_parameters.update(swagger_ui_parameters)
33
-
34
- html = f"""
35
- <!DOCTYPE html>
36
- <html>
37
- <head>
38
- <link type="text/css" rel="stylesheet" href="{swagger_css_url}">
39
- <link rel="shortcut icon" href="{swagger_favicon_url}">
40
- <title>{title}</title>
41
- </head>
42
- <body>
43
- <div id="swagger-ui">
44
- </div>
45
- <script src="{swagger_js_url}"></script>
46
- <style type="text/css">
47
- div[id^="operations-private"]{{display:none}} #operations-tag-private{{display:none}}
48
- </style>
49
- <!-- `SwaggerUIBundle` is now available on the page -->
50
- <script>
51
- const ui = SwaggerUIBundle({{
52
- url: '{openapi_url}',
53
- """
54
-
55
- for key, value in current_swagger_ui_parameters.items():
56
- html += f"{json.dumps(key)}: {json.dumps(value)},\n"
57
-
58
- if oauth2_redirect_url:
59
- html += f"oauth2RedirectUrl: window.location.origin + '{oauth2_redirect_url}',"
60
-
61
- html += """
62
- presets: [
63
- SwaggerUIBundle.presets.apis,
64
- SwaggerUIBundle.SwaggerUIStandalonePreset
65
- ],
66
- })"""
67
-
68
- if init_oauth:
69
- html += f"""
70
- ui.initOAuth({json.dumps(init_oauth)})
71
- """
72
-
73
- html += """
74
- </script>
75
- </body>
76
- </html>
77
- """
78
- return HTMLResponse(html)
79
-
80
-
81
- def get_redoc_html(
82
- *,
83
- openapi_url: str,
84
- title: str,
85
- redoc_js_url: str = "https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js",
86
- redoc_favicon_url: str = "/favicon.ico",
87
- with_google_fonts: bool = True,
88
- ) -> HTMLResponse:
89
- """
90
- Generate and return the HTML response that loads ReDoc for the alternative
91
- API docs (normally served at `/redoc`).
92
-
93
-
94
- """
95
- html = f"""
96
- <!DOCTYPE html>
97
- <html>
98
- <head>
99
- <title>{title}</title>
100
- <!-- needed for adaptive design -->
101
- <meta charset="utf-8"/>
102
- <meta name="viewport" content="width=device-width, initial-scale=1">
103
- """
104
- if with_google_fonts:
105
- html += """
106
- <link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
107
- """ # noqa: E501
108
- html += f"""
109
- <link rel="shortcut icon" href="{redoc_favicon_url}">
110
- <!--
111
- ReDoc doesn't change outer page styles
112
- -->
113
- <style>
114
- body {{
115
- margin: 0;
116
- padding: 0;
117
- }}
118
- </style>
119
- </head>
120
- <body>
121
- <noscript>
122
- ReDoc requires Javascript to function. Please enable it to browse the documentation.
123
- </noscript>
124
- <redoc spec-url="{openapi_url}"></redoc>
125
- <script src="{redoc_js_url}"> </script>
126
- </body>
127
- </html>
128
- """
129
- return HTMLResponse(html)
130
-
131
-
132
- # Not needed now but copy-pasting for future reference
133
- def get_swagger_ui_oauth2_redirect_html() -> HTMLResponse:
134
- """
135
- Generate the HTML response with the OAuth2 redirection for Swagger UI.
136
-
137
- You normally don't need to use or change this.
138
- """
139
- # copied from https://github.com/swagger-api/swagger-ui/blob/v4.14.0/dist/oauth2-redirect.html
140
- html = """
141
- <!doctype html>
142
- <html lang="en-US">
143
- <head>
144
- <title>Swagger UI: OAuth2 Redirect</title>
145
- </head>
146
- <body>
147
- <script>
148
- 'use strict';
149
- function run () {
150
- var oauth2 = window.opener.swaggerUIRedirectOauth2;
151
- var sentState = oauth2.state;
152
- var redirectUrl = oauth2.redirectUrl;
153
- var isValid, qp, arr;
154
-
155
- if (/code|token|error/.test(window.location.hash)) {
156
- qp = window.location.hash.substring(1).replace('?', '&');
157
- } else {
158
- qp = location.search.substring(1);
159
- }
160
-
161
- arr = qp.split("&");
162
- arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
163
- qp = qp ? JSON.parse('{' + arr.join() + '}',
164
- function (key, value) {
165
- return key === "" ? value : decodeURIComponent(value);
166
- }
167
- ) : {};
168
-
169
- isValid = qp.state === sentState;
170
-
171
- if ((
172
- oauth2.auth.schema.get("flow") === "accessCode" ||
173
- oauth2.auth.schema.get("flow") === "authorizationCode" ||
174
- oauth2.auth.schema.get("flow") === "authorization_code"
175
- ) && !oauth2.auth.code) {
176
- if (!isValid) {
177
- oauth2.errCb({
178
- authId: oauth2.auth.name,
179
- source: "auth",
180
- level: "warning",
181
- message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
182
- });
183
- }
184
-
185
- if (qp.code) {
186
- delete oauth2.state;
187
- oauth2.auth.code = qp.code;
188
- oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
189
- } else {
190
- let oauthErrorMsg;
191
- if (qp.error) {
192
- oauthErrorMsg = "["+qp.error+"]: " +
193
- (qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
194
- (qp.error_uri ? "More info: "+qp.error_uri : "");
195
- }
196
-
197
- oauth2.errCb({
198
- authId: oauth2.auth.name,
199
- source: "auth",
200
- level: "error",
201
- message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
202
- });
203
- }
204
- } else {
205
- oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
206
- }
207
- window.close();
208
- }
209
-
210
- if (document.readyState !== 'loading') {
211
- run();
212
- } else {
213
- document.addEventListener('DOMContentLoaded', function () {
214
- run();
215
- });
216
- }
217
- </script>
218
- </body>
219
- </html>
220
- """ # noqa: E501
221
- return HTMLResponse(content=html)
@@ -1,6 +0,0 @@
1
- html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}
2
- /*! Bundled license information:
3
-
4
- normalize.css/normalize.css:
5
- (*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css *)
6
- */