arize-phoenix 5.1.2__py3-none-any.whl → 5.1.4__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.1.2.dist-info → arize_phoenix-5.1.4.dist-info}/METADATA +1 -2
- {arize_phoenix-5.1.2.dist-info → arize_phoenix-5.1.4.dist-info}/RECORD +17 -17
- phoenix/server/email/sender.py +85 -14
- phoenix/server/main.py +10 -16
- phoenix/server/static/.vite/manifest.json +31 -31
- phoenix/server/static/assets/{components-REunxTt6.js → components-rP68rA45.js} +2 -2
- phoenix/server/static/assets/{index-DAPJxlCw.js → index-CHLTxqHu.js} +1 -1
- phoenix/server/static/assets/{pages-1VrMk2pW.js → pages-gwtz6mex.js} +6 -6
- phoenix/server/static/assets/{vendor-B5IC0ivG.js → vendor-D8cj1ZYg.js} +47 -47
- phoenix/server/static/assets/{vendor-arizeai-aFbT4kl1.js → vendor-arizeai-BU1VHwXB.js} +1 -1
- phoenix/server/static/assets/{vendor-codemirror-BEGorXSV.js → vendor-codemirror-BDMHmh1x.js} +1 -1
- phoenix/server/static/assets/{vendor-recharts-6nUU7gU_.js → vendor-recharts-BATX_8yP.js} +1 -1
- phoenix/trace/otel.py +2 -1
- phoenix/version.py +1 -1
- {arize_phoenix-5.1.2.dist-info → arize_phoenix-5.1.4.dist-info}/WHEEL +0 -0
- {arize_phoenix-5.1.2.dist-info → arize_phoenix-5.1.4.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-5.1.2.dist-info → arize_phoenix-5.1.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: arize-phoenix
|
|
3
|
-
Version: 5.1.
|
|
3
|
+
Version: 5.1.4
|
|
4
4
|
Summary: AI Observability and Evaluation
|
|
5
5
|
Project-URL: Documentation, https://docs.arize.com/phoenix/
|
|
6
6
|
Project-URL: Issues, https://github.com/Arize-ai/phoenix/issues
|
|
@@ -24,7 +24,6 @@ Requires-Dist: arize-phoenix-otel>=0.5.1
|
|
|
24
24
|
Requires-Dist: authlib
|
|
25
25
|
Requires-Dist: cachetools
|
|
26
26
|
Requires-Dist: fastapi
|
|
27
|
-
Requires-Dist: fastapi-mail
|
|
28
27
|
Requires-Dist: grpc-interceptor
|
|
29
28
|
Requires-Dist: grpcio
|
|
30
29
|
Requires-Dist: hdbscan>=0.8.38
|
|
@@ -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=aTxhcOA1pZHB6U-B3TEcp6fqDF5oT0xCUvEUNMZVTUQ,5175
|
|
8
8
|
phoenix/settings.py,sha256=ht-0oN-sMV6SPXrk7Tu1EZlngpAYkGNLYPhO8DyrdQI,661
|
|
9
|
-
phoenix/version.py,sha256=
|
|
9
|
+
phoenix/version.py,sha256=wQ7GIU7vx8_5kvdxc8_FSLwGCA9W3Ex29OSYU0A5tyo,22
|
|
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=km_a--PBHOuA337ClRw9xqhOHhrUT6Rl9pz_zV0JYkQ,4843
|
|
@@ -79,7 +79,7 @@ phoenix/server/dml_event.py,sha256=MpjCFqljxvgb9OB5Cez9vJesb3oHb3XxXictynBfcis,2
|
|
|
79
79
|
phoenix/server/dml_event_handler.py,sha256=yU23-DDwXcL35p5EPwFW0oZh6mxQxJrJAQPKcYZYJz4,8310
|
|
80
80
|
phoenix/server/grpc_server.py,sha256=nqeHg0FxGppjy8MqQUQ8DJtY4bkvJkR3tCxxmXGk6n0,3733
|
|
81
81
|
phoenix/server/jwt_store.py,sha256=lmcTRBPoxMHzSV7WT8Ew40ag4uxeMWPLDw-vPIoWL8s,16829
|
|
82
|
-
phoenix/server/main.py,sha256=
|
|
82
|
+
phoenix/server/main.py,sha256=pCKqOaJxAWwlXAl0AVIjHdszx3vkocMSSN9hJbsfsIs,15800
|
|
83
83
|
phoenix/server/oauth2.py,sha256=4zt6NEh0o2a3HUThYs-FPqOeDcvYM3YKKMg-s_Awls0,2043
|
|
84
84
|
phoenix/server/prometheus.py,sha256=x9zV3M8VeZ9GS32SLr5OxNdi1VaxvdHCZPx2zI8Hoa4,3549
|
|
85
85
|
phoenix/server/rate_limiters.py,sha256=7UJDH9YTmBIeGFLJX1759-LpS-XNp0zN1TlzxyqTnZc,7163
|
|
@@ -243,7 +243,7 @@ phoenix/server/api/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
243
243
|
phoenix/server/api/types/node.py,sha256=V0Xh9U4cGkz3iMg-vzEXtcs6cumU29JFPiU-JuGzjWI,848
|
|
244
244
|
phoenix/server/api/types/pagination.py,sha256=PcaJ0s4exsTKgCZC4aFm1cgZNrGpHSdo6PbkWzPcweg,9077
|
|
245
245
|
phoenix/server/email/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
246
|
-
phoenix/server/email/sender.py,sha256=
|
|
246
|
+
phoenix/server/email/sender.py,sha256=Df-fZKbK_01KEkjo8UnDiYSuU69YfknyI1neZK_kmwA,3388
|
|
247
247
|
phoenix/server/email/types.py,sha256=URLIMwtQWbbDEKLWjZTw9snCxsfxqRyoXNyByttbVWE,213
|
|
248
248
|
phoenix/server/email/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
249
249
|
phoenix/server/email/templates/password_reset.html,sha256=jv0Pe-06JloPZcubRWxPdAFHYEn9eDj_4SjmuoIwshI,441
|
|
@@ -258,15 +258,15 @@ phoenix/server/static/apple-touch-icon-76x76.png,sha256=CT_xT12I0u2i0WU8JzBZBuOQ
|
|
|
258
258
|
phoenix/server/static/apple-touch-icon.png,sha256=fOfpjqGpWYbJ0eAurKsyoZP1EAs6ZVooBJ_SGk2ZkDs,3801
|
|
259
259
|
phoenix/server/static/favicon.ico,sha256=bY0vvCKRftemZfPShwZtE93DiiQdaYaozkPGwNFr6H8,34494
|
|
260
260
|
phoenix/server/static/modernizr.js,sha256=mvK-XtkNqjOral-QvzoqsyOMECXIMu5BQwSVN_wcU9c,2564
|
|
261
|
-
phoenix/server/static/.vite/manifest.json,sha256=
|
|
262
|
-
phoenix/server/static/assets/components-
|
|
263
|
-
phoenix/server/static/assets/index-
|
|
264
|
-
phoenix/server/static/assets/pages-
|
|
265
|
-
phoenix/server/static/assets/vendor-
|
|
261
|
+
phoenix/server/static/.vite/manifest.json,sha256=m-L41ESalPUFFiNXV5MXzbjrXvWRe0EGb4OYPZiMiS4,1929
|
|
262
|
+
phoenix/server/static/assets/components-rP68rA45.js,sha256=09AjciFfDrLsdvf664-0OWZMl4w5Da9SZ9wrCdsyOk4,260149
|
|
263
|
+
phoenix/server/static/assets/index-CHLTxqHu.js,sha256=Eq7C2V8KWJYa50N80IlfHHxwq3MgmJy8CIDNfGXo04Y,6947
|
|
264
|
+
phoenix/server/static/assets/pages-gwtz6mex.js,sha256=pXDio_UYT8pRWwSONS8kNFIbCRaacVP8ZiUiTXZ4Tj0,557771
|
|
265
|
+
phoenix/server/static/assets/vendor-D8cj1ZYg.js,sha256=UeDWj3xjmDOo7XvqugE_ePbZZG_o1X6QqdB2Jop7dPs,1435307
|
|
266
266
|
phoenix/server/static/assets/vendor-DxkFTwjz.css,sha256=nZrkr0u6NNElFGvpWHk9GTHeGoibCXCli1bE7mXZGZg,1816
|
|
267
|
-
phoenix/server/static/assets/vendor-arizeai-
|
|
268
|
-
phoenix/server/static/assets/vendor-codemirror-
|
|
269
|
-
phoenix/server/static/assets/vendor-recharts-
|
|
267
|
+
phoenix/server/static/assets/vendor-arizeai-BU1VHwXB.js,sha256=6rYhFTNVr64dh6y8iVOiRUr9YGLxTXJO2vbOlvltamE,304401
|
|
268
|
+
phoenix/server/static/assets/vendor-codemirror-BDMHmh1x.js,sha256=nHzc7sIu8XC6Tc0yGtmbxFpNjid2lVW7kuJ19l7QNRE,516470
|
|
269
|
+
phoenix/server/static/assets/vendor-recharts-BATX_8yP.js,sha256=lm_k7iQ4lulnBnESotJGLmQO_WfulqzciqGCrkQ6lww,282859
|
|
270
270
|
phoenix/server/static/assets/vendor-three-DwGkEfCM.js,sha256=0D12ZgKzfKCTSdSTKJBFR2RZO_xxeMXrqDp0AszZqHY,620972
|
|
271
271
|
phoenix/server/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
272
272
|
phoenix/server/templates/index.html,sha256=ULNlp0-agU8pH4wCIapE1goqnwkbctAoQRgrfwH_irg,4379
|
|
@@ -281,7 +281,7 @@ phoenix/trace/errors.py,sha256=wB1z8qdPckngdfU-TORToekvg3344oNFAA83_hC2yFY,180
|
|
|
281
281
|
phoenix/trace/evaluation_conventions.py,sha256=t8jydM3U0-T5YpiQKRJ3tWdWGlHtzKyttYdw-ddvPOk,1048
|
|
282
282
|
phoenix/trace/exporter.py,sha256=bUXh8fjJIbHurrnt4bAm-cCWqUN5FqNsIc8DZzzklkQ,4695
|
|
283
283
|
phoenix/trace/fixtures.py,sha256=nfVbYYCNNO6HX5SRZHPxcy6tZZkC8xc3FbvvMLfsDhA,19005
|
|
284
|
-
phoenix/trace/otel.py,sha256=
|
|
284
|
+
phoenix/trace/otel.py,sha256=c3Iy9sUTYBliwYfChZIQ9_6xTti1BijY7t_4s2tqbyw,10028
|
|
285
285
|
phoenix/trace/projects.py,sha256=2BwlNjFE-uwpqYtCu5YyBiYZk9wRPpM13vh3-Cv7GkA,2157
|
|
286
286
|
phoenix/trace/schemas.py,sha256=HpWSyzec0yDHEQXEDuwyLbhpvKrqkGps8BJqGiIFj8Y,5978
|
|
287
287
|
phoenix/trace/span_evaluations.py,sha256=GaADtJLi2njra4aYaie0BIwkSgdxPB_SNseglI4ykZA,13104
|
|
@@ -306,8 +306,8 @@ phoenix/utilities/logging.py,sha256=B8t2WPULOwVyuGLRLbwKsw5N41N26vtgF-lCAYgWTEk,
|
|
|
306
306
|
phoenix/utilities/project.py,sha256=8IJuMM4yUMoooPi37sictGj8Etu9rGmq6RFtc9848cQ,436
|
|
307
307
|
phoenix/utilities/re.py,sha256=nr_B0txj_7CXc45953X6vr2KCRSWMuaXJSEkL8s8Sjc,2036
|
|
308
308
|
phoenix/utilities/span_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
309
|
-
arize_phoenix-5.1.
|
|
310
|
-
arize_phoenix-5.1.
|
|
311
|
-
arize_phoenix-5.1.
|
|
312
|
-
arize_phoenix-5.1.
|
|
313
|
-
arize_phoenix-5.1.
|
|
309
|
+
arize_phoenix-5.1.4.dist-info/METADATA,sha256=dJXHwHorZ7a3TOTwg12O0Thp4TSnbar7HrUF9QB_VoY,11833
|
|
310
|
+
arize_phoenix-5.1.4.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
311
|
+
arize_phoenix-5.1.4.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
|
|
312
|
+
arize_phoenix-5.1.4.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
|
|
313
|
+
arize_phoenix-5.1.4.dist-info/RECORD,,
|
phoenix/server/email/sender.py
CHANGED
|
@@ -1,26 +1,97 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import smtplib
|
|
3
|
+
import ssl
|
|
4
|
+
from email.message import EmailMessage
|
|
1
5
|
from pathlib import Path
|
|
6
|
+
from typing import Literal
|
|
2
7
|
|
|
3
|
-
from
|
|
8
|
+
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
|
4
9
|
|
|
5
10
|
EMAIL_TEMPLATE_FOLDER = Path(__file__).parent / "templates"
|
|
6
11
|
|
|
7
12
|
|
|
8
|
-
class
|
|
9
|
-
def __init__(
|
|
10
|
-
self
|
|
13
|
+
class SimpleEmailSender:
|
|
14
|
+
def __init__(
|
|
15
|
+
self,
|
|
16
|
+
smtp_server: str,
|
|
17
|
+
smtp_port: int,
|
|
18
|
+
username: str,
|
|
19
|
+
password: str,
|
|
20
|
+
sender_email: str,
|
|
21
|
+
connection_method: Literal["STARTTLS", "SSL", "PLAIN"] = "STARTTLS",
|
|
22
|
+
validate_certs: bool = True,
|
|
23
|
+
) -> None:
|
|
24
|
+
self.smtp_server = smtp_server
|
|
25
|
+
self.smtp_port = smtp_port
|
|
26
|
+
self.username = username
|
|
27
|
+
self.password = password
|
|
28
|
+
self.sender_email = sender_email
|
|
29
|
+
self.connection_method = connection_method.upper()
|
|
30
|
+
self.validate_certs = validate_certs
|
|
31
|
+
|
|
32
|
+
self.env = Environment(
|
|
33
|
+
loader=FileSystemLoader(EMAIL_TEMPLATE_FOLDER),
|
|
34
|
+
autoescape=select_autoescape(["html", "xml"]),
|
|
35
|
+
)
|
|
11
36
|
|
|
12
37
|
async def send_password_reset_email(
|
|
13
38
|
self,
|
|
14
39
|
email: str,
|
|
15
40
|
reset_url: str,
|
|
16
41
|
) -> None:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
42
|
+
subject = "[Phoenix] Password Reset Request"
|
|
43
|
+
template_name = "password_reset.html"
|
|
44
|
+
|
|
45
|
+
template = self.env.get_template(template_name)
|
|
46
|
+
html_content = template.render(reset_url=reset_url)
|
|
47
|
+
|
|
48
|
+
msg = EmailMessage()
|
|
49
|
+
msg["Subject"] = subject
|
|
50
|
+
msg["From"] = self.sender_email
|
|
51
|
+
msg["To"] = email
|
|
52
|
+
msg.set_content(html_content, subtype="html")
|
|
53
|
+
|
|
54
|
+
def send_email() -> None:
|
|
55
|
+
context: ssl.SSLContext
|
|
56
|
+
if self.validate_certs:
|
|
57
|
+
context = ssl.create_default_context()
|
|
58
|
+
else:
|
|
59
|
+
context = ssl._create_unverified_context()
|
|
60
|
+
|
|
61
|
+
methods_to_try = [self.connection_method]
|
|
62
|
+
# add secure method fallbacks
|
|
63
|
+
if self.connection_method != "PLAIN":
|
|
64
|
+
if self.connection_method != "STARTTLS":
|
|
65
|
+
methods_to_try.append("STARTTLS")
|
|
66
|
+
elif self.connection_method != "SSL":
|
|
67
|
+
methods_to_try.append("SSL")
|
|
68
|
+
|
|
69
|
+
for method in methods_to_try:
|
|
70
|
+
try:
|
|
71
|
+
if method == "STARTTLS":
|
|
72
|
+
server = smtplib.SMTP(self.smtp_server, self.smtp_port)
|
|
73
|
+
server.ehlo()
|
|
74
|
+
server.starttls(context=context)
|
|
75
|
+
server.ehlo()
|
|
76
|
+
elif method == "SSL":
|
|
77
|
+
server = smtplib.SMTP_SSL(self.smtp_server, self.smtp_port, context=context)
|
|
78
|
+
server.ehlo()
|
|
79
|
+
elif method == "PLAIN":
|
|
80
|
+
server = smtplib.SMTP(self.smtp_server, self.smtp_port)
|
|
81
|
+
server.ehlo()
|
|
82
|
+
else:
|
|
83
|
+
continue # Unsupported method
|
|
84
|
+
|
|
85
|
+
if self.username and self.password:
|
|
86
|
+
server.login(self.username, self.password)
|
|
87
|
+
|
|
88
|
+
server.send_message(msg)
|
|
89
|
+
server.quit()
|
|
90
|
+
break # Success
|
|
91
|
+
except Exception as e:
|
|
92
|
+
print(f"Failed to send email using {method}: {e}")
|
|
93
|
+
continue
|
|
94
|
+
else:
|
|
95
|
+
raise Exception("All connection methods failed")
|
|
96
|
+
|
|
97
|
+
await asyncio.to_thread(send_email)
|
phoenix/server/main.py
CHANGED
|
@@ -10,7 +10,6 @@ from time import sleep, time
|
|
|
10
10
|
from typing import List, Optional
|
|
11
11
|
from urllib.parse import urljoin
|
|
12
12
|
|
|
13
|
-
from fastapi_mail import ConnectionConfig
|
|
14
13
|
from jinja2 import BaseLoader, Environment
|
|
15
14
|
from uvicorn import Config, Server
|
|
16
15
|
|
|
@@ -59,7 +58,7 @@ from phoenix.server.app import (
|
|
|
59
58
|
create_engine_and_run_migrations,
|
|
60
59
|
instrument_engine_if_enabled,
|
|
61
60
|
)
|
|
62
|
-
from phoenix.server.email.sender import
|
|
61
|
+
from phoenix.server.email.sender import SimpleEmailSender
|
|
63
62
|
from phoenix.server.types import DbSessionFactory
|
|
64
63
|
from phoenix.settings import Settings
|
|
65
64
|
from phoenix.trace.fixtures import (
|
|
@@ -368,20 +367,15 @@ def main() -> None:
|
|
|
368
367
|
if mail_sever := get_env_smtp_hostname():
|
|
369
368
|
assert (mail_username := get_env_smtp_username()), "SMTP username is required"
|
|
370
369
|
assert (mail_password := get_env_smtp_password()), "SMTP password is required"
|
|
371
|
-
assert (
|
|
372
|
-
email_sender =
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
USE_CREDENTIALS=True,
|
|
381
|
-
MAIL_STARTTLS=True,
|
|
382
|
-
MAIL_SSL_TLS=False,
|
|
383
|
-
TEMPLATE_FOLDER=EMAIL_TEMPLATE_FOLDER,
|
|
384
|
-
)
|
|
370
|
+
assert (sender_email := get_env_smtp_mail_from()), "SMTP mail_from is required"
|
|
371
|
+
email_sender = SimpleEmailSender(
|
|
372
|
+
smtp_server=mail_sever,
|
|
373
|
+
smtp_port=get_env_smtp_port(),
|
|
374
|
+
username=mail_username,
|
|
375
|
+
password=mail_password,
|
|
376
|
+
sender_email=sender_email,
|
|
377
|
+
connection_method="STARTTLS",
|
|
378
|
+
validate_certs=get_env_smtp_validate_certs(),
|
|
385
379
|
)
|
|
386
380
|
app = create_app(
|
|
387
381
|
db=factory,
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_components-
|
|
3
|
-
"file": "assets/components-
|
|
2
|
+
"_components-rP68rA45.js": {
|
|
3
|
+
"file": "assets/components-rP68rA45.js",
|
|
4
4
|
"name": "components",
|
|
5
5
|
"imports": [
|
|
6
|
-
"_vendor-
|
|
7
|
-
"_vendor-arizeai-
|
|
8
|
-
"_pages-
|
|
6
|
+
"_vendor-D8cj1ZYg.js",
|
|
7
|
+
"_vendor-arizeai-BU1VHwXB.js",
|
|
8
|
+
"_pages-gwtz6mex.js",
|
|
9
9
|
"_vendor-three-DwGkEfCM.js",
|
|
10
|
-
"_vendor-codemirror-
|
|
10
|
+
"_vendor-codemirror-BDMHmh1x.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
|
-
"_pages-
|
|
14
|
-
"file": "assets/pages-
|
|
13
|
+
"_pages-gwtz6mex.js": {
|
|
14
|
+
"file": "assets/pages-gwtz6mex.js",
|
|
15
15
|
"name": "pages",
|
|
16
16
|
"imports": [
|
|
17
|
-
"_vendor-
|
|
18
|
-
"_vendor-arizeai-
|
|
19
|
-
"_components-
|
|
20
|
-
"_vendor-recharts-
|
|
21
|
-
"_vendor-codemirror-
|
|
17
|
+
"_vendor-D8cj1ZYg.js",
|
|
18
|
+
"_vendor-arizeai-BU1VHwXB.js",
|
|
19
|
+
"_components-rP68rA45.js",
|
|
20
|
+
"_vendor-recharts-BATX_8yP.js",
|
|
21
|
+
"_vendor-codemirror-BDMHmh1x.js"
|
|
22
22
|
]
|
|
23
23
|
},
|
|
24
24
|
"_vendor-!~{003}~.js": {
|
|
25
25
|
"file": "assets/vendor-DxkFTwjz.css",
|
|
26
26
|
"src": "_vendor-!~{003}~.js"
|
|
27
27
|
},
|
|
28
|
-
"_vendor-
|
|
29
|
-
"file": "assets/vendor-
|
|
28
|
+
"_vendor-D8cj1ZYg.js": {
|
|
29
|
+
"file": "assets/vendor-D8cj1ZYg.js",
|
|
30
30
|
"name": "vendor",
|
|
31
31
|
"imports": [
|
|
32
32
|
"_vendor-three-DwGkEfCM.js"
|
|
@@ -35,25 +35,25 @@
|
|
|
35
35
|
"assets/vendor-DxkFTwjz.css"
|
|
36
36
|
]
|
|
37
37
|
},
|
|
38
|
-
"_vendor-arizeai-
|
|
39
|
-
"file": "assets/vendor-arizeai-
|
|
38
|
+
"_vendor-arizeai-BU1VHwXB.js": {
|
|
39
|
+
"file": "assets/vendor-arizeai-BU1VHwXB.js",
|
|
40
40
|
"name": "vendor-arizeai",
|
|
41
41
|
"imports": [
|
|
42
|
-
"_vendor-
|
|
42
|
+
"_vendor-D8cj1ZYg.js"
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
|
-
"_vendor-codemirror-
|
|
46
|
-
"file": "assets/vendor-codemirror-
|
|
45
|
+
"_vendor-codemirror-BDMHmh1x.js": {
|
|
46
|
+
"file": "assets/vendor-codemirror-BDMHmh1x.js",
|
|
47
47
|
"name": "vendor-codemirror",
|
|
48
48
|
"imports": [
|
|
49
|
-
"_vendor-
|
|
49
|
+
"_vendor-D8cj1ZYg.js"
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
|
-
"_vendor-recharts-
|
|
53
|
-
"file": "assets/vendor-recharts-
|
|
52
|
+
"_vendor-recharts-BATX_8yP.js": {
|
|
53
|
+
"file": "assets/vendor-recharts-BATX_8yP.js",
|
|
54
54
|
"name": "vendor-recharts",
|
|
55
55
|
"imports": [
|
|
56
|
-
"_vendor-
|
|
56
|
+
"_vendor-D8cj1ZYg.js"
|
|
57
57
|
]
|
|
58
58
|
},
|
|
59
59
|
"_vendor-three-DwGkEfCM.js": {
|
|
@@ -61,18 +61,18 @@
|
|
|
61
61
|
"name": "vendor-three"
|
|
62
62
|
},
|
|
63
63
|
"index.tsx": {
|
|
64
|
-
"file": "assets/index-
|
|
64
|
+
"file": "assets/index-CHLTxqHu.js",
|
|
65
65
|
"name": "index",
|
|
66
66
|
"src": "index.tsx",
|
|
67
67
|
"isEntry": true,
|
|
68
68
|
"imports": [
|
|
69
|
-
"_vendor-
|
|
70
|
-
"_vendor-arizeai-
|
|
71
|
-
"_pages-
|
|
72
|
-
"_components-
|
|
69
|
+
"_vendor-D8cj1ZYg.js",
|
|
70
|
+
"_vendor-arizeai-BU1VHwXB.js",
|
|
71
|
+
"_pages-gwtz6mex.js",
|
|
72
|
+
"_components-rP68rA45.js",
|
|
73
73
|
"_vendor-three-DwGkEfCM.js",
|
|
74
|
-
"_vendor-recharts-
|
|
75
|
-
"_vendor-codemirror-
|
|
74
|
+
"_vendor-recharts-BATX_8yP.js",
|
|
75
|
+
"_vendor-codemirror-BDMHmh1x.js"
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as $e,p as at,d as Ze,r as g,j as e,R as W,n as U1,a as Fe,C as Oe,b as X,s as it,e as rt,f as de,g as _e,h as Je,i as ze,k as ue,l as l1,m as lt,o as le,q as ot,t as st,u as o1,v as o,w as m,L as Q1,x as ct,N as dt,y as ut,z as mt,$ as N,A as Ge,B as pt,D as ht,E as gt,F as ft,G as w1,H as ce,I as he,J as Lt,K as j1,S as Ct,M as yt,Q as x1,O as vt,P as bt,T as kt,U as Ye,V as q1,W as wt,X as xt,Y as St,Z as Mt,_ as Tt,a0 as It,a1 as Et,a2 as Dt,a3 as Vt,a4 as Te,a5 as F,a6 as W1,a7 as Pt,a8 as Ft,a9 as _t,aa as At,ab as Nt,ac as zt,ad as Rt}from"./vendor-
|
|
1
|
+
import{c as $e,p as at,d as Ze,r as g,j as e,R as W,n as U1,a as Fe,C as Oe,b as X,s as it,e as rt,f as de,g as _e,h as Je,i as ze,k as ue,l as l1,m as lt,o as le,q as ot,t as st,u as o1,v as o,w as m,L as Q1,x as ct,N as dt,y as ut,z as mt,$ as N,A as Ge,B as pt,D as ht,E as gt,F as ft,G as w1,H as ce,I as he,J as Lt,K as j1,S as Ct,M as yt,Q as x1,O as vt,P as bt,T as kt,U as Ye,V as q1,W as wt,X as xt,Y as St,Z as Mt,_ as Tt,a0 as It,a1 as Et,a2 as Dt,a3 as Vt,a4 as Te,a5 as F,a6 as W1,a7 as Pt,a8 as Ft,a9 as _t,aa as At,ab as Nt,ac as zt,ad as Rt}from"./vendor-D8cj1ZYg.js";import{u as Ot,A as Ht,I,a as x,_ as X1,b as v,c as D,d as b,e as H,f as q,T as B,g as Kt,h as Y,i as Ie,j as V,F as J1,k as z,l as Bt,m as $t,P as Zt,R as U,n as Ee,o as Gt,p as Ut,L as d1,q as ee,r as ne,s as De,t as Y1,v as en,E as nn,w as Qt,x as jt,y as qt,z as Wt,B as tn,C as u1,D as Xt,G as Jt,H as S1,J as Yt}from"./vendor-arizeai-BU1VHwXB.js";import{u as ea}from"./pages-gwtz6mex.js";import{V as na}from"./vendor-three-DwGkEfCM.js";import{j as an,E as rn,l as ln,a as on,R as Ue,n as Qe,p as ta,b as aa}from"./vendor-codemirror-BDMHmh1x.js";const ia=n=>{const t=a=>({markdownDisplayMode:"text",setMarkdownDisplayMode:i=>{a({markdownDisplayMode:i})},traceStreamingEnabled:!0,setTraceStreamingEnabled:i=>{a({traceStreamingEnabled:i})},lastNTimeRangeKey:"7d",setLastNTimeRangeKey:i=>{a({lastNTimeRangeKey:i})},projectsAutoRefreshEnabled:!0,setProjectAutoRefreshEnabled:i=>{a({projectsAutoRefreshEnabled:i})},showSpanAside:!0,setShowSpanAside:i=>{a({showSpanAside:i})},showMetricsInTraceTree:!0,setShowMetricsInTraceTree:i=>{a({showMetricsInTraceTree:i})},...n});return $e()(at(Ze(t),{name:"arize-phoenix-preferences"}))},sn=g.createContext(null);function ol({children:n,...t}){const[a]=g.useState(()=>ia(t));return e(sn.Provider,{value:a,children:n})}function se(n,t){const a=W.useContext(sn);if(!a)throw new Error("Missing PreferencesContext.Provider in the tree");return U1(a,n,t)}var Q=(n=>(n.primary="primary",n.reference="reference",n.corpus="corpus",n))(Q||{});function R(n){throw new Error("Unreachable")}function m1(n){return typeof n=="number"||n===null}function ra(n){return typeof n=="string"||n===null}function sl(n){return Array.isArray(n)?n.every(t=>typeof t=="string"):!1}function la(n){return typeof n=="object"&&n!==null}const p1=g.createContext(null);function je(){const n=W.useContext(p1);if(n===null)throw new Error("useInferences must be used within a InferencesProvider");return n}function cl(n){return e(p1.Provider,{value:{primaryInferences:n.primaryInferences,referenceInferences:n.referenceInferences,corpusInferences:n.corpusInferences,getInferencesNameByRole:t=>{var a,i;switch(t){case Q.primary:return n.primaryInferences.name;case Q.reference:return((a=n.referenceInferences)==null?void 0:a.name)??"reference";case Q.corpus:return((i=n.corpusInferences)==null?void 0:i.name)??"corpus";default:R()}}},children:n.children})}const cn=function(){var n={defaultValue:null,kind:"LocalArgument",name:"clusters"},t={defaultValue:null,kind:"LocalArgument",name:"dataQualityMetricColumnName"},a={defaultValue:null,kind:"LocalArgument",name:"fetchDataQualityMetric"},i={defaultValue:null,kind:"LocalArgument",name:"fetchPerformanceMetric"},r={defaultValue:null,kind:"LocalArgument",name:"performanceMetric"},l=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],s=[{alias:null,args:[{kind:"Variable",name:"clusters",variableName:"clusters"}],concreteType:"Cluster",kind:"LinkedField",name:"clusters",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"eventIds",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"driftRatio",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"primaryToCorpusRatio",storageKey:null},{condition:"fetchDataQualityMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"columnName",variableName:"dataQualityMetricColumnName"},{kind:"Literal",name:"metric",value:"mean"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"dataQualityMetric",plural:!1,selections:l,storageKey:null}]},{condition:"fetchPerformanceMetric",kind:"Condition",passingValue:!0,selections:[{alias:null,args:[{fields:[{kind:"Variable",name:"metric",variableName:"performanceMetric"}],kind:"ObjectValue",name:"metric"}],concreteType:"DatasetValues",kind:"LinkedField",name:"performanceMetric",plural:!1,selections:l,storageKey:null}]}],storageKey:null}];return{fragment:{argumentDefinitions:[n,t,a,i,r],kind:"Fragment",metadata:null,name:"pointCloudStore_clusterMetricsQuery",selections:s,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,t,i,r],kind:"Operation",name:"pointCloudStore_clusterMetricsQuery",selections:s},params:{cacheID:"86666967012812887ac0a0149d2d2535",id:null,metadata:{},name:"pointCloudStore_clusterMetricsQuery",operationKind:"query",text:`query pointCloudStore_clusterMetricsQuery(
|
|
2
2
|
$clusters: [ClusterInput!]!
|
|
3
3
|
$fetchDataQualityMetric: Boolean!
|
|
4
4
|
$dataQualityMetricColumnName: String
|
|
@@ -144,7 +144,7 @@ import{c as $e,p as at,d as Ze,r as g,j as e,R as W,n as U1,a as Fe,C as Oe,b as
|
|
|
144
144
|
id
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
`}}}();mn.hash="e8fa488a0d466b5e40fdadc1e5227a57";const oa=30,M1=5,T1=100,sa=0,I1=0,E1=.99,ca=500,D1=300,V1=1e5,da=10,P1=1,ua=2,ma=1,pa=0;var T=(n=>(n.inferences="inferences",n.correctness="correctness",n.dimension="dimension",n))(T||{}),fe=(n=>(n.list="list",n.gallery="gallery",n))(fe||{}),ge=(n=>(n.small="small",n.medium="medium",n.large="large",n))(ge||{}),E=(n=>(n.primary="primary",n.reference="reference",n.corpus="corpus",n))(E||{}),_=(n=>(n.correct="correct",n.incorrect="incorrect",n.unknown="unknown",n))(_||{});const ha=["#05fbff","#cb8afd"],ga=["#00add0","#4500d9"],J="#a5a5a5",me=J;function fa(n){return n.endsWith("/")?n.slice(0,-1):n}const Ve=`${window.location.protocol}//${window.location.host}${fa(window.Config.basename)}`,dl=window.Config.platformVersion,He="returnUrl",La=()=>window.location.pathname+window.location.search,Ca=()=>`${He}=${encodeURIComponent(La())}`,ul=({path:n,searchParams:t})=>{const i=new URL(window.location.href).searchParams.get(He),r=new URLSearchParams(t||{});i&&r.set(He,i);const l=r.toString();return`${n}${l?`?${l}`:""}`},ya=n=>!(typeof n!="string"||!n.startsWith("/")||n.replace(/\\/g,"/").startsWith("//")),va=n=>ya(n)?n:"/",ml=()=>{const n=new URL(window.location.href);return va(n.searchParams.get(He))},ba=Ve+"/auth/refresh";class F1 extends Error{constructor(){super("Unauthorized")}}async function ka(n,t){try{return await fetch(n,t).then(a=>{if(a.status===401)throw new F1;return a})}catch(a){if(a instanceof F1)return await wa(),fetch(n,t)}throw new Error("An unexpected error occurred while fetching data")}let be=null;async function wa(){return be||(be=fetch(ba,{method:"POST"}).then(n=>(n.ok||(window.location.href=`/login?${Ca()}`),be=null,n)),be)}const xa=Ve+"/graphql",Sa=window.Config.authenticationEnabled?ka:fetch,Ma=async(n,t,a)=>{const r=await(await Sa(xa,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n.text,variables:t})})).json();if(Array.isArray(r.errors))throw new Error(`Error fetching GraphQL query '${n.name}' with variables '${JSON.stringify(t)}': ${JSON.stringify(r.errors)}`);return r},Pe=new Fe.Environment({network:Fe.Network.create(Ma),store:new Fe.Store(new Fe.RecordSource,{gcReleaseBufferSize:10})});function pn(n){return n.includes("PRIMARY")?Q.primary:n.includes("CORPUS")?Q.corpus:Q.reference}function h1(n){const t=[],a=[],i=[];return n.forEach(r=>{const l=pn(r);l==Q.primary?t.push(r):l==Q.corpus?i.push(r):a.push(r)}),{primaryEventIds:t,referenceEventIds:a,corpusEventIds:i}}const Ke=10,we="unknown",hn=rt,gn=it,Ta=n=>gn[n],Ia=n=>hn(n/Ke);var Le=(n=>(n.move="move",n.select="select",n))(Le||{}),g1=(n=>(n.default="default",n.highlight="highlight",n))(g1||{});const pe=()=>bn()==="light"?ga:ha;function pl(){const n=pe();return{coloringStrategy:T.inferences,pointGroupVisibility:{[E.primary]:!0,[E.reference]:!0},pointGroupColors:{[E.primary]:n[0],[E.reference]:n[1],[E.corpus]:J},metric:{type:"drift",metric:"euclideanDistance"}}}function hl(){const n=pe();return{coloringStrategy:T.inferences,pointGroupVisibility:{[E.primary]:!0,[E.corpus]:!0},pointGroupColors:{[E.primary]:n[0],[E.corpus]:J},metric:{type:"retrieval",metric:"queryDistance"},clusterSort:{dir:"desc",column:"primaryMetricValue"}}}function gl(){return{coloringStrategy:T.correctness,pointGroupVisibility:{[_.correct]:!0,[_.incorrect]:!0,[_.unknown]:!0},pointGroupColors:{[_.correct]:Oe.Discrete2.LightBlueOrange[0],[_.incorrect]:Oe.Discrete2.LightBlueOrange[1],[_.unknown]:me},metric:{type:"performance",metric:"accuracyScore"},clusterSort:{dir:"asc",column:"primaryMetricValue"}}}const Ea=n=>{const t={loading:!1,errorMessage:null,points:[],eventIdToDataMap:new Map,clusters:[],clusterSort:{dir:"desc",column:"driftRatio"},pointData:null,selectedEventIds:new Set,hoveredEventId:null,highlightedClusterId:null,selectedClusterId:null,canvasMode:"move",pointSizeScale:1,clusterColorMode:"default",coloringStrategy:T.inferences,inferencesVisibility:{primary:!0,reference:!0,corpus:!0},pointGroupVisibility:{[E.primary]:!0,[E.reference]:!0,[E.corpus]:!0},pointGroupColors:{[E.primary]:pe()[0],[E.reference]:pe()[1],[E.corpus]:J},eventIdToGroup:{},selectionDisplay:fe.gallery,selectionGridSize:ge.large,dimension:null,dimensionMetadata:null,umapParameters:{minDist:sa,nNeighbors:oa,nSamples:ca},hdbscanParameters:{minClusterSize:da,clusterMinSamples:ma,clusterSelectionEpsilon:pa},clustersLoading:!1,metric:{type:"drift",metric:"euclideanDistance"},selectionSearchText:""},a=(i,r)=>({...t,...n,setInitialData:async({points:l,clusters:s,retrievals:d})=>{const c=r(),u=new Map,h=d.reduce((L,C)=>{const{queryId:w}=C;return L[w]?L[w].push(C):L[w]=[C],L},{});l.forEach(L=>{L={...L,retrievals:h[L.eventId]??[]},u.set(L.eventId,L)});const p=s.map(A1).sort(n1(c.clusterSort));i({loading:!1,points:l,eventIdToDataMap:u,clusters:p,clustersLoading:!1,selectedEventIds:new Set,selectedClusterId:null,pointData:null,eventIdToGroup:re({points:l,coloringStrategy:c.coloringStrategy,pointsData:c.pointData??{},dimension:c.dimension||null,dimensionMetadata:c.dimensionMetadata})});const f=await Pa(l.map(L=>L.eventId)).catch(()=>i({errorMessage:"Failed to load the point events"}));f&&i({pointData:f,clusters:p,clustersLoading:!1,eventIdToGroup:re({points:l,coloringStrategy:c.coloringStrategy,pointsData:f??{},dimension:c.dimension||null,dimensionMetadata:c.dimensionMetadata})})},setClusters:l=>{const s=r(),d=l.map(A1).sort(n1(s.clusterSort));i({clusters:d,clustersLoading:!1,selectedClusterId:null,highlightedClusterId:null})},setClusterSort:l=>{const d=[...r().clusters].sort(n1(l));i({clusterSort:l,clusters:d})},setSelectedEventIds:l=>i({selectedEventIds:l,selectionSearchText:""}),setHoveredEventId:l=>i({hoveredEventId:l}),setHighlightedClusterId:l=>i({highlightedClusterId:l}),setSelectedClusterId:l=>i({selectedClusterId:l,highlightedClusterId:null}),setPointSizeScale:l=>i({pointSizeScale:l}),setCanvasMode:l=>i({canvasMode:l}),setClusterColorMode:l=>i({clusterColorMode:l}),setColoringStrategy:l=>{const s=r();switch(i({coloringStrategy:l}),l){case T.correctness:i({pointGroupVisibility:{[_.correct]:!0,[_.incorrect]:!0,[_.unknown]:!0},pointGroupColors:{[_.correct]:Oe.Discrete2.LightBlueOrange[0],[_.incorrect]:Oe.Discrete2.LightBlueOrange[1],[_.unknown]:me},dimension:null,dimensionMetadata:null,eventIdToGroup:re({points:s.points,coloringStrategy:l,pointsData:s.pointData??{},dimension:s.dimension||null,dimensionMetadata:s.dimensionMetadata})});break;case T.inferences:{i({pointGroupVisibility:{[E.primary]:!0,[E.reference]:!0,[E.corpus]:!0},pointGroupColors:{[E.primary]:pe()[0],[E.reference]:pe()[1],[E.corpus]:J},dimension:null,dimensionMetadata:null,eventIdToGroup:re({points:s.points,coloringStrategy:l,pointsData:s.pointData??{},dimension:s.dimension||null,dimensionMetadata:s.dimensionMetadata})});break}case T.dimension:{i({pointGroupVisibility:{unknown:!0},pointGroupColors:{unknown:me},dimension:null,dimensionMetadata:null,eventIdToGroup:re({points:s.points,coloringStrategy:l,pointsData:s.pointData??{},dimension:s.dimension||null,dimensionMetadata:s.dimensionMetadata})});break}default:R()}},inferencesVisibility:{primary:!0,reference:!0,corpus:!0},setInferencesVisibility:l=>i({inferencesVisibility:l}),setPointGroupVisibility:l=>i({pointGroupVisibility:l}),selectionDisplay:fe.gallery,setSelectionDisplay:l=>i({selectionDisplay:l}),setSelectionGridSize:l=>i({selectionGridSize:l}),reset:()=>{i({points:[],clusters:[],selectedEventIds:new Set,selectedClusterId:null,eventIdToGroup:{}})},setDimension:async l=>{const s=r();i({dimension:l,dimensionMetadata:null});const d=await Va(l).catch(()=>i({errorMessage:"Failed to load the dimension metadata"}));if(d){if(i({dimensionMetadata:d}),d.categories&&d.categories.length){const c=d.categories.length,h=c<=gn.length?Ta:p=>hn(p/c);i({pointGroupVisibility:{...d.categories.reduce((p,f)=>({...p,[f]:!0}),{}),unknown:!0},pointGroupColors:{...d.categories.reduce((p,f,L)=>({...p,[f]:h(L)}),{}),unknown:me},eventIdToGroup:re({points:s.points,coloringStrategy:s.coloringStrategy,pointsData:s.pointData??{},dimension:l,dimensionMetadata:d})})}else if(d.interval!==null){const c=fn(d.interval);i({pointGroupVisibility:{...c.reduce((u,h)=>({...u,[h.name]:!0}),{}),unknown:!0},pointGroupColors:{...c.reduce((u,h,p)=>({...u,[h.name]:Ia(p)}),{}),unknown:me},eventIdToGroup:re({points:s.points,coloringStrategy:s.coloringStrategy,pointsData:s.pointData??{},dimension:l,dimensionMetadata:d})})}}},setDimensionMetadata:l=>i({dimensionMetadata:l}),setUMAPParameters:l=>i({umapParameters:l}),setHDBSCANParameters:async l=>{const s=r();i({hdbscanParameters:l,clustersLoading:!0});const d=await Fa({metric:s.metric,points:s.points,hdbscanParameters:l});s.setClusters(d)},getHDSCANParameters:()=>r().hdbscanParameters,getMetric:()=>r().metric,setErrorMessage:l=>i({errorMessage:l}),setLoading:l=>i({loading:l}),setMetric:async l=>{const s=r();i({metric:l,clustersLoading:!0});const d=await _a({metric:l,clusters:s.clusters,hdbscanParameters:s.hdbscanParameters});s.setClusters(d)},setSelectionSearchText:l=>i({selectionSearchText:l})});return $e()(Ze(a))},_1=new Intl.NumberFormat([],{maximumFractionDigits:2});function Da({min:n,max:t}){return`${_1.format(n)} - ${_1.format(t)}`}function fn({min:n,max:t}){const i=(t-n)/Ke,r=[];for(let l=0;l<Ke;l++){const s=n+l*i,d=n+(l+1)*i;r.push({min:s,max:d,name:Da({min:s,max:d})})}return r}function e1({numericGroupIntervals:n,numericValue:t}){let a=we,i=n.findIndex(r=>t>=r.min&&t<r.max);return i=i===-1?Ke-1:i,a=n[i].name,a}function re(n){const{points:t,coloringStrategy:a,pointsData:i,dimension:r,dimensionMetadata:l}=n,s={},d=t.map(c=>c.eventId);switch(a){case T.inferences:{const{primaryEventIds:c,referenceEventIds:u,corpusEventIds:h}=h1(d);c.forEach(p=>{s[p]=E.primary}),u.forEach(p=>{s[p]=E.reference}),h.forEach(p=>{s[p]=E.corpus});break}case T.correctness:{t.forEach(c=>{let u=_.unknown;const{predictionLabel:h,actualLabel:p}=c.eventMetadata;h!==null&&p!==null&&(u=h===p?_.correct:_.incorrect),s[c.eventId]=u});break}case T.dimension:{let c;l&&(l==null?void 0:l.interval)!==null&&(c=fn(l.interval));const u=(r==null?void 0:r.type)==="prediction"&&(r==null?void 0:r.dataType)==="categorical",h=(r==null?void 0:r.type)==="prediction"&&(r==null?void 0:r.dataType)==="numeric",p=(r==null?void 0:r.type)==="actual"&&(r==null?void 0:r.dataType)==="categorical",f=(r==null?void 0:r.type)==="actual"&&(r==null?void 0:r.dataType)==="numeric";t.forEach(L=>{let C=we;const w=i[L.eventId];if(r!=null&&w!=null)if(u)C=w.eventMetadata.predictionLabel??we;else if(h){if(c==null)throw new Error("Cannot color by prediction score without numeric group intervals");const S=w.eventMetadata.predictionScore;typeof S=="number"&&(C=e1({numericGroupIntervals:c,numericValue:S}))}else if(f){if(c==null)throw new Error("Cannot color by actual score without numeric group intervals");const S=w.eventMetadata.actualScore;typeof S=="number"&&(C=e1({numericGroupIntervals:c,numericValue:S}))}else if(p)C=w.eventMetadata.actualLabel??we;else{const S=w.dimensions.find(A=>A.dimension.name===r.name);if(S!=null&&r.dataType==="categorical")C=S.value??we;else if(S!=null&&r.dataType==="numeric"&&c!=null){const A=typeof(S==null?void 0:S.value)=="string"?parseFloat(S.value):null;typeof A=="number"&&(C=e1({numericGroupIntervals:c,numericValue:A}))}}s[L.eventId]=C});break}default:R()}return s}async function Va(n){const t=await X.fetchQuery(Pe,mn,{id:n.id,getDimensionMinMax:n.dataType==="numeric",getDimensionCategories:n.dataType==="categorical"}).toPromise(),a=t==null?void 0:t.dimension;if(!n)throw new Error("Dimension not found");let i=null;return typeof(a==null?void 0:a.min)=="number"&&typeof(a==null?void 0:a.max)=="number"&&(i={min:a.min,max:a.max}),{interval:i,categories:(a==null?void 0:a.categories)??null}}async function Pa(n){var u,h,p,f,L,C;const{primaryEventIds:t,referenceEventIds:a,corpusEventIds:i}=h1([...n]),r=await X.fetchQuery(Pe,un,{primaryEventIds:t,referenceEventIds:a,corpusEventIds:i}).toPromise(),l=((h=(u=r==null?void 0:r.model)==null?void 0:u.primaryInferences)==null?void 0:h.events)??[],s=((f=(p=r==null?void 0:r.model)==null?void 0:p.referenceInferences)==null?void 0:f.events)??[],d=((C=(L=r==null?void 0:r.model)==null?void 0:L.corpusInferences)==null?void 0:C.events)??[];return[...l,...s,...d].reduce((w,O)=>(w[O.id]=O,w),{})}async function Fa({metric:n,points:t,hdbscanParameters:a}){const i=await X.fetchQuery(Pe,dn,{eventIds:t.map(r=>r.eventId),coordinates:t.map(r=>({x:r.position[0],y:r.position[1],z:r.position[2]})),fetchDataQualityMetric:n.type==="dataQuality",dataQualityMetricColumnName:n.type==="dataQuality"?n.dimension.name:null,fetchPerformanceMetric:n.type==="performance",performanceMetric:n.type==="performance"?n.metric:"accuracyScore",...a},{fetchPolicy:"network-only"}).toPromise();return(i==null?void 0:i.hdbscanClustering)??[]}async function _a({metric:n,clusters:t,hdbscanParameters:a}){const i=await X.fetchQuery(Pe,cn,{clusters:t.map(r=>({id:r.id,eventIds:r.eventIds})),fetchDataQualityMetric:n.type==="dataQuality",dataQualityMetricColumnName:n.type==="dataQuality"?n.dimension.name:null,fetchPerformanceMetric:n.type==="performance",performanceMetric:n.type==="performance"?n.metric:"accuracyScore",...a},{fetchPolicy:"network-only"}).toPromise();return(i==null?void 0:i.clusters)??[]}const n1=n=>(t,a)=>{const{dir:i,column:r}=n,l=i==="asc",s=t[r],d=a[r];return s==null?1:d==null?-1:s>d?l?1:-1:s<d?l?-1:1:0};function A1(n){let t=n.driftRatio,a=null;return n.dataQualityMetric?(t=n.dataQualityMetric.primaryValue,a=n.dataQualityMetric.referenceValue):n.performanceMetric?(t=n.performanceMetric.primaryValue,a=n.performanceMetric.referenceValue):n.primaryToCorpusRatio!=null&&(t=(n.primaryToCorpusRatio+1)/2*100),{...n,size:n.eventIds.length,primaryMetricValue:t,referenceMetricValue:a}}const f1=g.createContext(null);function fl({children:n,...t}){const a=g.useRef();return a.current||(a.current=Ea(t)),e(f1.Provider,{value:a.current,children:n})}function y(n,t){const a=g.useContext(f1);if(!a)throw new Error("Missing PointCloudContext.Provider in the tree");return U1(a,n,t)}var Z=(n=>(n.last_hour="Last Hour",n.last_day="Last Day",n.last_week="Last Week",n.last_month="Last Month",n.last_3_months="Last 3 Months",n.first_hour="First Hour",n.first_day="First Day",n.first_week="First Week",n.first_month="First Month",n.all="All",n))(Z||{});const Ln=g.createContext(null);function Aa(){const n=g.useContext(Ln);if(n===null)throw new Error("useTimeRange must be used within a TimeRangeProvider");return n}function Na(n,t){return g.useMemo(()=>{switch(n){case"Last Hour":{const i=de(st(t.end),{roundingMethod:"ceil"});return{start:o1(i,1),end:i}}case"Last Day":{const i=de(ot(t.end),{roundingMethod:"ceil"});return{start:le(i,1),end:i}}case"Last Week":{const i=de(_e(t.end),{roundingMethod:"ceil"});return{start:le(i,7),end:i}}case"Last Month":{const i=de(_e(t.end),{roundingMethod:"ceil"});return{start:le(i,30),end:i}}case"Last 3 Months":{const i=de(_e(t.end),{roundingMethod:"ceil"});return{start:le(i,90),end:i}}case"First Hour":{const i=l1(t.start);return{start:i,end:lt(i,1)}}case"First Day":{const i=ue(t.start);return{start:i,end:ze(i,1)}}case"First Week":{const i=Je(t.start);return{start:i,end:ze(i,7)}}case"First Month":{const i=Je(t.start);return{start:i,end:ze(i,30)}}case"All":{const i=de(_e(t.end),{roundingMethod:"floor"});return{start:Je(t.start),end:i}}default:R()}},[n,t])}function Ll(n){const[t,a]=g.useState("Last Month"),i=Na(t,n.timeRangeBounds),r=g.useCallback(l=>{g.startTransition(()=>{a(l)})},[]);return e(Ln.Provider,{value:{timeRange:i,timePreset:t,setTimePreset:r},children:n.children})}const Cn=g.createContext(null);function Cl({children:n}){const[t,a]=Ot({style:{zIndex:1e3}}),i=g.useCallback(l=>{t({variant:"danger",...l})},[t]),r=g.useCallback(l=>{t({variant:"success",...l})},[t]);return o(Cn.Provider,{value:{notify:t,notifyError:i,notifySuccess:r},children:[n,a]})}function yn(){const n=g.useContext(Cn);if(n===null)throw new Error("useGlobalNotification must be used within a NotificationProvider");return n}function yl(){return yn().notifyError}function vl(){return yn().notifySuccess}const vn="arize-phoenix-theme";function bn(){return localStorage.getItem(vn)==="light"?"light":"dark"}const L1=g.createContext(null);function j(){const n=g.useContext(L1);if(n===null)throw new Error("useTheme must be used within a ThemeProvider");return n}function bl(n){const[t,a]=g.useState(bn()),i=g.useCallback(r=>{localStorage.setItem(vn,r),a(r)},[]);return e(L1.Provider,{value:{theme:t,setTheme:i},children:n.children})}function kn(n){return e("div",{onClick:t=>t.stopPropagation(),css:m`
|
|
147
|
+
`}}}();mn.hash="e8fa488a0d466b5e40fdadc1e5227a57";const oa=30,M1=5,T1=100,sa=0,I1=0,E1=.99,ca=500,D1=300,V1=1e5,da=10,P1=1,ua=2,ma=1,pa=0;var T=(n=>(n.inferences="inferences",n.correctness="correctness",n.dimension="dimension",n))(T||{}),fe=(n=>(n.list="list",n.gallery="gallery",n))(fe||{}),ge=(n=>(n.small="small",n.medium="medium",n.large="large",n))(ge||{}),E=(n=>(n.primary="primary",n.reference="reference",n.corpus="corpus",n))(E||{}),_=(n=>(n.correct="correct",n.incorrect="incorrect",n.unknown="unknown",n))(_||{});const ha=["#05fbff","#cb8afd"],ga=["#00add0","#4500d9"],J="#a5a5a5",me=J;function fa(n){return n.endsWith("/")?n.slice(0,-1):n}const Ve=`${window.location.protocol}//${window.location.host}${fa(window.Config.basename)}`,dl=window.Config.platformVersion,He="returnUrl",La=()=>window.location.pathname+window.location.search,Ca=()=>`${He}=${encodeURIComponent(La())}`,ul=({path:n,searchParams:t})=>{const i=new URL(window.location.href).searchParams.get(He),r=new URLSearchParams(t||{});i&&r.set(He,i);const l=r.toString();return`${n}${l?`?${l}`:""}`},ya=n=>!(typeof n!="string"||!n.startsWith("/")||n.replace(/\\/g,"/").startsWith("//")),va=n=>ya(n)?n:"/",ml=()=>{const n=new URL(window.location.href);return va(n.searchParams.get(He))},ba=Ve+"/auth/refresh";class F1 extends Error{constructor(){super("Unauthorized")}}async function ka(n,t){try{return await fetch(n,t).then(a=>{if(a.status===401)throw new F1;return a})}catch(a){if(a instanceof F1)return await wa(),fetch(n,t)}throw new Error("An unexpected error occurred while fetching data")}let be=null;async function wa(){return be||(be=fetch(ba,{method:"POST"}).then(n=>(n.ok||(window.location.href=`/login?${Ca()}`),be=null,n)),be)}const xa=Ve+"/graphql",Sa=window.Config.authenticationEnabled?ka:fetch,Ma=async(n,t,a)=>{const r=await(await Sa(xa,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n.text,variables:t})})).json();if(Array.isArray(r.errors))throw new Error(`Error fetching GraphQL query '${n.name}' with variables '${JSON.stringify(t)}': ${JSON.stringify(r.errors)}`);return r},Pe=new Fe.Environment({network:Fe.Network.create(Ma),store:new Fe.Store(new Fe.RecordSource,{gcReleaseBufferSize:10})});function pn(n){return n.includes("PRIMARY")?Q.primary:n.includes("CORPUS")?Q.corpus:Q.reference}function h1(n){const t=[],a=[],i=[];return n.forEach(r=>{const l=pn(r);l==Q.primary?t.push(r):l==Q.corpus?i.push(r):a.push(r)}),{primaryEventIds:t,referenceEventIds:a,corpusEventIds:i}}const Ke=10,we="unknown",hn=rt,gn=it,Ta=n=>gn[n],Ia=n=>hn(n/Ke);var Le=(n=>(n.move="move",n.select="select",n))(Le||{}),g1=(n=>(n.default="default",n.highlight="highlight",n))(g1||{});const pe=()=>bn()==="light"?ga:ha;function pl(){const n=pe();return{coloringStrategy:T.inferences,pointGroupVisibility:{[E.primary]:!0,[E.reference]:!0},pointGroupColors:{[E.primary]:n[0],[E.reference]:n[1],[E.corpus]:J},metric:{type:"drift",metric:"euclideanDistance"}}}function hl(){const n=pe();return{coloringStrategy:T.inferences,pointGroupVisibility:{[E.primary]:!0,[E.corpus]:!0},pointGroupColors:{[E.primary]:n[0],[E.corpus]:J},metric:{type:"retrieval",metric:"queryDistance"},clusterSort:{dir:"desc",column:"primaryMetricValue"}}}function gl(){return{coloringStrategy:T.correctness,pointGroupVisibility:{[_.correct]:!0,[_.incorrect]:!0,[_.unknown]:!0},pointGroupColors:{[_.correct]:Oe.Discrete2.LightBlueOrange[0],[_.incorrect]:Oe.Discrete2.LightBlueOrange[1],[_.unknown]:me},metric:{type:"performance",metric:"accuracyScore"},clusterSort:{dir:"asc",column:"primaryMetricValue"}}}const Ea=n=>{const t={loading:!1,errorMessage:null,points:[],eventIdToDataMap:new Map,clusters:[],clusterSort:{dir:"desc",column:"driftRatio"},pointData:null,selectedEventIds:new Set,hoveredEventId:null,highlightedClusterId:null,selectedClusterId:null,canvasMode:"move",pointSizeScale:1,clusterColorMode:"default",coloringStrategy:T.inferences,inferencesVisibility:{primary:!0,reference:!0,corpus:!0},pointGroupVisibility:{[E.primary]:!0,[E.reference]:!0,[E.corpus]:!0},pointGroupColors:{[E.primary]:pe()[0],[E.reference]:pe()[1],[E.corpus]:J},eventIdToGroup:{},selectionDisplay:fe.gallery,selectionGridSize:ge.large,dimension:null,dimensionMetadata:null,umapParameters:{minDist:sa,nNeighbors:oa,nSamples:ca},hdbscanParameters:{minClusterSize:da,clusterMinSamples:ma,clusterSelectionEpsilon:pa},clustersLoading:!1,metric:{type:"drift",metric:"euclideanDistance"},selectionSearchText:""},a=(i,r)=>({...t,...n,setInitialData:async({points:l,clusters:s,retrievals:d})=>{const c=r(),u=new Map,h=d.reduce((L,C)=>{const{queryId:w}=C;return L[w]?L[w].push(C):L[w]=[C],L},{});l.forEach(L=>{L={...L,retrievals:h[L.eventId]??[]},u.set(L.eventId,L)});const p=s.map(A1).sort(n1(c.clusterSort));i({loading:!1,points:l,eventIdToDataMap:u,clusters:p,clustersLoading:!1,selectedEventIds:new Set,selectedClusterId:null,pointData:null,eventIdToGroup:re({points:l,coloringStrategy:c.coloringStrategy,pointsData:c.pointData??{},dimension:c.dimension||null,dimensionMetadata:c.dimensionMetadata})});const f=await Pa(l.map(L=>L.eventId)).catch(()=>i({errorMessage:"Failed to load the point events"}));f&&i({pointData:f,clusters:p,clustersLoading:!1,eventIdToGroup:re({points:l,coloringStrategy:c.coloringStrategy,pointsData:f??{},dimension:c.dimension||null,dimensionMetadata:c.dimensionMetadata})})},setClusters:l=>{const s=r(),d=l.map(A1).sort(n1(s.clusterSort));i({clusters:d,clustersLoading:!1,selectedClusterId:null,highlightedClusterId:null})},setClusterSort:l=>{const d=[...r().clusters].sort(n1(l));i({clusterSort:l,clusters:d})},setSelectedEventIds:l=>i({selectedEventIds:l,selectionSearchText:""}),setHoveredEventId:l=>i({hoveredEventId:l}),setHighlightedClusterId:l=>i({highlightedClusterId:l}),setSelectedClusterId:l=>i({selectedClusterId:l,highlightedClusterId:null}),setPointSizeScale:l=>i({pointSizeScale:l}),setCanvasMode:l=>i({canvasMode:l}),setClusterColorMode:l=>i({clusterColorMode:l}),setColoringStrategy:l=>{const s=r();switch(i({coloringStrategy:l}),l){case T.correctness:i({pointGroupVisibility:{[_.correct]:!0,[_.incorrect]:!0,[_.unknown]:!0},pointGroupColors:{[_.correct]:Oe.Discrete2.LightBlueOrange[0],[_.incorrect]:Oe.Discrete2.LightBlueOrange[1],[_.unknown]:me},dimension:null,dimensionMetadata:null,eventIdToGroup:re({points:s.points,coloringStrategy:l,pointsData:s.pointData??{},dimension:s.dimension||null,dimensionMetadata:s.dimensionMetadata})});break;case T.inferences:{i({pointGroupVisibility:{[E.primary]:!0,[E.reference]:!0,[E.corpus]:!0},pointGroupColors:{[E.primary]:pe()[0],[E.reference]:pe()[1],[E.corpus]:J},dimension:null,dimensionMetadata:null,eventIdToGroup:re({points:s.points,coloringStrategy:l,pointsData:s.pointData??{},dimension:s.dimension||null,dimensionMetadata:s.dimensionMetadata})});break}case T.dimension:{i({pointGroupVisibility:{unknown:!0},pointGroupColors:{unknown:me},dimension:null,dimensionMetadata:null,eventIdToGroup:re({points:s.points,coloringStrategy:l,pointsData:s.pointData??{},dimension:s.dimension||null,dimensionMetadata:s.dimensionMetadata})});break}default:R()}},inferencesVisibility:{primary:!0,reference:!0,corpus:!0},setInferencesVisibility:l=>i({inferencesVisibility:l}),setPointGroupVisibility:l=>i({pointGroupVisibility:l}),selectionDisplay:fe.gallery,setSelectionDisplay:l=>i({selectionDisplay:l}),setSelectionGridSize:l=>i({selectionGridSize:l}),reset:()=>{i({points:[],clusters:[],selectedEventIds:new Set,selectedClusterId:null,eventIdToGroup:{}})},setDimension:async l=>{const s=r();i({dimension:l,dimensionMetadata:null});const d=await Va(l).catch(()=>i({errorMessage:"Failed to load the dimension metadata"}));if(d){if(i({dimensionMetadata:d}),d.categories&&d.categories.length){const c=d.categories.length,h=c<=gn.length?Ta:p=>hn(p/c);i({pointGroupVisibility:{...d.categories.reduce((p,f)=>({...p,[f]:!0}),{}),unknown:!0},pointGroupColors:{...d.categories.reduce((p,f,L)=>({...p,[f]:h(L)}),{}),unknown:me},eventIdToGroup:re({points:s.points,coloringStrategy:s.coloringStrategy,pointsData:s.pointData??{},dimension:l,dimensionMetadata:d})})}else if(d.interval!==null){const c=fn(d.interval);i({pointGroupVisibility:{...c.reduce((u,h)=>({...u,[h.name]:!0}),{}),unknown:!0},pointGroupColors:{...c.reduce((u,h,p)=>({...u,[h.name]:Ia(p)}),{}),unknown:me},eventIdToGroup:re({points:s.points,coloringStrategy:s.coloringStrategy,pointsData:s.pointData??{},dimension:l,dimensionMetadata:d})})}}},setDimensionMetadata:l=>i({dimensionMetadata:l}),setUMAPParameters:l=>i({umapParameters:l}),setHDBSCANParameters:async l=>{const s=r();i({hdbscanParameters:l,clustersLoading:!0});const d=await Fa({metric:s.metric,points:s.points,hdbscanParameters:l});s.setClusters(d)},getHDSCANParameters:()=>r().hdbscanParameters,getMetric:()=>r().metric,setErrorMessage:l=>i({errorMessage:l}),setLoading:l=>i({loading:l}),setMetric:async l=>{const s=r();i({metric:l,clustersLoading:!0});const d=await _a({metric:l,clusters:s.clusters,hdbscanParameters:s.hdbscanParameters});s.setClusters(d)},setSelectionSearchText:l=>i({selectionSearchText:l})});return $e()(Ze(a))},_1=new Intl.NumberFormat([],{maximumFractionDigits:2});function Da({min:n,max:t}){return`${_1.format(n)} - ${_1.format(t)}`}function fn({min:n,max:t}){const i=(t-n)/Ke,r=[];for(let l=0;l<Ke;l++){const s=n+l*i,d=n+(l+1)*i;r.push({min:s,max:d,name:Da({min:s,max:d})})}return r}function e1({numericGroupIntervals:n,numericValue:t}){let a=we,i=n.findIndex(r=>t>=r.min&&t<r.max);return i=i===-1?Ke-1:i,a=n[i].name,a}function re(n){const{points:t,coloringStrategy:a,pointsData:i,dimension:r,dimensionMetadata:l}=n,s={},d=t.map(c=>c.eventId);switch(a){case T.inferences:{const{primaryEventIds:c,referenceEventIds:u,corpusEventIds:h}=h1(d);c.forEach(p=>{s[p]=E.primary}),u.forEach(p=>{s[p]=E.reference}),h.forEach(p=>{s[p]=E.corpus});break}case T.correctness:{t.forEach(c=>{let u=_.unknown;const{predictionLabel:h,actualLabel:p}=c.eventMetadata;h!==null&&p!==null&&(u=h===p?_.correct:_.incorrect),s[c.eventId]=u});break}case T.dimension:{let c;l&&(l==null?void 0:l.interval)!==null&&(c=fn(l.interval));const u=(r==null?void 0:r.type)==="prediction"&&(r==null?void 0:r.dataType)==="categorical",h=(r==null?void 0:r.type)==="prediction"&&(r==null?void 0:r.dataType)==="numeric",p=(r==null?void 0:r.type)==="actual"&&(r==null?void 0:r.dataType)==="categorical",f=(r==null?void 0:r.type)==="actual"&&(r==null?void 0:r.dataType)==="numeric";t.forEach(L=>{let C=we;const w=i[L.eventId];if(r!=null&&w!=null)if(u)C=w.eventMetadata.predictionLabel??we;else if(h){if(c==null)throw new Error("Cannot color by prediction score without numeric group intervals");const S=w.eventMetadata.predictionScore;typeof S=="number"&&(C=e1({numericGroupIntervals:c,numericValue:S}))}else if(f){if(c==null)throw new Error("Cannot color by actual score without numeric group intervals");const S=w.eventMetadata.actualScore;typeof S=="number"&&(C=e1({numericGroupIntervals:c,numericValue:S}))}else if(p)C=w.eventMetadata.actualLabel??we;else{const S=w.dimensions.find(A=>A.dimension.name===r.name);if(S!=null&&r.dataType==="categorical")C=S.value??we;else if(S!=null&&r.dataType==="numeric"&&c!=null){const A=typeof(S==null?void 0:S.value)=="string"?parseFloat(S.value):null;typeof A=="number"&&(C=e1({numericGroupIntervals:c,numericValue:A}))}}s[L.eventId]=C});break}default:R()}return s}async function Va(n){const t=await X.fetchQuery(Pe,mn,{id:n.id,getDimensionMinMax:n.dataType==="numeric",getDimensionCategories:n.dataType==="categorical"}).toPromise(),a=t==null?void 0:t.dimension;if(!n)throw new Error("Dimension not found");let i=null;return typeof(a==null?void 0:a.min)=="number"&&typeof(a==null?void 0:a.max)=="number"&&(i={min:a.min,max:a.max}),{interval:i,categories:(a==null?void 0:a.categories)??null}}async function Pa(n){var u,h,p,f,L,C;const{primaryEventIds:t,referenceEventIds:a,corpusEventIds:i}=h1([...n]),r=await X.fetchQuery(Pe,un,{primaryEventIds:t,referenceEventIds:a,corpusEventIds:i}).toPromise(),l=((h=(u=r==null?void 0:r.model)==null?void 0:u.primaryInferences)==null?void 0:h.events)??[],s=((f=(p=r==null?void 0:r.model)==null?void 0:p.referenceInferences)==null?void 0:f.events)??[],d=((C=(L=r==null?void 0:r.model)==null?void 0:L.corpusInferences)==null?void 0:C.events)??[];return[...l,...s,...d].reduce((w,O)=>(w[O.id]=O,w),{})}async function Fa({metric:n,points:t,hdbscanParameters:a}){const i=await X.fetchQuery(Pe,dn,{eventIds:t.map(r=>r.eventId),coordinates:t.map(r=>({x:r.position[0],y:r.position[1],z:r.position[2]})),fetchDataQualityMetric:n.type==="dataQuality",dataQualityMetricColumnName:n.type==="dataQuality"?n.dimension.name:null,fetchPerformanceMetric:n.type==="performance",performanceMetric:n.type==="performance"?n.metric:"accuracyScore",...a},{fetchPolicy:"network-only"}).toPromise();return(i==null?void 0:i.hdbscanClustering)??[]}async function _a({metric:n,clusters:t,hdbscanParameters:a}){const i=await X.fetchQuery(Pe,cn,{clusters:t.map(r=>({id:r.id,eventIds:r.eventIds})),fetchDataQualityMetric:n.type==="dataQuality",dataQualityMetricColumnName:n.type==="dataQuality"?n.dimension.name:null,fetchPerformanceMetric:n.type==="performance",performanceMetric:n.type==="performance"?n.metric:"accuracyScore",...a},{fetchPolicy:"network-only"}).toPromise();return(i==null?void 0:i.clusters)??[]}const n1=n=>(t,a)=>{const{dir:i,column:r}=n,l=i==="asc",s=t[r],d=a[r];return s==null?1:d==null?-1:s>d?l?1:-1:s<d?l?-1:1:0};function A1(n){let t=n.driftRatio,a=null;return n.dataQualityMetric?(t=n.dataQualityMetric.primaryValue,a=n.dataQualityMetric.referenceValue):n.performanceMetric?(t=n.performanceMetric.primaryValue,a=n.performanceMetric.referenceValue):n.primaryToCorpusRatio!=null&&(t=(n.primaryToCorpusRatio+1)/2*100),{...n,size:n.eventIds.length,primaryMetricValue:t,referenceMetricValue:a}}const f1=g.createContext(null);function fl({children:n,...t}){const[a]=g.useState(()=>Ea(t));return e(f1.Provider,{value:a,children:n})}function y(n,t){const a=g.useContext(f1);if(!a)throw new Error("Missing PointCloudContext.Provider in the tree");return U1(a,n,t)}var Z=(n=>(n.last_hour="Last Hour",n.last_day="Last Day",n.last_week="Last Week",n.last_month="Last Month",n.last_3_months="Last 3 Months",n.first_hour="First Hour",n.first_day="First Day",n.first_week="First Week",n.first_month="First Month",n.all="All",n))(Z||{});const Ln=g.createContext(null);function Aa(){const n=g.useContext(Ln);if(n===null)throw new Error("useTimeRange must be used within a TimeRangeProvider");return n}function Na(n,t){return g.useMemo(()=>{switch(n){case"Last Hour":{const i=de(st(t.end),{roundingMethod:"ceil"});return{start:o1(i,1),end:i}}case"Last Day":{const i=de(ot(t.end),{roundingMethod:"ceil"});return{start:le(i,1),end:i}}case"Last Week":{const i=de(_e(t.end),{roundingMethod:"ceil"});return{start:le(i,7),end:i}}case"Last Month":{const i=de(_e(t.end),{roundingMethod:"ceil"});return{start:le(i,30),end:i}}case"Last 3 Months":{const i=de(_e(t.end),{roundingMethod:"ceil"});return{start:le(i,90),end:i}}case"First Hour":{const i=l1(t.start);return{start:i,end:lt(i,1)}}case"First Day":{const i=ue(t.start);return{start:i,end:ze(i,1)}}case"First Week":{const i=Je(t.start);return{start:i,end:ze(i,7)}}case"First Month":{const i=Je(t.start);return{start:i,end:ze(i,30)}}case"All":{const i=de(_e(t.end),{roundingMethod:"floor"});return{start:Je(t.start),end:i}}default:R()}},[n,t])}function Ll(n){const[t,a]=g.useState("Last Month"),i=Na(t,n.timeRangeBounds),r=g.useCallback(l=>{g.startTransition(()=>{a(l)})},[]);return e(Ln.Provider,{value:{timeRange:i,timePreset:t,setTimePreset:r},children:n.children})}const Cn=g.createContext(null);function Cl({children:n}){const[t,a]=Ot({style:{zIndex:1e3}}),i=g.useCallback(l=>{t({variant:"danger",...l})},[t]),r=g.useCallback(l=>{t({variant:"success",...l})},[t]);return o(Cn.Provider,{value:{notify:t,notifyError:i,notifySuccess:r},children:[n,a]})}function yn(){const n=g.useContext(Cn);if(n===null)throw new Error("useGlobalNotification must be used within a NotificationProvider");return n}function yl(){return yn().notifyError}function vl(){return yn().notifySuccess}const vn="arize-phoenix-theme";function bn(){return localStorage.getItem(vn)==="light"?"light":"dark"}const L1=g.createContext(null);function j(){const n=g.useContext(L1);if(n===null)throw new Error("useTheme must be used within a ThemeProvider");return n}function bl(n){const[t,a]=g.useState(bn()),i=g.useCallback(r=>{localStorage.setItem(vn,r),a(r)},[]);return e(L1.Provider,{value:{theme:t,setTheme:i},children:n.children})}function kn(n){return e("div",{onClick:t=>t.stopPropagation(),css:m`
|
|
148
148
|
display: inline-block;
|
|
149
149
|
`,children:e(Q1,{css:m`
|
|
150
150
|
color: var(--ac-global-color-primary);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,w as h,aR as b,d6 as x,d7 as f,v as n,d8 as r,d9 as y,da as P,r as v,b as w,db as R}from"./vendor-
|
|
1
|
+
import{j as e,w as h,aR as b,d6 as x,d7 as f,v as n,d8 as r,d9 as y,da as P,r as v,b as w,db as R}from"./vendor-D8cj1ZYg.js";import{v as L,a4 as z}from"./vendor-arizeai-BU1VHwXB.js";import{E,L as k,R as $,r as j,a as S,F as A,A as I,b as F,c as T,P as C,h as O,M as D,d,D as B,e as M,f as N,g as q,i as G,j as W,T as K,p as H,k as c,l as J,m as Q,n as p,o as U,q as m,s as g,t as V,v as X,w as Y,x as Z,y as _,z as ee,B as re,S as ae,C as oe,G as te}from"./pages-gwtz6mex.js";import{bo as ne,i as se,R as le,bp as ie,bq as de}from"./components-rP68rA45.js";import"./vendor-three-DwGkEfCM.js";import"./vendor-recharts-BATX_8yP.js";import"./vendor-codemirror-BDMHmh1x.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const t of o)if(t.type==="childList")for(const l of t.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function u(o){const t={};return o.integrity&&(t.integrity=o.integrity),o.referrerPolicy&&(t.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?t.credentials="include":o.crossOrigin==="anonymous"?t.credentials="omit":t.credentials="same-origin",t}function i(o){if(o.ep)return;o.ep=!0;const t=u(o);fetch(o.href,t)}})();function ce(){return e(b,{styles:a=>h`
|
|
2
2
|
body {
|
|
3
3
|
background-color: var(--ac-global-color-grey-75);
|
|
4
4
|
color: var(--ac-global-text-color-900);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as m,j as e,ae as ss,v as s,H as j,R as Ce,w as C,af as De,y as ee,b as T,ag as xn,ah as Ye,$ as W,ai as ta,B as me,D as ge,G as H,F as wn,o as Fl,aj as Ge,ak as re,al as We,am as os,I as Va,an as An,a4 as Fe,a5 as q,a6 as ds,ao as fe,ap as sn,aq as cs,ar as Sa,as as va,at as Ca,au as zn,av as Ie,aw as oa,n as za,a as us,ax as ms,ay as gs,aa as ps,ab as ys,az as fs,c as hs,d as ks,aA as bs,x as Ss}from"./vendor-
|
|
1
|
+
import{r as m,j as e,ae as ss,v as s,H as j,R as Ce,w as C,af as De,y as ee,b as T,ag as xn,ah as Ye,$ as W,ai as ta,B as me,D as ge,G as H,F as wn,o as Fl,aj as Ge,ak as re,al as We,am as os,I as Va,an as An,a4 as Fe,a5 as q,a6 as ds,ao as fe,ap as sn,aq as cs,ar as Sa,as as va,at as Ca,au as zn,av as Ie,aw as oa,n as za,a as us,ax as ms,ay as gs,aa as ps,ab as ys,az as fs,c as hs,d as ks,aA as bs,x as Ss}from"./vendor-D8cj1ZYg.js";import{C as U,d as F,K as Jn,D as G,c as h,I as E,a as L,J as $a,G as Se,H as B,M as un,N as he,O as vs,m as Qa,Q as Zn,P as hn,S as Oe,i as Kl,j as te,q as Pn,r as _n,v as oe,b as K,o as xl,U as Ne,L as Bn,V as Dl,e as M,t as Y,W as Tl,X as Il,Y as Cs,Z as Fs,h as In,w as Xn,T as Le,k as Z,B as da,s as ve,$ as z,a0 as Ll,E as ca,f as Hn,a1 as Oa,a2 as Ks,z as ua,u as xs,a3 as Ds,R as nl,n as Ts}from"./vendor-arizeai-BU1VHwXB.js";import{N as Is,T as Ls,L as ue,u as de,B as ws,a as on,D as As,G as Ps,b as _s,c as Es,S as Rs,R as Ke,d as Pe,e as je,f as ja,P as wl,g as Al,M as al,h as ll,i as Yn,j as Ms,k as Ns,l as Q,m as Pl,n as xe,o as ma,p as En,q as _l,r as Rn,s as Mn,t as El,v as qe,w as Ve,C as ce,x as ga,y as en,z as qa,A as Ue,E as Rl,F as Vs,H as zs,I as $s,J as Qs,K as Os,O as js,Q as ze,U as se,V as qs,W as Us,X as Ml,Y as Bs,Z as Hs,_ as tl,$ as Gs,a0 as Ws,a1 as Js,a2 as Zs,a3 as Xs,a4 as Ys,a5 as Nl,a6 as kn,a7 as eo,a8 as no,a9 as ao,aa as lo,ab as to,ac as pn,ad as Ua,ae as Vl,af as Dn,ag as _a,ah as Fn,ai as _e,aj as io,ak as ro,al as ie,am as zl,an as pa,ao as we,ap as Ba,aq as bn,ar as ne,as as Be,at as so,au as Ha,av as Re,aw as Me,ax as yn,ay as Ga,az as $l,aA as oo,aB as Ql,aC as Te,aD as $e,aE as ea,aF as co,aG as na,aH as ya,aI as Ol,aJ as jl,aK as uo,aL as ql,aM as Ul,aN as Bl,aO as Nn,aP as Je,aQ as He,aR as ke,aS as mo,aT as il,aU as Hl,aV as go,aW as po,aX as yo,aY as fo,aZ as ho,a_ as Tn,a$ as cn,b0 as Ea,b1 as Sn,b2 as Gl,b3 as ko,b4 as mn,b5 as bo,b6 as fa,b7 as So,b8 as Wa,b9 as vo,ba as Ja,bb as Wl,bc as Jl,bd as Co,be as Ra,bf as Zl,bg as Fo,bh as Ko,bi as ia,bj as xo,bk as Xl,bl as Yl,bm as Do,bn as To}from"./components-rP68rA45.js";import{R as nn,C as aa,X as an,Y as Ae,a as ln,T as tn,B as Ln,A as Gn,b as et,c as Za,L as nt,d as Io,P as Lo,e as wo,f as Ao}from"./vendor-recharts-BATX_8yP.js";import{p as Xa,R as ha,n as ka,j as Po,E as _o,k as Eo,c as Ro}from"./vendor-codemirror-BDMHmh1x.js";const at="arize-phoenix-feature-flags",Fa={playground:!1};function Mo(){const n=localStorage.getItem(at);if(!n)return Fa;try{const a=JSON.parse(n);return Object.assign({},Fa,a)}catch{return Fa}}const lt=m.createContext(null);function tt(){const n=Ce.useContext(lt);if(n===null)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return n}function No(n){const{featureFlags:a}=tt();return a[n]}function Mg(n){const[a,l]=m.useState(Mo()),t=i=>{localStorage.setItem(at,JSON.stringify(i)),l(i)};return e(lt.Provider,{value:{featureFlags:a,setFeatureFlags:t},children:e(Vo,{children:n.children})})}function Vo(n){const{children:a}=n,{featureFlags:l,setFeatureFlags:t}=tt(),[i,r]=m.useState(!1);return ss("ctrl+shift+f",()=>r(!0)),s(j,{children:[a,e(G,{type:"modal",isDismissable:!0,onDismiss:()=>r(!1),children:i&&e(U,{title:"Feature Flags",children:e(F,{height:"size-1000",padding:"size-100",children:Object.keys(l).map(o=>e(Jn,{isSelected:l[o],onChange:u=>t({...l,[o]:u}),children:o},o))})})})]})}const it=m.createContext(null);function zo(){const n=m.useContext(it);if(n===null)throw new Error("useFunctionality must be used within a FunctionalityProvider");return n}function Ng(n){return e(it.Provider,{value:{authenticationEnabled:window.Config.authenticationEnabled},children:n.children})}const $o=C`
|
|
2
2
|
display: flex;
|
|
3
3
|
direction: row;
|
|
4
4
|
height: 100vh;
|
|
@@ -1956,7 +1956,7 @@ fragment SpansTable_spans_1XEuU on Project {
|
|
|
1956
1956
|
}
|
|
1957
1957
|
id
|
|
1958
1958
|
}
|
|
1959
|
-
`}}}();Fi.hash="4827989f55b1c0bd269253b6bc977439";const Ki=function(){var n=["spans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Fi,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"SpansTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"spans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__SpansTable_spans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:t,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:t,storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},l],type:"Project",abstractKey:null}}();Ki.hash="4827989f55b1c0bd269253b6bc977439";const xi=m.createContext(null);function mu({children:n,...a}){const
|
|
1959
|
+
`}}}();Fi.hash="4827989f55b1c0bd269253b6bc977439";const Ki=function(){var n=["spans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:50,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:Fi,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"SpansTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"spans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__SpansTable_spans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"span",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,concreteType:"SpanContext",kind:"LinkedField",name:"context",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:t,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:t,storageKey:null},{alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},l],type:"Project",abstractKey:null}}();Ki.hash="4827989f55b1c0bd269253b6bc977439";const xi=m.createContext(null);function mu({children:n,...a}){const[l]=m.useState(()=>uo(a));return e(xi.Provider,{value:l,children:n})}function Xe(n,a){const l=Ce.useContext(xi);if(!l)throw new Error("Missing TracingContext.Provider in the tree");return za(l,n,a)}function Di(n){const{appendFilterCondition:a}=Ci(),{annotation:l}=n,{name:t,label:i,score:r}=l,o=m.useMemo(()=>{const u=[];return i!=null&&(u.push({filterName:"Match label",filterCondition:`annotations['${t}'].label == "${i}"`}),u.push({filterName:"Exclude label",filterCondition:`annotations['${t}'].label != "${i}"`})),typeof r=="number"&&(u.push({filterName:"Greater than score",filterCondition:`annotations['${t}'].score > ${r}`}),u.push({filterName:"Less than score",filterCondition:`annotations['${t}'].score < ${r}`}),u.push({filterName:"Equals score",filterCondition:`annotations['${t}'].score == ${r}`})),u},[t,i,r]);return s(F,{borderStartWidth:"thin",borderColor:"dark",paddingStart:"size-200",paddingEnd:"size-100",marginStart:"size-200",width:300,children:[e(K,{textSize:"large",weight:"heavy",children:"Filters"}),e("ul",{css:C`
|
|
1960
1960
|
display: flex;
|
|
1961
1961
|
flex-direction: row;
|
|
1962
1962
|
gap: var(--ac-global-dimension-size-100);
|
|
@@ -2087,7 +2087,7 @@ fragment DatasetSelectorPopoverContent_datasets on Query {
|
|
|
2087
2087
|
`}};Ni.hash="7cd8a13144d97d2b5294f2a09c9e1351";function Cu(n){const{onCreateNewDataset:a,onDatasetSelected:l}=n,[t,i]=m.useState(""),r=T.useLazyLoadQuery(Ni,{},{fetchPolicy:"network-only"});return s(z,{title:"Add to Dataset",variant:"compact",backgroundColor:"light",borderColor:"light",bodyStyle:{padding:0},extra:e(M,{variant:"default",size:"compact",onClick:a,children:"New Dataset"}),children:[e(F,{padding:"size-100",children:e(Z,{type:"search",placeholder:"Search datasets",addonBefore:e(E,{svg:e(L.Search,{})}),onChange:o=>{i(o)}})}),e(F,{borderTopWidth:"thin",borderColor:"light",children:e("div",{css:C`
|
|
2088
2088
|
height: 400px;
|
|
2089
2089
|
overflow-y: auto;
|
|
2090
|
-
`,children:e(Fu,{query:r,search:t,onDatasetSelected:l})})})]})}function Fu(n){const{search:a,onDatasetSelected:l}=n,[t]=T.useRefetchableFragment(Mi,n.query),i=m.useMemo(()=>{let o=t.datasets.edges.map(u=>u.dataset);return a&&(o=o.filter(u=>u.name.toLowerCase().includes(a.toLowerCase()))),o},[a,t]);return i.length===0?e(h,{direction:"column",justifyContent:"center",alignItems:"center",flex:"1 1 auto",children:e(K,{children:"No datasets found"})}):e(Zn,{selectionMode:"single",onSelectionChange:o=>{if(typeof o=="object"){const u=Array.from(o);l(u[0])}},children:i.map(o=>e(W,{children:o.name},o.id))})}function Vi(n){const a=ee(),[l,t]=m.useState(null),i=ie(),r=de(),[o,u]=m.useState(!1),{selectedSpans:d,onClearSelection:p}=n,[f,c]=T.useMutation(Ei),g=d.length!==1,y=m.useCallback(k=>{f({variables:{input:{datasetId:k,spanIds:d.map(b=>b.id)}},onCompleted:()=>{i({title:"Examples added to dataset",message:`${d.length} example${g?"s":""} have been added to the dataset.`,action:{text:"View dataset",onClick:()=>{a(`/datasets/${k}/examples`)}}}),p()},onError:b=>{r({title:"An error occurred",message:`Failed to add spans to dataset: ${b.message}`})}})},[f,d,i,g,p,a,r]);return s("div",{css:C`
|
|
2090
|
+
`,children:e(Fu,{query:r,search:t,onDatasetSelected:l})})})]})}function Fu(n){const{search:a,onDatasetSelected:l}=n,[t]=T.useRefetchableFragment(Mi,n.query),i=m.useMemo(()=>{let o=t.datasets.edges.map(u=>u.dataset);return a&&(o=o.filter(u=>u.name.toLowerCase().includes(a.toLowerCase()))),o},[a,t]);return i.length===0?e(F,{padding:"size-200",children:e(h,{direction:"column",justifyContent:"center",alignItems:"center",flex:"1 1 auto",children:e(K,{children:"No datasets found"})})}):e(Zn,{selectionMode:"single",onSelectionChange:o=>{if(typeof o=="object"){const u=Array.from(o);l(u[0])}},children:i.map(o=>e(W,{children:o.name},o.id))})}function Vi(n){const a=ee(),[l,t]=m.useState(null),i=ie(),r=de(),[o,u]=m.useState(!1),{selectedSpans:d,onClearSelection:p}=n,[f,c]=T.useMutation(Ei),g=d.length!==1,y=m.useCallback(k=>{f({variables:{input:{datasetId:k,spanIds:d.map(b=>b.id)}},onCompleted:()=>{i({title:"Examples added to dataset",message:`${d.length} example${g?"s":""} have been added to the dataset.`,action:{text:"View dataset",onClick:()=>{a(`/datasets/${k}/examples`)}}}),p()},onError:b=>{r({title:"An error occurred",message:`Failed to add spans to dataset: ${b.message}`})}})},[f,d,i,g,p,a,r]);return s("div",{css:C`
|
|
2091
2091
|
position: absolute;
|
|
2092
2092
|
bottom: var(--ac-global-dimension-size-400);
|
|
2093
2093
|
left: 50%;
|
|
@@ -2541,7 +2541,7 @@ fragment DatasetsTable_datasets_dWkdd on Query {
|
|
|
2541
2541
|
}
|
|
2542
2542
|
}
|
|
2543
2543
|
}
|
|
2544
|
-
`}}}();sr.hash="a1349b92d8b0c745f5e8039c55b048c7";const em=n=>{const a=(l,t)=>({...n,isRefreshingLatestVersion:!1,refreshLatestVersion:async()=>{const i=t();l({isRefreshingLatestVersion:!0});const r=await nm({datasetId:i.datasetId});l({latestVersion:r,isRefreshingLatestVersion:!1})}});return hs()(ks(a))};async function nm({datasetId:n}){var i;const a=await T.fetchQuery(Ke,sr,{datasetId:n}).toPromise(),l=(i=a==null?void 0:a.dataset.latestVersions)==null?void 0:i.edges;return l&&l.length&&l[0].version||null}const or=m.createContext(null);function am({children:n,...a}){const
|
|
2544
|
+
`}}}();sr.hash="a1349b92d8b0c745f5e8039c55b048c7";const em=n=>{const a=(l,t)=>({...n,isRefreshingLatestVersion:!1,refreshLatestVersion:async()=>{const i=t();l({isRefreshingLatestVersion:!0});const r=await nm({datasetId:i.datasetId});l({latestVersion:r,isRefreshingLatestVersion:!1})}});return hs()(ks(a))};async function nm({datasetId:n}){var i;const a=await T.fetchQuery(Ke,sr,{datasetId:n}).toPromise(),l=(i=a==null?void 0:a.dataset.latestVersions)==null?void 0:i.edges;return l&&l.length&&l[0].version||null}const or=m.createContext(null);function am({children:n,...a}){const[l]=m.useState(()=>em(a));return e(or.Provider,{value:l,children:n})}function fn(n,a){const l=m.useContext(or);if(!l)throw new Error("Missing DatasetContext.Provider in the tree");return za(l,n,a)}const dr=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"input"}],a=[{alias:null,args:[{kind:"Variable",name:"input",variableName:"input"}],concreteType:"DatasetMutationPayload",kind:"LinkedField",name:"addExamplesToDataset",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"AddDatasetExampleDialogMutation",selections:a,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"AddDatasetExampleDialogMutation",selections:a},params:{cacheID:"718cf02ccb39b279132822bf503e51e6",id:null,metadata:{},name:"AddDatasetExampleDialogMutation",operationKind:"mutation",text:`mutation AddDatasetExampleDialogMutation(
|
|
2545
2545
|
$input: AddExamplesToDatasetInput!
|
|
2546
2546
|
) {
|
|
2547
2547
|
addExamplesToDataset(input: $input) {
|
|
@@ -3071,7 +3071,7 @@ fragment ExperimentsTableFragment_2HEEH6 on Dataset {
|
|
|
3071
3071
|
margin-left: auto;
|
|
3072
3072
|
margin-right: auto;
|
|
3073
3073
|
}
|
|
3074
|
-
`,children:["No experiments for this dataset. To see how to run experiments on a dataset, check out the documentation.",e(gr,{})]})})})}function Am({dataset:n}){const a=m.useRef(null),[l,t]=m.useState({}),{data:i,loadNext:r,hasNext:o,isLoadingNext:u,refetch:d}=T.usePaginationFragment(Dr,n),p=m.useMemo(()=>i.experiments.edges.map(x=>{const D=x.experiment.annotationSummaries.reduce((R,_)=>(R[_.annotationName]=_,R),{});return{...x.experiment,annotationSummaryMap:D}}),[i]),f=[{id:"select",header:({table:x})=>e(Je,{checked:x.getIsAllRowsSelected(),indeterminate:x.getIsSomeRowsSelected(),onChange:x.getToggleAllRowsSelectedHandler()}),cell:({row:x})=>e(Je,{checked:x.getIsSelected(),disabled:!x.getCanSelect(),indeterminate:x.getIsSomeSelected(),onChange:x.getToggleSelectedHandler()})},{header:"name",accessorKey:"name",minSize:200,cell:({getValue:x,row:D})=>{const R=D.original.id,_=D.original.sequenceNumber;return s(h,{direction:"row",gap:"size-100",children:[e(fa,{sequenceNumber:_}),e(He,{to:`/datasets/${n.id}/compare?experimentId=${R}`,children:x()})]})}},{header:"description",accessorKey:"description",minSize:300,cell:se},{header:"created at",accessorKey:"createdAt",cell:ke}],c=i.experimentAnnotationSummaries.map(x=>{const{annotationName:D,minScore:R,maxScore:_}=x;return{header:()=>s(h,{direction:"row",gap:"size-100",wrap:!0,alignItems:"center",justifyContent:"end",children:[e(K,{children:D}),e(bo,{annotationName:D})]}),id:`annotation-${D}`,meta:{textAlign:"right"},cell:({row:O})=>{const X=O.original.annotationSummaryMap[D];return!X||X.meanScore==null?e("span",{css:C`
|
|
3074
|
+
`,children:["No experiments for this dataset. To see how to run experiments on a dataset, check out the documentation.",e(gr,{})]})})})}function Am({dataset:n}){const a=m.useRef(null),[l,t]=m.useState({}),{data:i,loadNext:r,hasNext:o,isLoadingNext:u,refetch:d}=T.usePaginationFragment(Dr,n),p=m.useMemo(()=>i.experiments.edges.map(x=>{const D=x.experiment.annotationSummaries.reduce((R,_)=>(R[_.annotationName]=_,R),{});return{...x.experiment,annotationSummaryMap:D}}),[i.experiments.edges]),f=[{id:"select",header:({table:x})=>e(Je,{checked:x.getIsAllRowsSelected(),indeterminate:x.getIsSomeRowsSelected(),onChange:x.getToggleAllRowsSelectedHandler()}),cell:({row:x})=>e(Je,{checked:x.getIsSelected(),disabled:!x.getCanSelect(),indeterminate:x.getIsSomeSelected(),onChange:x.getToggleSelectedHandler()})},{header:"name",accessorKey:"name",minSize:200,cell:({getValue:x,row:D})=>{const R=D.original.id,_=D.original.sequenceNumber;return s(h,{direction:"row",gap:"size-100",children:[e(fa,{sequenceNumber:_}),e(He,{to:`/datasets/${n.id}/compare?experimentId=${R}`,children:x()})]})}},{header:"description",accessorKey:"description",minSize:300,cell:se},{header:"created at",accessorKey:"createdAt",cell:ke}],c=i.experimentAnnotationSummaries.map(x=>{const{annotationName:D,minScore:R,maxScore:_}=x;return{header:()=>s(h,{direction:"row",gap:"size-100",wrap:!0,alignItems:"center",justifyContent:"end",children:[e(K,{children:D}),e(bo,{annotationName:D})]}),id:`annotation-${D}`,meta:{textAlign:"right"},cell:({row:O})=>{const X=O.original.annotationSummaryMap[D];return!X||X.meanScore==null?e("span",{css:C`
|
|
3075
3075
|
float: right;
|
|
3076
3076
|
`,children:"--"}):e(Pm,{annotationName:D,value:X.meanScore,min:R,max:_})}}}),g=[{header:"run count",accessorKey:"runCount",meta:{textAlign:"right"},cell:So},{header:"avg latency",accessorKey:"averageRunLatencyMs",meta:{textAlign:"right"},cell:({getValue:x})=>{const D=x();return D===null||typeof D!="number"?"--":e(we,{latencyMs:D})}},{header:"error rate",accessorKey:"errorRate",meta:{textAlign:"right"},cell:Tm},{header:"metadata",accessorKey:"metadata",minSize:200,cell:Tn},{id:"actions",cell:({row:x})=>{const D=x.original.project,R=x.original.metadata;return e(_m,{projectId:(D==null?void 0:D.id)||null,experimentId:x.original.id,metadata:R})}}],y=me({columns:[...f,...c,...g],data:p,getCoreRowModel:ge(),state:{rowSelection:l},onRowSelectionChange:t}),k=y.getRowModel().rows,b=y.getSelectedRowModel().rows,v=b.map(x=>x.original),S=m.useCallback(()=>{t({})},[t]),w=k.length===0,I=m.useCallback(x=>{if(x){const{scrollHeight:D,scrollTop:R,clientHeight:_}=x;D-R-_<300&&!u&&o&&r(Lm)}},[o,u,r]),P=ee();return s("div",{css:C`
|
|
3077
3077
|
flex: 1 1 auto;
|
|
@@ -3671,7 +3671,7 @@ fragment APIKeysTableFragment on User {
|
|
|
3671
3671
|
width: 100%;
|
|
3672
3672
|
margin-left: auto;
|
|
3673
3673
|
margin-right: auto;
|
|
3674
|
-
`;function fp(){const{viewer:n}=Yl();return n?e("main",{css:vg,children:e("div",{css:Cg,children:s(h,{direction:"column",gap:"size-200",children:[e(Sg,{}),e(bg,{viewer:n})]})})}):null}const is=m.createContext(null);function Fg({children:n,...a}){const
|
|
3674
|
+
`;function fp(){const{viewer:n}=Yl();return n?e("main",{css:vg,children:e("div",{css:Cg,children:s(h,{direction:"column",gap:"size-200",children:[e(Sg,{}),e(bg,{viewer:n})]})})}):null}const is=m.createContext(null);function Fg({children:n,...a}){const[l]=m.useState(()=>Do(a));return e(is.Provider,{value:l,children:n})}function Na(n,a){const l=Ce.useContext(is);if(!l)throw new Error("Missing PlaygroundContext.Provider in the tree");return za(l,n,a)}function Kg(){return e(z,{title:"Input",collapsible:!0,variant:"compact",children:"Input goes here"})}function xg(n){return n==="chat"||n==="text_completion"}function Dg(){const n=Na(l=>l.operationType),a=Na(l=>l.setOperationType);return s(Ts,{value:n,variant:"inline-button",onChange:l=>{xg(l)&&a(l)},children:[e(nl,{label:"Chat",value:"chat",children:"Chat"}),e(nl,{label:"Completion",value:"text_completion",children:"Completion"})]})}function Tg(){return e(z,{title:"Output",collapsible:!0,variant:"compact",children:"Output goes here"})}function Ig(){const n=Na(a=>a.operationType);return e(z,{title:"Template",collapsible:!0,variant:"compact",children:n==="chat"?e("div",{children:"Chat Template goes here"}):e("div",{children:"Completion Template goes here"})})}function Lg(){return e(z,{title:"Tools",collapsible:!0,variant:"compact",children:"Tools go here"})}const Cl=C`
|
|
3675
3675
|
padding: var(--ac-global-dimension-size-200);
|
|
3676
3676
|
overflow: auto;
|
|
3677
3677
|
display: flex;
|