arize-phoenix 10.11.0__py3-none-any.whl → 10.12.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of arize-phoenix might be problematic. Click here for more details.
- {arize_phoenix-10.11.0.dist-info → arize_phoenix-10.12.0.dist-info}/METADATA +1 -1
- {arize_phoenix-10.11.0.dist-info → arize_phoenix-10.12.0.dist-info}/RECORD +14 -14
- phoenix/server/api/helpers/playground_clients.py +0 -1
- phoenix/server/api/routers/v1/spans.py +164 -3
- phoenix/server/api/types/Project.py +19 -0
- phoenix/server/static/.vite/manifest.json +9 -9
- phoenix/server/static/assets/{components-DGavuwFF.js → components-CKFZdR5A.js} +1 -1
- phoenix/server/static/assets/{index-DNmPxkEL.js → index-D3uXREcK.js} +1 -1
- phoenix/server/static/assets/{pages-Bns7xROJ.js → pages-BEpY_9Jm.js} +11 -10
- phoenix/version.py +1 -1
- {arize_phoenix-10.11.0.dist-info → arize_phoenix-10.12.0.dist-info}/WHEEL +0 -0
- {arize_phoenix-10.11.0.dist-info → arize_phoenix-10.12.0.dist-info}/entry_points.txt +0 -0
- {arize_phoenix-10.11.0.dist-info → arize_phoenix-10.12.0.dist-info}/licenses/IP_NOTICE +0 -0
- {arize_phoenix-10.11.0.dist-info → arize_phoenix-10.12.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -6,7 +6,7 @@ phoenix/exceptions.py,sha256=n2L2KKuecrdflB9MsCdAYCiSEvGJptIsfRkXMoJle7A,169
|
|
|
6
6
|
phoenix/py.typed,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
7
7
|
phoenix/services.py,sha256=ngkyKGVatX3cO2WJdo2hKdaVKP-xJCMvqthvga6kJss,5196
|
|
8
8
|
phoenix/settings.py,sha256=x87BX7hWGQQZbrW_vrYqFR_izCGfO9gFc--JXUG4Tdk,754
|
|
9
|
-
phoenix/version.py,sha256=
|
|
9
|
+
phoenix/version.py,sha256=pBrSaHNsQ4T1_xrksWp-HQLyHewcLal4iOxu8yfGX7M,24
|
|
10
10
|
phoenix/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
phoenix/core/embedding_dimension.py,sha256=zKGbcvwOXgLf-yrJBpQyKtd-LEOPRKHnUToyAU8Owis,87
|
|
12
12
|
phoenix/core/model.py,sha256=qBFraOtmwCCnWJltKNP18DDG0mULXigytlFsa6YOz6k,4837
|
|
@@ -158,7 +158,7 @@ phoenix/server/api/helpers/__init__.py,sha256=m2-xaSPqUiSs91k62JaRDjFNfl-1byxBfY
|
|
|
158
158
|
phoenix/server/api/helpers/annotations.py,sha256=9gMXKpMTfWEChoSCnvdWYuyB0hlSnNOp-qUdar9Vono,262
|
|
159
159
|
phoenix/server/api/helpers/dataset_helpers.py,sha256=DoMBTg-qXTnC_K4Evx1WKpCCYgRbITpVqyY-8efJRf0,8984
|
|
160
160
|
phoenix/server/api/helpers/experiment_run_filters.py,sha256=DOnVwrmn39eAkk2mwuZP8kIcAnR5jrOgllEwWSjsw94,29893
|
|
161
|
-
phoenix/server/api/helpers/playground_clients.py,sha256=
|
|
161
|
+
phoenix/server/api/helpers/playground_clients.py,sha256=laFDXVnj-n5-nze5OeJSLT5nwdz2IWFTVccKNcLqK7U,47932
|
|
162
162
|
phoenix/server/api/helpers/playground_registry.py,sha256=CPLMziFB2wmr-dfbx7VbzO2f8YIG_k5RftzvGXYGQ1w,2570
|
|
163
163
|
phoenix/server/api/helpers/playground_spans.py,sha256=QpXwPl_fFNwm_iA1A77XApUyXMl1aDmonw8aXuNZ_4k,17132
|
|
164
164
|
phoenix/server/api/helpers/prompts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -242,7 +242,7 @@ phoenix/server/api/routers/v1/experiments.py,sha256=V9_sxqLTE1MKGFu9H3FEdGKr70lY
|
|
|
242
242
|
phoenix/server/api/routers/v1/models.py,sha256=p3gJN-9SWiUYTUTft4bZMsZVCBNTb4nN1Foy68eRZzQ,1997
|
|
243
243
|
phoenix/server/api/routers/v1/projects.py,sha256=LFWxHYPRZy-1EvroNylL635vU1UuDbcuRo1oD26yBnw,12551
|
|
244
244
|
phoenix/server/api/routers/v1/prompts.py,sha256=aBOUBwLDzZDIzJQkxJcR8ZKnakNJOLMwzsLKINSs1mA,26545
|
|
245
|
-
phoenix/server/api/routers/v1/spans.py,sha256=
|
|
245
|
+
phoenix/server/api/routers/v1/spans.py,sha256=HhZtXsNTdOmMXWtMkz3VUb3aqpGsVAU5XOYi2KfvGMc,44106
|
|
246
246
|
phoenix/server/api/routers/v1/traces.py,sha256=DfzeszQvtlrVxvurJLaWJJAhkCZ4BodLwpFuBYPwN5Q,8206
|
|
247
247
|
phoenix/server/api/routers/v1/users.py,sha256=ZcW3if0L8-lUusTzET7fhlhvnmiCICDrGimzB7i3irc,11947
|
|
248
248
|
phoenix/server/api/routers/v1/utils.py,sha256=oXIOGPzPTkE0ZWUTRCoRIQQ7wTzoSwtWFaUSjlGBqts,4960
|
|
@@ -295,7 +295,7 @@ phoenix/server/api/types/MimeType.py,sha256=Zpi6zCalkSFgsvhzvOs-O1gYA04usAi9H__Q
|
|
|
295
295
|
phoenix/server/api/types/Model.py,sha256=8UIFqMe1q-2ufBNg-gxHusV8wM1h-KbfLUeJjyVcMvQ,8081
|
|
296
296
|
phoenix/server/api/types/NumericRange.py,sha256=afEjgF97Go_OvmjMggbPBt-zGM8IONewAyEiKEHRds0,192
|
|
297
297
|
phoenix/server/api/types/PerformanceMetric.py,sha256=KFkmJDqP43eDUtARQOUqR7NYcxvL6Vh2uisHWU6H3ko,387
|
|
298
|
-
phoenix/server/api/types/Project.py,sha256=
|
|
298
|
+
phoenix/server/api/types/Project.py,sha256=FulRsgTWcvZEyiV3lzJ505HMa9Eq7aoQr3OkbPWH2Ws,29864
|
|
299
299
|
phoenix/server/api/types/ProjectSession.py,sha256=fyfVtpUpFOTnBx8DFnH3dr7WXAssN0ooAgrQSSi7kEI,4677
|
|
300
300
|
phoenix/server/api/types/ProjectTraceRetentionPolicy.py,sha256=tYy2kgalPDyuaYZr0VUHjH0YpXaiF_QOzg5yfaV_c7c,3782
|
|
301
301
|
phoenix/server/api/types/Prompt.py,sha256=ccP4eq1e38xbF0afclGWLOuDpBVpNbJ3AOSRClF8yFQ,4955
|
|
@@ -350,10 +350,10 @@ phoenix/server/static/apple-touch-icon-76x76.png,sha256=CT_xT12I0u2i0WU8JzBZBuOQ
|
|
|
350
350
|
phoenix/server/static/apple-touch-icon.png,sha256=fOfpjqGpWYbJ0eAurKsyoZP1EAs6ZVooBJ_SGk2ZkDs,3801
|
|
351
351
|
phoenix/server/static/favicon.ico,sha256=bY0vvCKRftemZfPShwZtE93DiiQdaYaozkPGwNFr6H8,34494
|
|
352
352
|
phoenix/server/static/modernizr.js,sha256=mvK-XtkNqjOral-QvzoqsyOMECXIMu5BQwSVN_wcU9c,2564
|
|
353
|
-
phoenix/server/static/.vite/manifest.json,sha256=
|
|
354
|
-
phoenix/server/static/assets/components-
|
|
355
|
-
phoenix/server/static/assets/index-
|
|
356
|
-
phoenix/server/static/assets/pages-
|
|
353
|
+
phoenix/server/static/.vite/manifest.json,sha256=Y9B-iAYwgBxlFRmn9uT4BxZ3nISaTwSMJJiISSAYh8s,2165
|
|
354
|
+
phoenix/server/static/assets/components-CKFZdR5A.js,sha256=AOSKJmIJf-eGIIvuvZNIevW5CcPmHrbMAqtci-tbNYE,565838
|
|
355
|
+
phoenix/server/static/assets/index-D3uXREcK.js,sha256=vwzEn-uC6iBPUZ_gE2H8CCvcm2YLKQmO9mX1f6MuagQ,61125
|
|
356
|
+
phoenix/server/static/assets/pages-BEpY_9Jm.js,sha256=9uRMswtZ_NAVOR7Q6-zrg0DDtN7rljEmqO7VdAMpQMg,1054967
|
|
357
357
|
phoenix/server/static/assets/vendor-ARQZvmz5.js,sha256=U_VQSuHOpuX7DxntJS2ckfxW2a4hV-E3MCqeJSxwdCY,2735976
|
|
358
358
|
phoenix/server/static/assets/vendor-WIZid84E.css,sha256=spZD2r7XL5GfLO13ln-IuXfnjAref8l6g_n_AvxxOlI,5517
|
|
359
359
|
phoenix/server/static/assets/vendor-arizeai-Ct6kvW4e.js,sha256=n_v4BAgm9-OaJMlQTf0OtLfPmPBdagnu85gVuds43sM,181771
|
|
@@ -400,9 +400,9 @@ phoenix/utilities/project.py,sha256=auVpARXkDb-JgeX5f2aStyFIkeKvGwN9l7qrFeJMVxI,
|
|
|
400
400
|
phoenix/utilities/re.py,sha256=6YyUWIkv0zc2SigsxfOWIHzdpjKA_TZo2iqKq7zJKvw,2081
|
|
401
401
|
phoenix/utilities/span_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
402
402
|
phoenix/utilities/template_formatters.py,sha256=gh9PJD6WEGw7TEYXfSst1UR4pWWwmjxMLrDVQ_CkpkQ,2779
|
|
403
|
-
arize_phoenix-10.
|
|
404
|
-
arize_phoenix-10.
|
|
405
|
-
arize_phoenix-10.
|
|
406
|
-
arize_phoenix-10.
|
|
407
|
-
arize_phoenix-10.
|
|
408
|
-
arize_phoenix-10.
|
|
403
|
+
arize_phoenix-10.12.0.dist-info/METADATA,sha256=B2JAKsJ0YoxMzZ5_4AeWU8DW0UScmfnOXNnR3trLnwg,27006
|
|
404
|
+
arize_phoenix-10.12.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
405
|
+
arize_phoenix-10.12.0.dist-info/entry_points.txt,sha256=Pgpn8Upxx9P8z8joPXZWl2LlnAlGc3gcQoVchb06X1Q,94
|
|
406
|
+
arize_phoenix-10.12.0.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
|
|
407
|
+
arize_phoenix-10.12.0.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
|
|
408
|
+
arize_phoenix-10.12.0.dist-info/RECORD,,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import json
|
|
1
2
|
import warnings
|
|
2
3
|
from asyncio import get_running_loop
|
|
3
4
|
from collections.abc import AsyncIterator
|
|
@@ -12,7 +13,12 @@ from pydantic import BaseModel, Field
|
|
|
12
13
|
from sqlalchemy import select
|
|
13
14
|
from starlette.requests import Request
|
|
14
15
|
from starlette.responses import Response, StreamingResponse
|
|
15
|
-
from starlette.status import
|
|
16
|
+
from starlette.status import (
|
|
17
|
+
HTTP_202_ACCEPTED,
|
|
18
|
+
HTTP_400_BAD_REQUEST,
|
|
19
|
+
HTTP_404_NOT_FOUND,
|
|
20
|
+
HTTP_422_UNPROCESSABLE_ENTITY,
|
|
21
|
+
)
|
|
16
22
|
from strawberry.relay import GlobalID
|
|
17
23
|
|
|
18
24
|
from phoenix.config import DEFAULT_PROJECT_NAME
|
|
@@ -26,6 +32,19 @@ from phoenix.server.bearer_auth import PhoenixUser
|
|
|
26
32
|
from phoenix.server.dml_event import SpanAnnotationInsertEvent
|
|
27
33
|
from phoenix.trace.attributes import flatten
|
|
28
34
|
from phoenix.trace.dsl import SpanQuery as SpanQuery_
|
|
35
|
+
from phoenix.trace.schemas import (
|
|
36
|
+
Span as SpanForInsertion,
|
|
37
|
+
)
|
|
38
|
+
from phoenix.trace.schemas import (
|
|
39
|
+
SpanContext as InsertionSpanContext,
|
|
40
|
+
)
|
|
41
|
+
from phoenix.trace.schemas import (
|
|
42
|
+
SpanEvent as InternalSpanEvent,
|
|
43
|
+
)
|
|
44
|
+
from phoenix.trace.schemas import (
|
|
45
|
+
SpanKind,
|
|
46
|
+
SpanStatusCode,
|
|
47
|
+
)
|
|
29
48
|
from phoenix.utilities.json import encode_df_as_json_string
|
|
30
49
|
|
|
31
50
|
from .models import V1RoutesBaseModel
|
|
@@ -393,7 +412,9 @@ class SpanEvent(V1RoutesBaseModel):
|
|
|
393
412
|
|
|
394
413
|
|
|
395
414
|
class Span(V1RoutesBaseModel):
|
|
396
|
-
id: str = Field(
|
|
415
|
+
id: str = Field(
|
|
416
|
+
default="", description="Span Global ID, distinct from the OpenTelemetry span ID"
|
|
417
|
+
)
|
|
397
418
|
name: str = Field(description="Name of the span operation")
|
|
398
419
|
context: SpanContext = Field(description="Span context containing trace_id and span_id")
|
|
399
420
|
span_kind: str = Field(description="Type of work that the span encapsulates")
|
|
@@ -440,7 +461,7 @@ async def query_spans_handler(
|
|
|
440
461
|
)
|
|
441
462
|
end_time = request_body.end_time or request_body.stop_time
|
|
442
463
|
try:
|
|
443
|
-
span_queries = [SpanQuery_.from_dict(query.
|
|
464
|
+
span_queries = [SpanQuery_.from_dict(query.model_dump()) for query in queries]
|
|
444
465
|
except Exception as e:
|
|
445
466
|
raise HTTPException(
|
|
446
467
|
detail=f"Invalid query: {e}",
|
|
@@ -956,3 +977,143 @@ async def annotate_spans(
|
|
|
956
977
|
for id_ in inserted_ids
|
|
957
978
|
]
|
|
958
979
|
)
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
class CreateSpansRequestBody(RequestBody[list[Span]]):
|
|
983
|
+
data: list[Span]
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
class CreateSpansResponseBody(V1RoutesBaseModel):
|
|
987
|
+
total_received: int = Field(description="Total number of spans received")
|
|
988
|
+
total_queued: int = Field(description="Number of spans successfully queued for insertion")
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
@router.post(
|
|
992
|
+
"/projects/{project_identifier}/spans",
|
|
993
|
+
operation_id="createSpans",
|
|
994
|
+
summary="Create spans",
|
|
995
|
+
description=(
|
|
996
|
+
"Submit spans to be inserted into a project. If any spans are invalid or "
|
|
997
|
+
"duplicates, no spans will be inserted."
|
|
998
|
+
),
|
|
999
|
+
responses=add_errors_to_responses([HTTP_404_NOT_FOUND, HTTP_400_BAD_REQUEST]),
|
|
1000
|
+
status_code=HTTP_202_ACCEPTED,
|
|
1001
|
+
)
|
|
1002
|
+
async def create_spans(
|
|
1003
|
+
request: Request,
|
|
1004
|
+
request_body: CreateSpansRequestBody,
|
|
1005
|
+
project_identifier: str = Path(
|
|
1006
|
+
description=(
|
|
1007
|
+
"The project identifier: either project ID or project name. If using a project name, "
|
|
1008
|
+
"it cannot contain slash (/), question mark (?), or pound sign (#) characters."
|
|
1009
|
+
)
|
|
1010
|
+
),
|
|
1011
|
+
) -> CreateSpansResponseBody:
|
|
1012
|
+
def convert_api_span_for_insertion(api_span: Span) -> SpanForInsertion:
|
|
1013
|
+
"""
|
|
1014
|
+
Convert from API Span to phoenix.trace.schemas.Span
|
|
1015
|
+
Note: The 'id' field has a default empty string and is ignored during insertion.
|
|
1016
|
+
"""
|
|
1017
|
+
try:
|
|
1018
|
+
span_kind = SpanKind(api_span.span_kind.upper())
|
|
1019
|
+
except ValueError:
|
|
1020
|
+
span_kind = SpanKind.UNKNOWN
|
|
1021
|
+
|
|
1022
|
+
try:
|
|
1023
|
+
status_code = SpanStatusCode(api_span.status_code.upper())
|
|
1024
|
+
except ValueError:
|
|
1025
|
+
status_code = SpanStatusCode.UNSET
|
|
1026
|
+
|
|
1027
|
+
internal_events: list[InternalSpanEvent] = []
|
|
1028
|
+
for event in api_span.events:
|
|
1029
|
+
if event.timestamp:
|
|
1030
|
+
internal_events.append(
|
|
1031
|
+
InternalSpanEvent(
|
|
1032
|
+
name=event.name, timestamp=event.timestamp, attributes=event.attributes
|
|
1033
|
+
)
|
|
1034
|
+
)
|
|
1035
|
+
|
|
1036
|
+
# Add back the openinference.span.kind attribute since it's stored separately in the API
|
|
1037
|
+
attributes = dict(api_span.attributes)
|
|
1038
|
+
attributes["openinference.span.kind"] = api_span.span_kind
|
|
1039
|
+
|
|
1040
|
+
# Create span for insertion - note we ignore the 'id' field as it's server-generated
|
|
1041
|
+
return SpanForInsertion(
|
|
1042
|
+
name=api_span.name,
|
|
1043
|
+
context=InsertionSpanContext(
|
|
1044
|
+
trace_id=api_span.context.trace_id, span_id=api_span.context.span_id
|
|
1045
|
+
),
|
|
1046
|
+
span_kind=span_kind,
|
|
1047
|
+
parent_id=api_span.parent_id,
|
|
1048
|
+
start_time=api_span.start_time,
|
|
1049
|
+
end_time=api_span.end_time,
|
|
1050
|
+
status_code=status_code,
|
|
1051
|
+
status_message=api_span.status_message,
|
|
1052
|
+
attributes=attributes,
|
|
1053
|
+
events=internal_events,
|
|
1054
|
+
conversation=None, # Unused
|
|
1055
|
+
)
|
|
1056
|
+
|
|
1057
|
+
async with request.app.state.db() as session:
|
|
1058
|
+
project = await _get_project_by_identifier(session, project_identifier)
|
|
1059
|
+
|
|
1060
|
+
total_received = len(request_body.data)
|
|
1061
|
+
duplicate_spans: list[dict[str, str]] = []
|
|
1062
|
+
invalid_spans: list[dict[str, str]] = []
|
|
1063
|
+
spans_to_queue: list[tuple[SpanForInsertion, str]] = []
|
|
1064
|
+
|
|
1065
|
+
existing_span_ids: set[str] = set()
|
|
1066
|
+
span_ids = [span.context.span_id for span in request_body.data]
|
|
1067
|
+
async with request.app.state.db() as session:
|
|
1068
|
+
existing_result = await session.execute(
|
|
1069
|
+
select(models.Span.span_id).where(models.Span.span_id.in_(span_ids))
|
|
1070
|
+
)
|
|
1071
|
+
existing_span_ids = {row[0] for row in existing_result}
|
|
1072
|
+
|
|
1073
|
+
for api_span in request_body.data:
|
|
1074
|
+
# Check if it's a duplicate
|
|
1075
|
+
if api_span.context.span_id in existing_span_ids:
|
|
1076
|
+
duplicate_spans.append(
|
|
1077
|
+
{
|
|
1078
|
+
"span_id": api_span.context.span_id,
|
|
1079
|
+
"trace_id": api_span.context.trace_id,
|
|
1080
|
+
}
|
|
1081
|
+
)
|
|
1082
|
+
continue
|
|
1083
|
+
|
|
1084
|
+
try:
|
|
1085
|
+
span_for_insertion = convert_api_span_for_insertion(api_span)
|
|
1086
|
+
spans_to_queue.append((span_for_insertion, project.name))
|
|
1087
|
+
except Exception as e:
|
|
1088
|
+
invalid_spans.append(
|
|
1089
|
+
{
|
|
1090
|
+
"span_id": api_span.context.span_id,
|
|
1091
|
+
"trace_id": api_span.context.trace_id,
|
|
1092
|
+
"error": str(e),
|
|
1093
|
+
}
|
|
1094
|
+
)
|
|
1095
|
+
|
|
1096
|
+
# If there are any duplicates or invalid spans, reject the entire request
|
|
1097
|
+
if duplicate_spans or invalid_spans:
|
|
1098
|
+
error_detail = {
|
|
1099
|
+
"error": "Request contains invalid or duplicate spans",
|
|
1100
|
+
"total_received": total_received,
|
|
1101
|
+
"total_queued": 0, # No spans are queued when there are validation errors
|
|
1102
|
+
"total_duplicates": len(duplicate_spans),
|
|
1103
|
+
"total_invalid": len(invalid_spans),
|
|
1104
|
+
"duplicate_spans": duplicate_spans,
|
|
1105
|
+
"invalid_spans": invalid_spans,
|
|
1106
|
+
}
|
|
1107
|
+
raise HTTPException(
|
|
1108
|
+
status_code=HTTP_400_BAD_REQUEST,
|
|
1109
|
+
detail=json.dumps(error_detail),
|
|
1110
|
+
)
|
|
1111
|
+
|
|
1112
|
+
# All spans are valid, queue them all
|
|
1113
|
+
for span_for_insertion, project_name in spans_to_queue:
|
|
1114
|
+
await request.state.queue_span_for_bulk_insert(span_for_insertion, project_name)
|
|
1115
|
+
|
|
1116
|
+
return CreateSpansResponseBody(
|
|
1117
|
+
total_received=total_received,
|
|
1118
|
+
total_queued=len(spans_to_queue),
|
|
1119
|
+
)
|
|
@@ -326,8 +326,27 @@ class Project(Node):
|
|
|
326
326
|
after: Optional[CursorString] = UNSET,
|
|
327
327
|
sort: Optional[ProjectSessionSort] = UNSET,
|
|
328
328
|
filter_io_substring: Optional[str] = UNSET,
|
|
329
|
+
session_id: Optional[str] = UNSET,
|
|
329
330
|
) -> Connection[ProjectSession]:
|
|
330
331
|
table = models.ProjectSession
|
|
332
|
+
if session_id:
|
|
333
|
+
async with info.context.db() as session:
|
|
334
|
+
ans = await session.scalar(
|
|
335
|
+
select(table).filter_by(
|
|
336
|
+
session_id=session_id,
|
|
337
|
+
project_id=self.project_rowid,
|
|
338
|
+
)
|
|
339
|
+
)
|
|
340
|
+
if ans:
|
|
341
|
+
return connection_from_list(
|
|
342
|
+
data=[to_gql_project_session(ans)],
|
|
343
|
+
args=ConnectionArgs(),
|
|
344
|
+
)
|
|
345
|
+
elif not filter_io_substring:
|
|
346
|
+
return connection_from_list(
|
|
347
|
+
data=[],
|
|
348
|
+
args=ConnectionArgs(),
|
|
349
|
+
)
|
|
331
350
|
stmt = select(table).filter_by(project_id=self.project_rowid)
|
|
332
351
|
if time_range:
|
|
333
352
|
if time_range.start:
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_components-
|
|
3
|
-
"file": "assets/components-
|
|
2
|
+
"_components-CKFZdR5A.js": {
|
|
3
|
+
"file": "assets/components-CKFZdR5A.js",
|
|
4
4
|
"name": "components",
|
|
5
5
|
"imports": [
|
|
6
6
|
"_vendor-ARQZvmz5.js",
|
|
7
|
-
"_pages-
|
|
7
|
+
"_pages-BEpY_9Jm.js",
|
|
8
8
|
"_vendor-arizeai-Ct6kvW4e.js",
|
|
9
9
|
"_vendor-codemirror-BxoXtD6f.js",
|
|
10
10
|
"_vendor-three-C5WAXd5r.js"
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
|
-
"_pages-
|
|
14
|
-
"file": "assets/pages-
|
|
13
|
+
"_pages-BEpY_9Jm.js": {
|
|
14
|
+
"file": "assets/pages-BEpY_9Jm.js",
|
|
15
15
|
"name": "pages",
|
|
16
16
|
"imports": [
|
|
17
17
|
"_vendor-ARQZvmz5.js",
|
|
18
18
|
"_vendor-arizeai-Ct6kvW4e.js",
|
|
19
|
-
"_components-
|
|
19
|
+
"_components-CKFZdR5A.js",
|
|
20
20
|
"_vendor-codemirror-BxoXtD6f.js",
|
|
21
21
|
"_vendor-recharts-Cl8AO7Np.js"
|
|
22
22
|
]
|
|
@@ -69,15 +69,15 @@
|
|
|
69
69
|
"name": "vendor-three"
|
|
70
70
|
},
|
|
71
71
|
"index.tsx": {
|
|
72
|
-
"file": "assets/index-
|
|
72
|
+
"file": "assets/index-D3uXREcK.js",
|
|
73
73
|
"name": "index",
|
|
74
74
|
"src": "index.tsx",
|
|
75
75
|
"isEntry": true,
|
|
76
76
|
"imports": [
|
|
77
77
|
"_vendor-ARQZvmz5.js",
|
|
78
78
|
"_vendor-arizeai-Ct6kvW4e.js",
|
|
79
|
-
"_pages-
|
|
80
|
-
"_components-
|
|
79
|
+
"_pages-BEpY_9Jm.js",
|
|
80
|
+
"_components-CKFZdR5A.js",
|
|
81
81
|
"_vendor-three-C5WAXd5r.js",
|
|
82
82
|
"_vendor-codemirror-BxoXtD6f.js",
|
|
83
83
|
"_vendor-shiki-BpqODMgR.js",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as p,j as e,u as za,a as Ne,e as vn,s as Jn,b as ea,c as nn,d as fa,f as pr,g as ze,h as hr,i as fr,k as ba,l as s,m as Xe,p as Pn,n as un,R as Oe,o as O,q as Fa,t as an,v as br,C as Sn,w as yr,x as Cr,L as Xt,y as Yt,z as Jt,A as Se,B as L,D as Vn,E as Ea,F as m,G as e1,$ as vr,H as n1,I as Z,J as a1,K as Re,M as Lr,N as kr,O as Dn,P as wr,Q,S as Ue,T as P,U as H,V as X,W as t1,X as i1,Y as Sr,Z as r1,_ as xr,a0 as l1,a1 as Ar,a2 as Mr,a3 as Tr,a4 as Ir,a5 as zr,a6 as Fr,a7 as Er,a8 as _r,a9 as Pr,aa as gn,ab as o1,ac as Ve,ad as Vr,ae as Dr,af as Te,ag as ya,ah as Ca,ai as va,aj as B,ak as Ye,al as ht,am as Kr,an as Or,ao as Rr,ap as Nr,aq as $r,ar as Br,as as Hr,at as jr,au as s1,av as Zr,aw as Ur,ax as Gr,ay as Wr,az as qr,aA as Qr,aB as Xr,aC as Le,aD as c1,aE as _e,aF as _a,aG as Yr,aH as Jr,aI as el,aJ as nl,aK as al,aL as ft,aM as tl,aN as Pa,aO as il,aP as tn,aQ as rl,aR as Va,aS as ll,aT as ol,aU as sl,aV as Kn,aW as cl,aX as dl,aY as ul,aZ as gl,a_ as ml,a$ as pl,b0 as hl,b1 as fl,b2 as bl,b3 as yl,b4 as Cl,b5 as vl,b6 as Ll,b7 as kl,b8 as bt,b9 as wl,ba as Sl,bb as xl,bc as na,bd as Al,be as Ml,bf as Tl,bg as Il,bh as zl,bi as Fl,bj as El,bk as _l,bl as Pl}from"./vendor-ARQZvmz5.js";import{a as yt,R as Vl,b as Dl,c as Kl,m as Ol,T as Rl,A as Nl,S as $l,d as Bl,e as Hl,f as jl,u as Zl}from"./pages-
|
|
1
|
+
import{r as p,j as e,u as za,a as Ne,e as vn,s as Jn,b as ea,c as nn,d as fa,f as pr,g as ze,h as hr,i as fr,k as ba,l as s,m as Xe,p as Pn,n as un,R as Oe,o as O,q as Fa,t as an,v as br,C as Sn,w as yr,x as Cr,L as Xt,y as Yt,z as Jt,A as Se,B as L,D as Vn,E as Ea,F as m,G as e1,$ as vr,H as n1,I as Z,J as a1,K as Re,M as Lr,N as kr,O as Dn,P as wr,Q,S as Ue,T as P,U as H,V as X,W as t1,X as i1,Y as Sr,Z as r1,_ as xr,a0 as l1,a1 as Ar,a2 as Mr,a3 as Tr,a4 as Ir,a5 as zr,a6 as Fr,a7 as Er,a8 as _r,a9 as Pr,aa as gn,ab as o1,ac as Ve,ad as Vr,ae as Dr,af as Te,ag as ya,ah as Ca,ai as va,aj as B,ak as Ye,al as ht,am as Kr,an as Or,ao as Rr,ap as Nr,aq as $r,ar as Br,as as Hr,at as jr,au as s1,av as Zr,aw as Ur,ax as Gr,ay as Wr,az as qr,aA as Qr,aB as Xr,aC as Le,aD as c1,aE as _e,aF as _a,aG as Yr,aH as Jr,aI as el,aJ as nl,aK as al,aL as ft,aM as tl,aN as Pa,aO as il,aP as tn,aQ as rl,aR as Va,aS as ll,aT as ol,aU as sl,aV as Kn,aW as cl,aX as dl,aY as ul,aZ as gl,a_ as ml,a$ as pl,b0 as hl,b1 as fl,b2 as bl,b3 as yl,b4 as Cl,b5 as vl,b6 as Ll,b7 as kl,b8 as bt,b9 as wl,ba as Sl,bb as xl,bc as na,bd as Al,be as Ml,bf as Tl,bg as Il,bh as zl,bi as Fl,bj as El,bk as _l,bl as Pl}from"./vendor-ARQZvmz5.js";import{a as yt,R as Vl,b as Dl,c as Kl,m as Ol,T as Rl,A as Nl,S as $l,d as Bl,e as Hl,f as jl,u as Zl}from"./pages-BEpY_9Jm.js";import{u as Ul,_ as d1,a as Ce,T as oe,E as u1,b as ve,c as g1,d as Ge,e as Gl,D as Da,f as Wl,C as m1,F as p1,I as ql,g as Ql,h as Xl,i as Yl,j as Jl,k as eo,l as no,P as ao,m as to,n as io,o as ro,p as lo,q as oo,r as so}from"./vendor-arizeai-Ct6kvW4e.js";import{L as h1,a as f1,d as on,E as Ka,k as b1,b as y1,l as La,h as co,j as uo,c as go,e as mo,f as po,s as ho,g as mn,i as pn,R as hn,p as fo,m as bo}from"./vendor-codemirror-BxoXtD6f.js";import{V as yo}from"./vendor-three-C5WAXd5r.js";const C1=function(){var n={defaultValue:null,kind:"LocalArgument",name:"clusters"},a={defaultValue:null,kind:"LocalArgument",name:"dataQualityMetricColumnName"},t={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}],o=[{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,a,t,i,r],kind:"Fragment",metadata:null,name:"pointCloudStore_clusterMetricsQuery",selections:o,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a,i,r],kind:"Operation",name:"pointCloudStore_clusterMetricsQuery",selections:o},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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{F as e,j as o,cA as f,ew as v,ex as y,ey as h,l as r,bY as x,ez as a,r as z,o as w,eA as P}from"./vendor-ARQZvmz5.js";import{H as k,J as S}from"./vendor-arizeai-Ct6kvW4e.js";import{L,g as j,r as C,h as R,i as I,F as E,j as A,P as D,k as T,M as s,l as F,D as O,n as G,E as M,o as N,p as q,q as V,s as _,t,v as W,w as B,x as H,y as J,z as $,B as K,C as U,G as Y,H as Q,I as X,J as Z,K as oo,N as ao,O as lo,Q as ro,U as co,V as d,W as m,X as p,Y as go,Z as eo,_ as bo,$ as no,a0 as io,a1 as so,a2 as to,a3 as mo,a4 as po,a5 as uo,a6 as fo,a7 as vo,a8 as yo,a9 as ho,aa as xo,ab as zo,ac as wo,ad as Po,ae as ko,af as So,ag as Lo,ah as jo,ai as Co,aj as Ro,ak as Io,al as Eo,am as Ao,an as Do,ao as To,ap as Fo,aq as Oo,ar as Go,as as Mo,at as No,au as qo,av as Vo,aw as _o,ax as Wo,ay as Bo}from"./pages-
|
|
1
|
+
import{F as e,j as o,cA as f,ew as v,ex as y,ey as h,l as r,bY as x,ez as a,r as z,o as w,eA as P}from"./vendor-ARQZvmz5.js";import{H as k,J as S}from"./vendor-arizeai-Ct6kvW4e.js";import{L,g as j,r as C,h as R,i as I,F as E,j as A,P as D,k as T,M as s,l as F,D as O,n as G,E as M,o as N,p as q,q as V,s as _,t,v as W,w as B,x as H,y as J,z as $,B as K,C as U,G as Y,H as Q,I as X,J as Z,K as oo,N as ao,O as lo,Q as ro,U as co,V as d,W as m,X as p,Y as go,Z as eo,_ as bo,$ as no,a0 as io,a1 as so,a2 as to,a3 as mo,a4 as po,a5 as uo,a6 as fo,a7 as vo,a8 as yo,a9 as ho,aa as xo,ab as zo,ac as wo,ad as Po,ae as ko,af as So,ag as Lo,ah as jo,ai as Co,aj as Ro,ak as Io,al as Eo,am as Ao,an as Do,ao as To,ap as Fo,aq as Oo,ar as Go,as as Mo,at as No,au as qo,av as Vo,aw as _o,ax as Wo,ay as Bo}from"./pages-BEpY_9Jm.js";import{eH as Ho,cp as Jo,R as $o,eI as Ko,eJ as Uo}from"./components-CKFZdR5A.js";import"./vendor-three-C5WAXd5r.js";import"./vendor-codemirror-BxoXtD6f.js";import"./vendor-shiki-BpqODMgR.js";import"./vendor-recharts-Cl8AO7Np.js";(function(){const b=document.createElement("link").relList;if(b&&b.supports&&b.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))i(c);new MutationObserver(c=>{for(const g of c)if(g.type==="childList")for(const n of g.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&i(n)}).observe(document,{childList:!0,subtree:!0});function u(c){const g={};return c.integrity&&(g.integrity=c.integrity),c.referrerPolicy&&(g.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?g.credentials="include":c.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function i(c){if(c.ep)return;c.ep=!0;const g=u(c);fetch(c.href,g)}})();const Yo=e`
|
|
2
2
|
:root {
|
|
3
3
|
--ac-global-dimension-scale-factor: 1;
|
|
4
4
|
--ac-global-dimension-size-0: 0px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as E,bm as Se,bn as $e,bo as qe,bp as Gl,D as at,r as m,j as e,u as _l,aX as Sa,l as o,Q as J,R as fn,o as P,aH as Ce,aI as ln,aK as Ke,aL as W,ak as gn,T as H,bq as Me,q as Oe,af as Ve,br as bp,aj as G,U as X,V as ke,aF as Pa,F as C,ac as Ne,bs as Sp,bt as vp,bu as Fp,bv as Cp,aP as xe,ag as pi,bw as cr,bx as Xl,by as ve,aC as lt,bz as Qe,bA as Kp,a_ as In,bB as Tp,aO as Pp,bC as xp,J as ur,aN as ce,b2 as al,aZ as Ie,aY as Dn,bD as Fn,bE as pn,m as mo,$ as Ip,S as mr,G as gr,aV as go,I as Dp,X as Lp,bF as _p,bG as jt,bH as Ot,bI as ml,b4 as Ya,b3 as el,t as Al,bJ as Ap,b9 as Kl,bK as wp,bL as pr,bM as Rp,bN as Ep,bO as Mp,bP as Vp,bQ as zp,bR as Np,bS as $p,bT as jp,bU as Op,bV as Tl,E as Qp,bW as Bp,g as po,bX as qp,aE as tt,bY as yo,bZ as fo,b_ as Up,al as Hp,b$ as Gp,ah as Wp,ai as Jp,c0 as Xp,n as Zp}from"./vendor-ARQZvmz5.js";import{d as oe,s as xa,D as ue,C as q,b as nn,a as $n,T as Ee,r as ra,q as yi,L as it,t as rt,v as Yp,l as ho,P as ot,c as oa,E as st,n as $a,o as wl,e as Ia,p as dt,w as ey,x as ct,y as ny,z as ay,A as fi,B as hi,u as ly,G as ty}from"./vendor-arizeai-Ct6kvW4e.js";import{s as iy,l as ry,j as ki,a as Be,i as bi,b as oy,c as sy,d as va,e as jn,f as ko,D as bo,g as fa,h as vl,C as Wl,k as dy,m as Te,T as bn,n as cy,o as Si,p as yr,q as uy,r as fr,t as my,u as gy,P as Rl,v as py,_ as v,G as El,w as b,x as F,y as M,I as D,E as ja,z as We,A as So,B as vo,R as he,F as be,H as me,J as Z,K as hr,L as kr,N as ha,M as Je,O as ka,Q as He,S as on,U as Ge,V as Xe,W as Ze,X as yn,Y as On,Z as ll,$ as an,a0 as Tn,a1 as De,a2 as ae,a3 as ge,a4 as sn,a5 as Ml,a6 as Fo,a7 as we,a8 as Co,a9 as ea,aa as na,ab as aa,ac as Oa,ad as Qa,ae as Re,af as _e,ag as vi,ah as Bn,ai as Ko,aj as dn,ak as le,al as re,am as cn,an as To,ao as Zl,ap as ze,aq as qn,ar as yy,as as fy,at as Po,au as li,av as Fi,aw as ut,ax as hy,ay as ky,az as ti,aA as Ql,aB as de,aC as xo,aD as Pn,aE as mt,aF as Un,aG as sa,aH as Io,aI as Do,aJ as by,aK as Sy,aL as xn,aM as vy,aN as En,aO as Fy,aP as Lo,aQ as gt,aR as Da,aS as Ci,aT as Ki,aU as Cy,aV as _o,aW as Ky,aX as Ty,aY as Py,aZ as xy,a_ as Iy,a$ as Dy,b0 as Ly,b1 as Fe,b2 as _y,b3 as Ay,b4 as Pl,b5 as pt,b6 as yt,b7 as la,b8 as Vl,b9 as Xn,ba as wy,bb as pe,bc as ii,bd as ye,be as fe,bf as Sn,bg as Ry,bh as Ey,bi as My,bj as Cn,bk as Vy,bl as zy,bm as Ny,bn as ft,bo as ht,bp as Ao,bq as $y,br as jy,bs as Oy,bt as tl,bu as Qy,bv as wo,bw as By,bx as kt,by as Ln,bz as qy,bA as Uy,bB as Hy,bC as Zn,bD as rn,bE as Ro,bF as je,bG as Eo,bH as ta,bI as bt,bJ as Ba,bK as Mo,bL as Gy,bM as _n,bN as Ti,bO as Ea,bP as Wy,bQ as Wa,bR as Jy,bS as Xy,bT as Pi,bU as St,bV as da,bW as La,bX as Vo,bY as ri,bZ as un,b_ as vt,b$ as zo,c0 as Ft,c1 as An,c2 as No,c3 as Ct,c4 as Zy,c5 as $o,c6 as jo,c7 as br,c8 as Sr,c9 as Yy,ca as xl,cb as oi,cc as Kt,cd as nl,ce as ef,cf as nf,cg as il,ch as af,ci as lf,cj as Il,ck as Oo,cl as tf,cm as Qo,cn as Tt,co as Pt,cp as ca,cq as rf,cr as of,cs as Kn,ct as Qn,cu as Va,cv as xi,cw as Bo,cx as Ii,cy as qo,cz as sf,cA as df,cB as cf,cC as uf,cD as mf,cE as gf,cF as pf,cG as Di,cH as Uo,cI as Ho,cJ as Go,cK as Wo,cL as Ue,cM as Jo,cN as Xo,cO as si,cP as Li,cQ as _i,cR as yf,cS as ff,cT as hf,cU as Ai,cV as kf,cW as bf,cX as xt,cY as Sf,cZ as Zo,c_ as vf,c$ as Ff,d0 as Cf,d1 as Kf,d2 as Tf,d3 as Pf,d4 as xf,d5 as If,d6 as Df,d7 as Yo,d8 as vr,d9 as Lf,da as Hn,db as ua,dc as wi,dd as es,de as ns,df as Fr,dg as Cr,dh as _f,di as Af,dj as ee,dk as It,dl as rl,dm as as,dn as ol,dp as sl,dq as ls,dr as wf,ds as Rf,dt as Ri,du as Ef,dv as Mf,dw as Vf,dx as zf,dy as Nf,dz as Dl,dA as ts,dB as is,dC as $f,dD as jf,dE as Kr,dF as Of,dG as Qf,dH as Bf,dI as qf,dJ as Uf,dK as Hf,dL as rs,dM as Gf,dN as Wf,dO as Jf,dP as Xf,dQ as Zf,dR as za,dS as Ei,dT as os,dU as Ja,dV as Qt,dW as Yf,dX as eh,dY as Mi,dZ as Dt,d_ as Mn,d$ as Yl,e0 as ss,e1 as nh,e2 as ah,e3 as ds,e4 as cs,e5 as lh,e6 as us,e7 as Vi,e8 as th,e9 as Tr,ea as ih,eb as rh,ec as oh,ed as sh,ee as dh,ef as ch,eg as Bt,eh as ms,ei as uh,ej as zi,ek as Ni,el as mh,em as Xa,en as gh,eo as ph,ep as yh,eq as gs,er as zl,es as fh,et as hh,eu as kh,ev as ps,ew as Pr,ex as bh,ey as Sh,ez as vh,eA as Fh,eB as ys,eC as Ch,eD as Kh,eE as Th,eF as xr,eG as Ir}from"./components-DGavuwFF.js";import{g as _a,i as Aa,d as Ph,E as fs,R as wa,k as $i,b as xh,p as Nl,n as hs}from"./vendor-codemirror-BxoXtD6f.js";import{P as ks,C as bs,T as Gn,a as Ss,R as wn,X as Wn,Y as hn,b as Jn,B as Fa,c as Lt,d as dl,A as Ll,e as vs,L as ji,f as Ih}from"./vendor-recharts-Cl8AO7Np.js";const Dh=4,Lh="Unable to parse span input messages, expected messages which include a role and content.",_h="Unable to parse span output messages, expected messages which include a role and content.",Ah="Unable to parse span output expected output.value to be present.",wh="Unable to parse span attributes, attributes must be valid JSON.",Rh="Unable to parse model config, expected llm.model_name to be present.",Eh="Unable to parse model config, expected llm.invocation_parameters JSON string to be present.",Mh="Unable to parse invocation parameters response_format, expected llm.invocation_parameters.response_format to be a well formed json object or undefined.",Vh="Unable to parse tools, expected tools to be an array of valid tools.",zh="Unable to parse prompt template variables, expected prompt template variables to be a valid JSON object string.",Dr={AZURE_OPENAI:[],ANTHROPIC:["claude"],OPENAI:["gpt","o1"],GOOGLE:["gemini"],DEEPSEEK:["deepseek"],XAI:["grok"],OLLAMA:[]},ba="TOOL_CHOICE",Za="tool_choice",Nn="RESPONSE_FORMAT",Vn="response_format",Nh=[ba,Nn],$h=E.object({tool_call:E.object({id:E.string().optional(),function:E.object({name:E.string(),arguments:E.string()}).partial()}).partial()}).partial(),Fs=E.object({[Se.message]:E.object({[$e.role]:E.string(),[$e.content]:E.union([E.string(),E.array(E.record(E.string(),E.unknown()))]).default(""),[$e.contents]:E.array(E.object({message_content:E.record(E.string())})).optional(),[$e.tool_calls]:E.array($h).optional(),[$e.tool_call_id]:E.string().optional()})}),jh=E.object({[Se.llm]:E.object({[qe.input_messages]:E.array(Fs)})}),Oh=E.object({[Se.llm]:E.object({[qe.output_messages]:E.array(Fs)})}),Qh=E.object({[Se.output]:E.object({value:E.string()})}),Cs=iy()(E.enum(["user","ai","system","tool"])),Bh=E.object({id:E.number(),role:Cs,content:E.string().optional(),toolCallId:E.string().optional(),toolCalls:E.array(ry).optional()}),qh=E.array(Bh),Ks=E.lazy(()=>E.record(ki)),Uh=Ks,Ts=E.string().transform((n,a)=>{const{json:l}=Be(n);if(!bi(l))return a.addIssue({code:E.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),E.NEVER;const{success:t,data:i}=Uh.safeParse(l);return t?i:(a.addIssue({code:E.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),E.NEVER)}).default("{}"),Hh=E.object({[Se.llm]:E.object({[qe.provider]:E.string().optional(),[qe.model_name]:E.string()})}),Ps=E.object({[Se.llm]:E.object({[qe.invocation_parameters]:Ts})}),Gh=E.object({[Se.llm]:E.object({[qe.invocation_parameters]:Ts.pipe(E.object({response_format:Ks.optional()}))})}),Wh=E.object({url:E.object({full:E.string(),path:E.string().optional()})}),Jh=E.string().transform((n,a)=>{const{json:l}=Be(n);return l==null||!bi(l)?(a.addIssue({code:E.ZodIssueCode.custom,message:"The tool JSON schema must be a valid JSON object"}),E.NEVER):l}).transform((n,a)=>{const{data:l,success:t}=oy.safeParse(n);return t?l:(a.addIssue({code:E.ZodIssueCode.custom,message:"The tool JSON schema must be a valid tool schema"}),E.NEVER)}),Xh=E.object({[Se.llm]:E.object({[qe.tools]:E.array(E.object({[Se.tool]:E.object({[Gl.json_schema]:Jh})}).optional()).optional()}).optional()}).optional(),Zh=E.lazy(()=>E.object({type:E.literal("json_schema"),json_schema:E.object({name:E.string().describe("The name of the schema"),schema:sy.describe("The schema itself in JSON schema format"),strict:E.literal(!0).describe("The schema must be strict")})})),Yh=at(Zh,{removeAdditionalStrategy:"passthrough"}),e0=E.string().transform((n,a)=>{const{json:l}=Be(n);return va(l)?Object.entries(l).reduce((i,[r,s])=>{if(typeof s=="string")i[r]=s;else{const{json:d}=jn(s);d!=null&&(i[r]=d)}return i},{}):(a.addIssue({code:E.ZodIssueCode.custom,message:"The prompt template variables must be a valid JSON object"}),E.NEVER)}),n0=E.object({[Se.llm]:E.object({[qe.prompt_template]:E.object({variables:e0}).optional()}).optional()}).optional();function xs(n){return Cs.safeParse(n).success}function pa(n){const a=n.toLowerCase();if(xs(a))return a;for(const[l,t]of Object.entries(Wl))if(t.includes(a))return l;return dy}function a0({toolCalls:n,provider:a}){if(n!=null)return n.map(({tool_call:l})=>{var i,r,s,d;if(l==null)return null;let t={};if(((i=l.function)==null?void 0:i.arguments)!=null){const{json:c}=Be(l.function.arguments);va(c)&&(t=c)}switch(a){case"OPENAI":case"AZURE_OPENAI":case"DEEPSEEK":case"XAI":case"OLLAMA":return{id:l.id??"",type:"function",function:{name:((r=l.function)==null?void 0:r.name)??"",arguments:t}};case"ANTHROPIC":return{id:l.id??"",type:"tool_use",name:((s=l.function)==null?void 0:s.name)??"",input:t};case"GOOGLE":return{id:l.id??"",function:{name:((d=l.function)==null?void 0:d.name)??"",arguments:t}};default:Te()}}).filter(l=>l!=null)}function Is({messages:n,provider:a}){return n.map(({message:l})=>{var t,i;return{id:fa(),role:l.tool_call_id!=null?pa("tool"):pa(l.role),content:Array.isArray(l.contents)?((i=(t=l.contents.find(r=>r.message_content.type==="text"))==null?void 0:t.message_content)==null?void 0:i.text)??void 0:typeof l.content=="string"?l.content:void 0,toolCalls:a0({provider:a,toolCalls:l.tool_calls}),toolCallId:l.tool_call_id}})}function l0({provider:n,parsedAttributes:a}){var t;const l=jh.safeParse(a);if(!l.success)return{messageParsingErrors:[Lh],messages:null};if(n==="ANTHROPIC"){const{success:i,data:r}=Ps.safeParse(a);if(i){const s=l.data.llm.input_messages,d=(t=r.llm.invocation_parameters)==null?void 0:t.system;typeof d=="string"&&d&&(!s||s[0].message.role!=="system")&&l.data.llm.input_messages.unshift({message:{role:"system",content:d}})}}return{messageParsingErrors:[],messages:Is({provider:n,messages:l.data.llm.input_messages})}}function t0({provider:n,parsedAttributes:a}){const l=[],t=Oh.safeParse(a);if(t.success)return{output:Is({provider:n,messages:t.data.llm.output_messages}),outputParsingErrors:l};l.push(_h);const i=Qh.safeParse(a);return i.success?{output:i.data.output.value,outputParsingErrors:l}:(l.push(Ah),{output:void 0,outputParsingErrors:l})}function Ds(n){if(n==null)return null;switch(n.toLowerCase()){case"openai":return"OPENAI";case"anthropic":return"ANTHROPIC";case"google":return"GOOGLE";case"azure":return"AZURE_OPENAI";default:return null}}function i0(n){for(const a of Object.keys(Dr))if(Dr[a].some(t=>n.includes(t)))return a;return bo}function r0(n){const{success:a,data:l}=Hh.safeParse(n);if(a){const t=Ds(l.llm.provider)||i0(l.llm.model_name),i=o0(n);return{modelConfig:{...Object.fromEntries(Object.entries(i).filter(([r,s])=>s!==null)),modelName:l.llm.model_name,provider:t,invocationParameters:[],supportedInvocationParameters:[]},parsingErrors:[]}}return{modelConfig:null,parsingErrors:[Rh]}}function o0(n){const{success:a,data:l}=Wh.safeParse(n);if(a)try{const t=new URL(l.url.full);let i=t;if(l.url.path)try{i=new URL(l.url.full.split(l.url.path)[0])}catch{}return{baseUrl:`${i.origin}${i.pathname}`,endpoint:t.origin,apiVersion:t.searchParams.get("api-version")||null}}catch{}return{baseUrl:null,apiVersion:null,endpoint:null}}function s0(n,a=[]){const{success:l,data:t}=Ps.safeParse(n),i=[];return l||i.push(Eh),{invocationParameters:h0((t==null?void 0:t.llm.invocation_parameters)??{},a),parsingErrors:i}}function d0(n){const{success:a,data:l}=Gh.safeParse(n);return a?{responseFormat:l.llm.invocation_parameters.response_format,parsingErrors:[]}:{responseFormat:void 0,parsingErrors:[Mh]}}function c0(n){var a;return(((a=n==null?void 0:n.llm)==null?void 0:a.tools)??[]).map(l=>(l==null?void 0:l.tool)==null?null:{id:vl(),definition:l.tool.json_schema}).filter(l=>l!=null)}function u0(n){var t;const{data:a,success:l}=Xh.safeParse(n);return l?((t=a==null?void 0:a.llm)==null?void 0:t.tools)==null?{tools:null,parsingErrors:[]}:{tools:c0(a),parsingErrors:[]}:{tools:null,parsingErrors:[Vh]}}function m0(n){var t;const{success:a,data:l}=n0.safeParse(n);return a?((t=l==null?void 0:l.llm)==null?void 0:t.prompt_template)==null?{variables:null,parsingErrors:[]}:{variables:l.llm.prompt_template.variables,parsingErrors:[]}:{variables:null,parsingErrors:[zh]}}function g0(n){const{instance:a,instanceMessages:l}=ko(),t={...a,template:{__type:"chat",messages:Object.values(l)}},{json:i,parseError:r}=Be(n.attributes);if(r)return{playgroundInstance:{...t,spanId:(n==null?void 0:n.id)??null},parsingErrors:[wh]};const s=n.invocationParameters,d=r0(i);let{modelConfig:c}=d;const{parsingErrors:g}=d,{messages:f,messageParsingErrors:u}=l0({provider:(c==null?void 0:c.provider)??t.model.provider,parsedAttributes:i}),{output:p,outputParsingErrors:y}=t0({provider:(c==null?void 0:c.provider)??t.model.provider,parsedAttributes:i}),{invocationParameters:h,parsingErrors:k}=s0(i,s),{variables:S,parsingErrors:K}=m0(i),{parsingErrors:T}=d0(i);c=c!=null?{...c,invocationParameters:T.length>0?h.filter(V=>V.invocationName!==Vn&&V.canonicalName!==Nn):h}:null;const{tools:L,parsingErrors:x}=u0(i),w=f==null?void 0:f.map(V=>({...V,content:V.role==="tool"?Oi(V.content):V.content}));return{playgroundInstance:{...t,model:c??t.model,template:w!=null?{__type:"chat",messages:w}:t.template,output:p,spanId:n.id,tools:L??t.tools},playgroundInput:S!=null?{variablesValueCache:S}:void 0,parsingErrors:[...u,...y,...g,...x,...k,...T,...K]}}const p0=n=>qh.safeParse(n).success,Ls=({instance:n,templateFormat:a})=>{if(a==bn.NONE)return[];const l=new Set,t=n.template.__type,i=cy(a);switch(t){case"chat":{n.template.messages.forEach(r=>{(r.content==null?[]:i.extractVariables(r.content)).forEach(d=>{l.add(d)})});break}case"text_completion":{i.extractVariables(n.template.prompt).forEach(s=>{l.add(s)});break}default:Te()}return Array.from(l)},y0=({instances:n,templateFormat:a})=>a==bn.NONE?[]:Array.from(new Set(n.flatMap(l=>Ls({instance:l,templateFormat:a})))),_s=({instances:n,templateFormat:a,input:l})=>{if(a==bn.NONE)return{variablesMap:{},variableKeys:[]};const t=y0({instances:n,templateFormat:a}),i=l.variablesValueCache??{};return{variablesMap:t.reduce((s,d)=>(s[d]=i[d]||"",s),{}),variableKeys:t}};function Ca(n,a){return n.invocationName===a.invocationName||n.canonicalName!=null&&a.canonicalName!=null&&n.canonicalName===a.canonicalName}const f0=(n,a)=>n.filter(l=>a.some(t=>Ca(t,l))).map(l=>{var t;return{...l,invocationName:((t=a.find(i=>Ca(i,l)))==null?void 0:t.invocationName)??l.invocationName}}),cl=n=>n.replace(/_([a-z])/g,(a,l)=>l.toUpperCase()),h0=(n,a)=>Object.entries(n).map(([l,t])=>{const i=a.find(r=>r.canonicalName&&r.canonicalName.toLowerCase()===l.toLowerCase()||r.invocationName&&r.invocationName.toLowerCase()===l.toLowerCase());return i==null||i.invocationInputField==null||i.invocationName==null?null:{canonicalName:i.canonicalName,invocationName:i.invocationName,[cl(i.invocationInputField)]:t}}).filter(l=>l!=null),As=n=>{const{provider:a,validatedToolDefinition:l}=gy(n.definition);switch(a){case"OPENAI":case"AZURE_OPENAI":return l.function.name;case"ANTHROPIC":return l.name;case"UNKNOWN":return null;default:Te()}},k0=({provider:n,toolNumber:a})=>{switch(n){case"OPENAI":case"DEEPSEEK":case"XAI":case"OLLAMA":case"AZURE_OPENAI":return{id:vl(),definition:fr(a)};case"ANTHROPIC":return{id:vl(),definition:my(a)};case"GOOGLE":return{id:vl(),definition:fr(a)};default:Te()}},b0=n=>{switch(n){case"OPENAI":case"AZURE_OPENAI":case"DEEPSEEK":case"XAI":case"OLLAMA":return yr();case"ANTHROPIC":return uy();case"GOOGLE":return yr();default:Te()}};function S0(n){return{content:n.content,role:v0(n.role),toolCalls:n.toolCalls,toolCallId:n.toolCallId}}function v0(n){switch(n){case"system":return"SYSTEM";case"user":return"USER";case"tool":return"TOOL";case"ai":return"AI";default:Te()}}const ws=({playgroundStore:n,instanceId:a,credentials:l})=>{var u;const{instances:t,allInstanceMessages:i}=n.getState(),r=t.find(p=>p.id===a);if(!r)throw new Error(`No instance found for id ${a}`);if(r.template.__type!=="chat")throw new Error("We only support chat templates for now");const s=r.template.messageIds.map(p=>i[p]).filter(p=>p!=null),d=r.model.supportedInvocationParameters;let c=[...r.model.invocationParameters];const g=Si({toolChoice:r.toolChoice,targetProvider:r.model.provider});r.tools.length>0?(c=c.filter(p=>p.invocationName!==Za&&p.canonicalName!==ba),c.push({canonicalName:ba,invocationName:Za,valueJson:g})):c=c.filter(p=>p.invocationName!==Za&&p.canonicalName!==ba),c=d.length?f0(c,d):c;const f=r.model.provider==="AZURE_OPENAI"?{endpoint:r.model.endpoint,apiVersion:r.model.apiVersion}:{};return{messages:s.map(S0),model:{providerKey:r.model.provider,name:r.model.modelName||"",baseUrl:r.model.baseUrl,...f},invocationParameters:Es(c,r.model.provider,r.model.modelName),tools:r.tools.length?r.tools.map(p=>p.definition):void 0,credentials:F0(l,r.model.provider),promptName:(u=r.prompt)==null?void 0:u.name}},_t=(n,a)=>{if(n.template.__type==="chat"){const{messageIds:l,...t}=n.template;return{...n,template:{...t,messages:n.template.messageIds.map(i=>a[i])}}}return n};function F0(n,a){const l=n[a],t=Rl[a];return l?t.length===0?[]:t.map(i=>({envVarName:i.envVarName,value:l[i.envVarName]??""})):[]}const C0=({playgroundStore:n,instanceId:a,credentials:l})=>{const t=ws({playgroundStore:n,instanceId:a,credentials:l}),{instances:i,templateFormat:r,input:s,allInstanceMessages:d}=n.getState(),c=i.map(f=>_t(f,d)),{variablesMap:g}=_s({instances:c,input:s,templateFormat:r});return{...t,template:{variables:g,format:r}}},Lr=({playgroundStore:n,instanceId:a,credentials:l,datasetId:t})=>({...ws({playgroundStore:n,instanceId:a,credentials:l}),templateFormat:n.getState().templateFormat,datasetId:t});function Oi(n){if(typeof n=="string"){const a=n.startsWith('"{')||n.startsWith('"[')||n.startsWith('"\\"');try{if(a){const t=JSON.parse(n),i=typeof t=="string"?JSON.parse(t):t;return JSON.stringify(i,null,2)}}catch{}if(/^\s*[0-9{[]|true|false|null/.test(n))return n}return JSON.stringify(n,null,2)}function Rs(n,a){return a.filter(l=>l.required).every(l=>n.some(t=>Ca(t,l)))}const K0=n=>{for(const[a,l]of Object.entries(n))if(a.endsWith("DefaultValue")&&l!=null)return n[a]};function yT(n,a){const l=new Map(n.map(t=>[t.invocationName,t]));return a.forEach(t=>{var c;const i=t.invocationName,r=K0(t),s=cl(t.invocationInputField||"");if(!t.invocationName||!t.invocationInputField||!i||r==null||((c=l.get(i))==null?void 0:c[s])!=null)return;const d={canonicalName:t.canonicalName,invocationName:t.invocationName,[s]:r};l.set(i,d)}),Array.from(l.values())}const T0=E.object({type:E.literal("enabled")}).passthrough(),P0=E.object({type:E.enum(["any","tool"])}).passthrough(),x0=(n,a)=>{if(!a)return n;const l=n.some(t=>t.canonicalName==="ANTHROPIC_EXTENDED_THINKING"&&t.valueJson&&T0.safeParse(t.valueJson).success);return n.filter(t=>{if(t.canonicalName==="ANTHROPIC_EXTENDED_THINKING"&&!t.valueJson)return!1;if(l){if(t.canonicalName==="TEMPERATURE"||t.canonicalName==="TOP_P")return!1;if(t.canonicalName===ba)return!P0.safeParse(t.valueJson).success}return!0})},I0=["frequency_penalty","presence_penalty"],D0=n=>n.filter(l=>l.invocationName&&I0.includes(l.invocationName)?!(l.valueFloat==0||l.valueInt==0):!0),Es=(n,a,l)=>{const t=D0(n);return a==="ANTHROPIC"?x0(t,l):t},Ms=m.createContext(null);function fT({children:n,...a}){const[l]=m.useState(()=>py(a));return e(Ms.Provider,{value:l,children:n})}function Na(n,a){const l=m.useContext(Ms);if(!l)throw new Error("Missing CredentialsContext.Provider in the tree");return _l(l,n,a)}const Vs="arize-phoenix-feature-flags",qt={dashboards:!1};function L0(){const n=localStorage.getItem(Vs);if(!n)return qt;try{const a=JSON.parse(n);return Object.assign({},qt,a)}catch{return qt}}const zs=m.createContext(null);function Ns(){const n=fn.useContext(zs);if(n===null)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return n}function _0(n){const{featureFlags:a}=Ns();return a[n]}function hT(n){const[a,l]=m.useState(L0()),t=i=>{localStorage.setItem(Vs,JSON.stringify(i)),l(i)};return e(zs.Provider,{value:{featureFlags:a,setFeatureFlags:t},children:e(A0,{children:n.children})})}function A0(n){const{children:a}=n,{featureFlags:l,setFeatureFlags:t}=Ns(),[i,r]=m.useState(!1);return Sa("ctrl+shift+f",()=>r(!0)),o(J,{children:[a,e(ue,{type:"modal",isDismissable:!0,onDismiss:()=>r(!1),children:i&&e(oe,{title:"Feature Flags",children:e(v,{height:"size-1000",padding:"size-100",children:Object.keys(l).map(s=>e(xa,{isSelected:l[s],onChange:d=>t({...l,[s]:d}),children:s},s))})})})]})}const $s=m.createContext(null);function w0(){const n=m.useContext($s);if(n===null)throw new Error("useFunctionality must be used within a FunctionalityProvider");return n}function kT(n){return e($s.Provider,{value:{authenticationEnabled:window.Config.authenticationEnabled},children:n.children})}const js={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"GenerativeProvidersCard_data",selections:[{alias:null,args:null,concreteType:"GenerativeProvider",kind:"LinkedField",name:"modelProviders",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dependenciesInstalled",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dependencies",storageKey:null},{alias:null,args:null,concreteType:"GenerativeProviderCredentialConfig",kind:"LinkedField",name:"credentialRequirements",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"envVarName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isRequired",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"credentialsSet",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};js.hash="4062531cfa3f77e541172a44101f5331";function R0({query:n}){const[a,l]=m.useState(null),t=Na(g=>g),i=P.useFragment(js,n),r=m.useMemo(()=>[...i.modelProviders],[i]),s=m.useMemo(()=>[{header:"Name",accessorKey:"name",cell:({row:g})=>o(b,{direction:"row",alignItems:"center",gap:"size-100",children:[e(El,{provider:g.original.key,height:18}),g.original.name]})},{header:"Environment Variables",accessorKey:"apiKeyEnvVar",cell:({row:g})=>{const f=Rl[g.original.key],u=(f==null?void 0:f.map(p=>p.envVarName).join(", "))||g.original.credentialRequirements.map(p=>p.envVarName).join(", ")||"--";return e(F,{children:u})}},{header:"configuration",accessorKey:"credentialsSet",cell:({row:g})=>{if(!g.original.dependenciesInstalled)return e(F,{color:"warning",children:"missing dependencies"});const f=g.original.credentialRequirements,u=t[g.original.key];return f.every(({envVarName:y,isRequired:h})=>(u==null?void 0:u[y])!==void 0||!h)?e(F,{color:"success",children:"local"}):g.original.credentialsSet?e(F,{color:"success",children:"configured on the server"}):e(F,{color:"text-700",children:"not configured"})}},{header:"",accessorKey:"id",cell:({row:g})=>e(b,{direction:"row",justifyContent:"end",gap:"size-100",width:"100%",children:e(M,{size:"S",leadingVisual:e(D,{svg:e(ja,{})}),onPress:()=>{l(g.original)}})})}],[t]),d=Ce({columns:s,data:r,getCoreRowModel:Ke(),getSortedRowModel:ln()}),c=d.getRowModel().rows;return o(q,{title:"AI Providers",bodyStyle:{padding:0},variant:"compact",children:[o("table",{css:We,children:[e("thead",{children:d.getHeaderGroups().map(g=>e("tr",{children:g.headers.map(f=>e("th",{colSpan:f.colSpan,children:f.isPlaceholder?null:e("div",{children:W(f.column.columnDef.header,f.getContext())})},f.id))},g.id))}),e("tbody",{children:c.map(g=>e("tr",{children:g.getVisibleCells().map(f=>e("td",{children:W(f.column.columnDef.cell,f.getContext())},f.id))},g.id))})]}),e(ue,{type:"modal",isDismissable:!0,onDismiss:()=>l(null),children:a&&e(oe,{title:`Configure ${a.name} Credentials`,size:"S",children:o(v,{padding:"size-200",children:[e(v,{paddingBottom:"size-100",children:o(F,{size:"XS",children:["Set the credentials for the ",a.name," API. These credentials will be stored entirely in your browser and will only be sent to the server during API requests."]})}),o(gn,{onSubmit:g=>{g.preventDefault(),l(null)},children:[e(E0,{provider:a.key}),e(v,{paddingTop:"size-200",children:o(b,{direction:"row",justifyContent:"end",gap:"size-100",children:[e(M,{variant:"default",size:"S",onPress:()=>{l(null)},children:"Cancel"}),e(M,{variant:"primary",size:"S",onPress:()=>{l(null)},children:"Save Credentials"})]})})]})]})})})]})}function E0({provider:n}){const a=Na(i=>i.setCredential),l=Rl[n],t=Na(i=>i[n]);return e(b,{direction:"column",gap:"size-100",children:l.map(i=>o(vo,{isRequired:i.isRequired,onChange:r=>{a({provider:n,envVarName:i.envVarName,value:r})},value:(t==null?void 0:t[i.envVarName])??void 0,children:[e(H,{children:i.envVarName}),e(So,{})]},i.envVarName))})}function bT(){const n=Me();return Oe(n),e(R0,{query:n})}const Os={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"settingsAIProvidersPageLoaderQuery",selections:[{args:null,kind:"FragmentSpread",name:"GenerativeProvidersCard_data"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"settingsAIProvidersPageLoaderQuery",selections:[{alias:null,args:null,concreteType:"GenerativeProvider",kind:"LinkedField",name:"modelProviders",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dependenciesInstalled",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dependencies",storageKey:null},{alias:null,args:null,concreteType:"GenerativeProviderCredentialConfig",kind:"LinkedField",name:"credentialRequirements",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"envVarName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isRequired",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"credentialsSet",storageKey:null}],storageKey:null}]},params:{cacheID:"1238ea27e05b70fd2c203ab4be6a1209",id:null,metadata:{},name:"settingsAIProvidersPageLoaderQuery",operationKind:"query",text:`query settingsAIProvidersPageLoaderQuery {
|
|
1
|
+
import{B as E,bm as Se,bn as $e,bo as qe,bp as Gl,D as at,r as m,j as e,u as _l,aX as Sa,l as o,Q as J,R as fn,o as P,aH as Ce,aI as ln,aK as Ke,aL as W,ak as gn,T as H,bq as Me,q as Oe,af as Ve,br as bp,aj as G,U as X,V as ke,aF as Pa,F as C,ac as Ne,bs as Sp,bt as vp,bu as Fp,bv as Cp,aP as xe,ag as pi,bw as cr,bx as Xl,by as ve,aC as lt,bz as Qe,bA as Kp,a_ as In,bB as Tp,aO as Pp,bC as xp,J as ur,aN as ce,b2 as al,aZ as Ie,aY as Dn,bD as Fn,bE as pn,m as mo,$ as Ip,S as mr,G as gr,aV as go,I as Dp,X as Lp,bF as _p,bG as jt,bH as Ot,bI as ml,b4 as Ya,b3 as el,t as Al,bJ as Ap,b9 as Kl,bK as wp,bL as pr,bM as Rp,bN as Ep,bO as Mp,bP as Vp,bQ as zp,bR as Np,bS as $p,bT as jp,bU as Op,bV as Tl,E as Qp,bW as Bp,g as po,bX as qp,aE as tt,bY as yo,bZ as fo,b_ as Up,al as Hp,b$ as Gp,ah as Wp,ai as Jp,c0 as Xp,n as Zp}from"./vendor-ARQZvmz5.js";import{d as oe,s as xa,D as ue,C as q,b as nn,a as $n,T as Ee,r as ra,q as yi,L as it,t as rt,v as Yp,l as ho,P as ot,c as oa,E as st,n as $a,o as wl,e as Ia,p as dt,w as ey,x as ct,y as ny,z as ay,A as fi,B as hi,u as ly,G as ty}from"./vendor-arizeai-Ct6kvW4e.js";import{s as iy,l as ry,j as ki,a as Be,i as bi,b as oy,c as sy,d as va,e as jn,f as ko,D as bo,g as fa,h as vl,C as Wl,k as dy,m as Te,T as bn,n as cy,o as Si,p as yr,q as uy,r as fr,t as my,u as gy,P as Rl,v as py,_ as v,G as El,w as b,x as F,y as M,I as D,E as ja,z as We,A as So,B as vo,R as he,F as be,H as me,J as Z,K as hr,L as kr,N as ha,M as Je,O as ka,Q as He,S as on,U as Ge,V as Xe,W as Ze,X as yn,Y as On,Z as ll,$ as an,a0 as Tn,a1 as De,a2 as ae,a3 as ge,a4 as sn,a5 as Ml,a6 as Fo,a7 as we,a8 as Co,a9 as ea,aa as na,ab as aa,ac as Oa,ad as Qa,ae as Re,af as _e,ag as vi,ah as Bn,ai as Ko,aj as dn,ak as le,al as re,am as cn,an as To,ao as Zl,ap as ze,aq as qn,ar as yy,as as fy,at as Po,au as li,av as Fi,aw as ut,ax as hy,ay as ky,az as ti,aA as Ql,aB as de,aC as xo,aD as Pn,aE as mt,aF as Un,aG as sa,aH as Io,aI as Do,aJ as by,aK as Sy,aL as xn,aM as vy,aN as En,aO as Fy,aP as Lo,aQ as gt,aR as Da,aS as Ci,aT as Ki,aU as Cy,aV as _o,aW as Ky,aX as Ty,aY as Py,aZ as xy,a_ as Iy,a$ as Dy,b0 as Ly,b1 as Fe,b2 as _y,b3 as Ay,b4 as Pl,b5 as pt,b6 as yt,b7 as la,b8 as Vl,b9 as Xn,ba as wy,bb as pe,bc as ii,bd as ye,be as fe,bf as Sn,bg as Ry,bh as Ey,bi as My,bj as Cn,bk as Vy,bl as zy,bm as Ny,bn as ft,bo as ht,bp as Ao,bq as $y,br as jy,bs as Oy,bt as tl,bu as Qy,bv as wo,bw as By,bx as kt,by as Ln,bz as qy,bA as Uy,bB as Hy,bC as Zn,bD as rn,bE as Ro,bF as je,bG as Eo,bH as ta,bI as bt,bJ as Ba,bK as Mo,bL as Gy,bM as _n,bN as Ti,bO as Ea,bP as Wy,bQ as Wa,bR as Jy,bS as Xy,bT as Pi,bU as St,bV as da,bW as La,bX as Vo,bY as ri,bZ as un,b_ as vt,b$ as zo,c0 as Ft,c1 as An,c2 as No,c3 as Ct,c4 as Zy,c5 as $o,c6 as jo,c7 as br,c8 as Sr,c9 as Yy,ca as xl,cb as oi,cc as Kt,cd as nl,ce as ef,cf as nf,cg as il,ch as af,ci as lf,cj as Il,ck as Oo,cl as tf,cm as Qo,cn as Tt,co as Pt,cp as ca,cq as rf,cr as of,cs as Kn,ct as Qn,cu as Va,cv as xi,cw as Bo,cx as Ii,cy as qo,cz as sf,cA as df,cB as cf,cC as uf,cD as mf,cE as gf,cF as pf,cG as Di,cH as Uo,cI as Ho,cJ as Go,cK as Wo,cL as Ue,cM as Jo,cN as Xo,cO as si,cP as Li,cQ as _i,cR as yf,cS as ff,cT as hf,cU as Ai,cV as kf,cW as bf,cX as xt,cY as Sf,cZ as Zo,c_ as vf,c$ as Ff,d0 as Cf,d1 as Kf,d2 as Tf,d3 as Pf,d4 as xf,d5 as If,d6 as Df,d7 as Yo,d8 as vr,d9 as Lf,da as Hn,db as ua,dc as wi,dd as es,de as ns,df as Fr,dg as Cr,dh as _f,di as Af,dj as ee,dk as It,dl as rl,dm as as,dn as ol,dp as sl,dq as ls,dr as wf,ds as Rf,dt as Ri,du as Ef,dv as Mf,dw as Vf,dx as zf,dy as Nf,dz as Dl,dA as ts,dB as is,dC as $f,dD as jf,dE as Kr,dF as Of,dG as Qf,dH as Bf,dI as qf,dJ as Uf,dK as Hf,dL as rs,dM as Gf,dN as Wf,dO as Jf,dP as Xf,dQ as Zf,dR as za,dS as Ei,dT as os,dU as Ja,dV as Qt,dW as Yf,dX as eh,dY as Mi,dZ as Dt,d_ as Mn,d$ as Yl,e0 as ss,e1 as nh,e2 as ah,e3 as ds,e4 as cs,e5 as lh,e6 as us,e7 as Vi,e8 as th,e9 as Tr,ea as ih,eb as rh,ec as oh,ed as sh,ee as dh,ef as ch,eg as Bt,eh as ms,ei as uh,ej as zi,ek as Ni,el as mh,em as Xa,en as gh,eo as ph,ep as yh,eq as gs,er as zl,es as fh,et as hh,eu as kh,ev as ps,ew as Pr,ex as bh,ey as Sh,ez as vh,eA as Fh,eB as ys,eC as Ch,eD as Kh,eE as Th,eF as xr,eG as Ir}from"./components-CKFZdR5A.js";import{g as _a,i as Aa,d as Ph,E as fs,R as wa,k as $i,b as xh,p as Nl,n as hs}from"./vendor-codemirror-BxoXtD6f.js";import{P as ks,C as bs,T as Gn,a as Ss,R as wn,X as Wn,Y as hn,b as Jn,B as Fa,c as Lt,d as dl,A as Ll,e as vs,L as ji,f as Ih}from"./vendor-recharts-Cl8AO7Np.js";const Dh=4,Lh="Unable to parse span input messages, expected messages which include a role and content.",_h="Unable to parse span output messages, expected messages which include a role and content.",Ah="Unable to parse span output expected output.value to be present.",wh="Unable to parse span attributes, attributes must be valid JSON.",Rh="Unable to parse model config, expected llm.model_name to be present.",Eh="Unable to parse model config, expected llm.invocation_parameters JSON string to be present.",Mh="Unable to parse invocation parameters response_format, expected llm.invocation_parameters.response_format to be a well formed json object or undefined.",Vh="Unable to parse tools, expected tools to be an array of valid tools.",zh="Unable to parse prompt template variables, expected prompt template variables to be a valid JSON object string.",Dr={AZURE_OPENAI:[],ANTHROPIC:["claude"],OPENAI:["gpt","o1"],GOOGLE:["gemini"],DEEPSEEK:["deepseek"],XAI:["grok"],OLLAMA:[]},ba="TOOL_CHOICE",Za="tool_choice",Nn="RESPONSE_FORMAT",Vn="response_format",Nh=[ba,Nn],$h=E.object({tool_call:E.object({id:E.string().optional(),function:E.object({name:E.string(),arguments:E.string()}).partial()}).partial()}).partial(),Fs=E.object({[Se.message]:E.object({[$e.role]:E.string(),[$e.content]:E.union([E.string(),E.array(E.record(E.string(),E.unknown()))]).default(""),[$e.contents]:E.array(E.object({message_content:E.record(E.string())})).optional(),[$e.tool_calls]:E.array($h).optional(),[$e.tool_call_id]:E.string().optional()})}),jh=E.object({[Se.llm]:E.object({[qe.input_messages]:E.array(Fs)})}),Oh=E.object({[Se.llm]:E.object({[qe.output_messages]:E.array(Fs)})}),Qh=E.object({[Se.output]:E.object({value:E.string()})}),Cs=iy()(E.enum(["user","ai","system","tool"])),Bh=E.object({id:E.number(),role:Cs,content:E.string().optional(),toolCallId:E.string().optional(),toolCalls:E.array(ry).optional()}),qh=E.array(Bh),Ks=E.lazy(()=>E.record(ki)),Uh=Ks,Ts=E.string().transform((n,a)=>{const{json:l}=Be(n);if(!bi(l))return a.addIssue({code:E.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),E.NEVER;const{success:t,data:i}=Uh.safeParse(l);return t?i:(a.addIssue({code:E.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),E.NEVER)}).default("{}"),Hh=E.object({[Se.llm]:E.object({[qe.provider]:E.string().optional(),[qe.model_name]:E.string()})}),Ps=E.object({[Se.llm]:E.object({[qe.invocation_parameters]:Ts})}),Gh=E.object({[Se.llm]:E.object({[qe.invocation_parameters]:Ts.pipe(E.object({response_format:Ks.optional()}))})}),Wh=E.object({url:E.object({full:E.string(),path:E.string().optional()})}),Jh=E.string().transform((n,a)=>{const{json:l}=Be(n);return l==null||!bi(l)?(a.addIssue({code:E.ZodIssueCode.custom,message:"The tool JSON schema must be a valid JSON object"}),E.NEVER):l}).transform((n,a)=>{const{data:l,success:t}=oy.safeParse(n);return t?l:(a.addIssue({code:E.ZodIssueCode.custom,message:"The tool JSON schema must be a valid tool schema"}),E.NEVER)}),Xh=E.object({[Se.llm]:E.object({[qe.tools]:E.array(E.object({[Se.tool]:E.object({[Gl.json_schema]:Jh})}).optional()).optional()}).optional()}).optional(),Zh=E.lazy(()=>E.object({type:E.literal("json_schema"),json_schema:E.object({name:E.string().describe("The name of the schema"),schema:sy.describe("The schema itself in JSON schema format"),strict:E.literal(!0).describe("The schema must be strict")})})),Yh=at(Zh,{removeAdditionalStrategy:"passthrough"}),e0=E.string().transform((n,a)=>{const{json:l}=Be(n);return va(l)?Object.entries(l).reduce((i,[r,s])=>{if(typeof s=="string")i[r]=s;else{const{json:d}=jn(s);d!=null&&(i[r]=d)}return i},{}):(a.addIssue({code:E.ZodIssueCode.custom,message:"The prompt template variables must be a valid JSON object"}),E.NEVER)}),n0=E.object({[Se.llm]:E.object({[qe.prompt_template]:E.object({variables:e0}).optional()}).optional()}).optional();function xs(n){return Cs.safeParse(n).success}function pa(n){const a=n.toLowerCase();if(xs(a))return a;for(const[l,t]of Object.entries(Wl))if(t.includes(a))return l;return dy}function a0({toolCalls:n,provider:a}){if(n!=null)return n.map(({tool_call:l})=>{var i,r,s,d;if(l==null)return null;let t={};if(((i=l.function)==null?void 0:i.arguments)!=null){const{json:c}=Be(l.function.arguments);va(c)&&(t=c)}switch(a){case"OPENAI":case"AZURE_OPENAI":case"DEEPSEEK":case"XAI":case"OLLAMA":return{id:l.id??"",type:"function",function:{name:((r=l.function)==null?void 0:r.name)??"",arguments:t}};case"ANTHROPIC":return{id:l.id??"",type:"tool_use",name:((s=l.function)==null?void 0:s.name)??"",input:t};case"GOOGLE":return{id:l.id??"",function:{name:((d=l.function)==null?void 0:d.name)??"",arguments:t}};default:Te()}}).filter(l=>l!=null)}function Is({messages:n,provider:a}){return n.map(({message:l})=>{var t,i;return{id:fa(),role:l.tool_call_id!=null?pa("tool"):pa(l.role),content:Array.isArray(l.contents)?((i=(t=l.contents.find(r=>r.message_content.type==="text"))==null?void 0:t.message_content)==null?void 0:i.text)??void 0:typeof l.content=="string"?l.content:void 0,toolCalls:a0({provider:a,toolCalls:l.tool_calls}),toolCallId:l.tool_call_id}})}function l0({provider:n,parsedAttributes:a}){var t;const l=jh.safeParse(a);if(!l.success)return{messageParsingErrors:[Lh],messages:null};if(n==="ANTHROPIC"){const{success:i,data:r}=Ps.safeParse(a);if(i){const s=l.data.llm.input_messages,d=(t=r.llm.invocation_parameters)==null?void 0:t.system;typeof d=="string"&&d&&(!s||s[0].message.role!=="system")&&l.data.llm.input_messages.unshift({message:{role:"system",content:d}})}}return{messageParsingErrors:[],messages:Is({provider:n,messages:l.data.llm.input_messages})}}function t0({provider:n,parsedAttributes:a}){const l=[],t=Oh.safeParse(a);if(t.success)return{output:Is({provider:n,messages:t.data.llm.output_messages}),outputParsingErrors:l};l.push(_h);const i=Qh.safeParse(a);return i.success?{output:i.data.output.value,outputParsingErrors:l}:(l.push(Ah),{output:void 0,outputParsingErrors:l})}function Ds(n){if(n==null)return null;switch(n.toLowerCase()){case"openai":return"OPENAI";case"anthropic":return"ANTHROPIC";case"google":return"GOOGLE";case"azure":return"AZURE_OPENAI";default:return null}}function i0(n){for(const a of Object.keys(Dr))if(Dr[a].some(t=>n.includes(t)))return a;return bo}function r0(n){const{success:a,data:l}=Hh.safeParse(n);if(a){const t=Ds(l.llm.provider)||i0(l.llm.model_name),i=o0(n);return{modelConfig:{...Object.fromEntries(Object.entries(i).filter(([r,s])=>s!==null)),modelName:l.llm.model_name,provider:t,invocationParameters:[],supportedInvocationParameters:[]},parsingErrors:[]}}return{modelConfig:null,parsingErrors:[Rh]}}function o0(n){const{success:a,data:l}=Wh.safeParse(n);if(a)try{const t=new URL(l.url.full);let i=t;if(l.url.path)try{i=new URL(l.url.full.split(l.url.path)[0])}catch{}return{baseUrl:`${i.origin}${i.pathname}`,endpoint:t.origin,apiVersion:t.searchParams.get("api-version")||null}}catch{}return{baseUrl:null,apiVersion:null,endpoint:null}}function s0(n,a=[]){const{success:l,data:t}=Ps.safeParse(n),i=[];return l||i.push(Eh),{invocationParameters:h0((t==null?void 0:t.llm.invocation_parameters)??{},a),parsingErrors:i}}function d0(n){const{success:a,data:l}=Gh.safeParse(n);return a?{responseFormat:l.llm.invocation_parameters.response_format,parsingErrors:[]}:{responseFormat:void 0,parsingErrors:[Mh]}}function c0(n){var a;return(((a=n==null?void 0:n.llm)==null?void 0:a.tools)??[]).map(l=>(l==null?void 0:l.tool)==null?null:{id:vl(),definition:l.tool.json_schema}).filter(l=>l!=null)}function u0(n){var t;const{data:a,success:l}=Xh.safeParse(n);return l?((t=a==null?void 0:a.llm)==null?void 0:t.tools)==null?{tools:null,parsingErrors:[]}:{tools:c0(a),parsingErrors:[]}:{tools:null,parsingErrors:[Vh]}}function m0(n){var t;const{success:a,data:l}=n0.safeParse(n);return a?((t=l==null?void 0:l.llm)==null?void 0:t.prompt_template)==null?{variables:null,parsingErrors:[]}:{variables:l.llm.prompt_template.variables,parsingErrors:[]}:{variables:null,parsingErrors:[zh]}}function g0(n){const{instance:a,instanceMessages:l}=ko(),t={...a,template:{__type:"chat",messages:Object.values(l)}},{json:i,parseError:r}=Be(n.attributes);if(r)return{playgroundInstance:{...t,spanId:(n==null?void 0:n.id)??null},parsingErrors:[wh]};const s=n.invocationParameters,d=r0(i);let{modelConfig:c}=d;const{parsingErrors:g}=d,{messages:f,messageParsingErrors:u}=l0({provider:(c==null?void 0:c.provider)??t.model.provider,parsedAttributes:i}),{output:p,outputParsingErrors:y}=t0({provider:(c==null?void 0:c.provider)??t.model.provider,parsedAttributes:i}),{invocationParameters:h,parsingErrors:k}=s0(i,s),{variables:S,parsingErrors:K}=m0(i),{parsingErrors:T}=d0(i);c=c!=null?{...c,invocationParameters:T.length>0?h.filter(V=>V.invocationName!==Vn&&V.canonicalName!==Nn):h}:null;const{tools:L,parsingErrors:x}=u0(i),w=f==null?void 0:f.map(V=>({...V,content:V.role==="tool"?Oi(V.content):V.content}));return{playgroundInstance:{...t,model:c??t.model,template:w!=null?{__type:"chat",messages:w}:t.template,output:p,spanId:n.id,tools:L??t.tools},playgroundInput:S!=null?{variablesValueCache:S}:void 0,parsingErrors:[...u,...y,...g,...x,...k,...T,...K]}}const p0=n=>qh.safeParse(n).success,Ls=({instance:n,templateFormat:a})=>{if(a==bn.NONE)return[];const l=new Set,t=n.template.__type,i=cy(a);switch(t){case"chat":{n.template.messages.forEach(r=>{(r.content==null?[]:i.extractVariables(r.content)).forEach(d=>{l.add(d)})});break}case"text_completion":{i.extractVariables(n.template.prompt).forEach(s=>{l.add(s)});break}default:Te()}return Array.from(l)},y0=({instances:n,templateFormat:a})=>a==bn.NONE?[]:Array.from(new Set(n.flatMap(l=>Ls({instance:l,templateFormat:a})))),_s=({instances:n,templateFormat:a,input:l})=>{if(a==bn.NONE)return{variablesMap:{},variableKeys:[]};const t=y0({instances:n,templateFormat:a}),i=l.variablesValueCache??{};return{variablesMap:t.reduce((s,d)=>(s[d]=i[d]||"",s),{}),variableKeys:t}};function Ca(n,a){return n.invocationName===a.invocationName||n.canonicalName!=null&&a.canonicalName!=null&&n.canonicalName===a.canonicalName}const f0=(n,a)=>n.filter(l=>a.some(t=>Ca(t,l))).map(l=>{var t;return{...l,invocationName:((t=a.find(i=>Ca(i,l)))==null?void 0:t.invocationName)??l.invocationName}}),cl=n=>n.replace(/_([a-z])/g,(a,l)=>l.toUpperCase()),h0=(n,a)=>Object.entries(n).map(([l,t])=>{const i=a.find(r=>r.canonicalName&&r.canonicalName.toLowerCase()===l.toLowerCase()||r.invocationName&&r.invocationName.toLowerCase()===l.toLowerCase());return i==null||i.invocationInputField==null||i.invocationName==null?null:{canonicalName:i.canonicalName,invocationName:i.invocationName,[cl(i.invocationInputField)]:t}}).filter(l=>l!=null),As=n=>{const{provider:a,validatedToolDefinition:l}=gy(n.definition);switch(a){case"OPENAI":case"AZURE_OPENAI":return l.function.name;case"ANTHROPIC":return l.name;case"UNKNOWN":return null;default:Te()}},k0=({provider:n,toolNumber:a})=>{switch(n){case"OPENAI":case"DEEPSEEK":case"XAI":case"OLLAMA":case"AZURE_OPENAI":return{id:vl(),definition:fr(a)};case"ANTHROPIC":return{id:vl(),definition:my(a)};case"GOOGLE":return{id:vl(),definition:fr(a)};default:Te()}},b0=n=>{switch(n){case"OPENAI":case"AZURE_OPENAI":case"DEEPSEEK":case"XAI":case"OLLAMA":return yr();case"ANTHROPIC":return uy();case"GOOGLE":return yr();default:Te()}};function S0(n){return{content:n.content,role:v0(n.role),toolCalls:n.toolCalls,toolCallId:n.toolCallId}}function v0(n){switch(n){case"system":return"SYSTEM";case"user":return"USER";case"tool":return"TOOL";case"ai":return"AI";default:Te()}}const ws=({playgroundStore:n,instanceId:a,credentials:l})=>{var u;const{instances:t,allInstanceMessages:i}=n.getState(),r=t.find(p=>p.id===a);if(!r)throw new Error(`No instance found for id ${a}`);if(r.template.__type!=="chat")throw new Error("We only support chat templates for now");const s=r.template.messageIds.map(p=>i[p]).filter(p=>p!=null),d=r.model.supportedInvocationParameters;let c=[...r.model.invocationParameters];const g=Si({toolChoice:r.toolChoice,targetProvider:r.model.provider});r.tools.length>0?(c=c.filter(p=>p.invocationName!==Za&&p.canonicalName!==ba),c.push({canonicalName:ba,invocationName:Za,valueJson:g})):c=c.filter(p=>p.invocationName!==Za&&p.canonicalName!==ba),c=d.length?f0(c,d):c;const f=r.model.provider==="AZURE_OPENAI"?{endpoint:r.model.endpoint,apiVersion:r.model.apiVersion}:{};return{messages:s.map(S0),model:{providerKey:r.model.provider,name:r.model.modelName||"",baseUrl:r.model.baseUrl,...f},invocationParameters:Es(c,r.model.provider,r.model.modelName),tools:r.tools.length?r.tools.map(p=>p.definition):void 0,credentials:F0(l,r.model.provider),promptName:(u=r.prompt)==null?void 0:u.name}},_t=(n,a)=>{if(n.template.__type==="chat"){const{messageIds:l,...t}=n.template;return{...n,template:{...t,messages:n.template.messageIds.map(i=>a[i])}}}return n};function F0(n,a){const l=n[a],t=Rl[a];return l?t.length===0?[]:t.map(i=>({envVarName:i.envVarName,value:l[i.envVarName]??""})):[]}const C0=({playgroundStore:n,instanceId:a,credentials:l})=>{const t=ws({playgroundStore:n,instanceId:a,credentials:l}),{instances:i,templateFormat:r,input:s,allInstanceMessages:d}=n.getState(),c=i.map(f=>_t(f,d)),{variablesMap:g}=_s({instances:c,input:s,templateFormat:r});return{...t,template:{variables:g,format:r}}},Lr=({playgroundStore:n,instanceId:a,credentials:l,datasetId:t})=>({...ws({playgroundStore:n,instanceId:a,credentials:l}),templateFormat:n.getState().templateFormat,datasetId:t});function Oi(n){if(typeof n=="string"){const a=n.startsWith('"{')||n.startsWith('"[')||n.startsWith('"\\"');try{if(a){const t=JSON.parse(n),i=typeof t=="string"?JSON.parse(t):t;return JSON.stringify(i,null,2)}}catch{}if(/^\s*[0-9{[]|true|false|null/.test(n))return n}return JSON.stringify(n,null,2)}function Rs(n,a){return a.filter(l=>l.required).every(l=>n.some(t=>Ca(t,l)))}const K0=n=>{for(const[a,l]of Object.entries(n))if(a.endsWith("DefaultValue")&&l!=null)return n[a]};function yT(n,a){const l=new Map(n.map(t=>[t.invocationName,t]));return a.forEach(t=>{var c;const i=t.invocationName,r=K0(t),s=cl(t.invocationInputField||"");if(!t.invocationName||!t.invocationInputField||!i||r==null||((c=l.get(i))==null?void 0:c[s])!=null)return;const d={canonicalName:t.canonicalName,invocationName:t.invocationName,[s]:r};l.set(i,d)}),Array.from(l.values())}const T0=E.object({type:E.literal("enabled")}).passthrough(),P0=E.object({type:E.enum(["any","tool"])}).passthrough(),x0=(n,a)=>{if(!a)return n;const l=n.some(t=>t.canonicalName==="ANTHROPIC_EXTENDED_THINKING"&&t.valueJson&&T0.safeParse(t.valueJson).success);return n.filter(t=>{if(t.canonicalName==="ANTHROPIC_EXTENDED_THINKING"&&!t.valueJson)return!1;if(l){if(t.canonicalName==="TEMPERATURE"||t.canonicalName==="TOP_P")return!1;if(t.canonicalName===ba)return!P0.safeParse(t.valueJson).success}return!0})},I0=["frequency_penalty","presence_penalty"],D0=n=>n.filter(l=>l.invocationName&&I0.includes(l.invocationName)?!(l.valueFloat==0||l.valueInt==0):!0),Es=(n,a,l)=>{const t=D0(n);return a==="ANTHROPIC"?x0(t,l):t},Ms=m.createContext(null);function fT({children:n,...a}){const[l]=m.useState(()=>py(a));return e(Ms.Provider,{value:l,children:n})}function Na(n,a){const l=m.useContext(Ms);if(!l)throw new Error("Missing CredentialsContext.Provider in the tree");return _l(l,n,a)}const Vs="arize-phoenix-feature-flags",qt={dashboards:!1};function L0(){const n=localStorage.getItem(Vs);if(!n)return qt;try{const a=JSON.parse(n);return Object.assign({},qt,a)}catch{return qt}}const zs=m.createContext(null);function Ns(){const n=fn.useContext(zs);if(n===null)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return n}function _0(n){const{featureFlags:a}=Ns();return a[n]}function hT(n){const[a,l]=m.useState(L0()),t=i=>{localStorage.setItem(Vs,JSON.stringify(i)),l(i)};return e(zs.Provider,{value:{featureFlags:a,setFeatureFlags:t},children:e(A0,{children:n.children})})}function A0(n){const{children:a}=n,{featureFlags:l,setFeatureFlags:t}=Ns(),[i,r]=m.useState(!1);return Sa("ctrl+shift+f",()=>r(!0)),o(J,{children:[a,e(ue,{type:"modal",isDismissable:!0,onDismiss:()=>r(!1),children:i&&e(oe,{title:"Feature Flags",children:e(v,{height:"size-1000",padding:"size-100",children:Object.keys(l).map(s=>e(xa,{isSelected:l[s],onChange:d=>t({...l,[s]:d}),children:s},s))})})})]})}const $s=m.createContext(null);function w0(){const n=m.useContext($s);if(n===null)throw new Error("useFunctionality must be used within a FunctionalityProvider");return n}function kT(n){return e($s.Provider,{value:{authenticationEnabled:window.Config.authenticationEnabled},children:n.children})}const js={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"GenerativeProvidersCard_data",selections:[{alias:null,args:null,concreteType:"GenerativeProvider",kind:"LinkedField",name:"modelProviders",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dependenciesInstalled",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dependencies",storageKey:null},{alias:null,args:null,concreteType:"GenerativeProviderCredentialConfig",kind:"LinkedField",name:"credentialRequirements",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"envVarName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isRequired",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"credentialsSet",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};js.hash="4062531cfa3f77e541172a44101f5331";function R0({query:n}){const[a,l]=m.useState(null),t=Na(g=>g),i=P.useFragment(js,n),r=m.useMemo(()=>[...i.modelProviders],[i]),s=m.useMemo(()=>[{header:"Name",accessorKey:"name",cell:({row:g})=>o(b,{direction:"row",alignItems:"center",gap:"size-100",children:[e(El,{provider:g.original.key,height:18}),g.original.name]})},{header:"Environment Variables",accessorKey:"apiKeyEnvVar",cell:({row:g})=>{const f=Rl[g.original.key],u=(f==null?void 0:f.map(p=>p.envVarName).join(", "))||g.original.credentialRequirements.map(p=>p.envVarName).join(", ")||"--";return e(F,{children:u})}},{header:"configuration",accessorKey:"credentialsSet",cell:({row:g})=>{if(!g.original.dependenciesInstalled)return e(F,{color:"warning",children:"missing dependencies"});const f=g.original.credentialRequirements,u=t[g.original.key];return f.every(({envVarName:y,isRequired:h})=>(u==null?void 0:u[y])!==void 0||!h)?e(F,{color:"success",children:"local"}):g.original.credentialsSet?e(F,{color:"success",children:"configured on the server"}):e(F,{color:"text-700",children:"not configured"})}},{header:"",accessorKey:"id",cell:({row:g})=>e(b,{direction:"row",justifyContent:"end",gap:"size-100",width:"100%",children:e(M,{size:"S",leadingVisual:e(D,{svg:e(ja,{})}),onPress:()=>{l(g.original)}})})}],[t]),d=Ce({columns:s,data:r,getCoreRowModel:Ke(),getSortedRowModel:ln()}),c=d.getRowModel().rows;return o(q,{title:"AI Providers",bodyStyle:{padding:0},variant:"compact",children:[o("table",{css:We,children:[e("thead",{children:d.getHeaderGroups().map(g=>e("tr",{children:g.headers.map(f=>e("th",{colSpan:f.colSpan,children:f.isPlaceholder?null:e("div",{children:W(f.column.columnDef.header,f.getContext())})},f.id))},g.id))}),e("tbody",{children:c.map(g=>e("tr",{children:g.getVisibleCells().map(f=>e("td",{children:W(f.column.columnDef.cell,f.getContext())},f.id))},g.id))})]}),e(ue,{type:"modal",isDismissable:!0,onDismiss:()=>l(null),children:a&&e(oe,{title:`Configure ${a.name} Credentials`,size:"S",children:o(v,{padding:"size-200",children:[e(v,{paddingBottom:"size-100",children:o(F,{size:"XS",children:["Set the credentials for the ",a.name," API. These credentials will be stored entirely in your browser and will only be sent to the server during API requests."]})}),o(gn,{onSubmit:g=>{g.preventDefault(),l(null)},children:[e(E0,{provider:a.key}),e(v,{paddingTop:"size-200",children:o(b,{direction:"row",justifyContent:"end",gap:"size-100",children:[e(M,{variant:"default",size:"S",onPress:()=>{l(null)},children:"Cancel"}),e(M,{variant:"primary",size:"S",onPress:()=>{l(null)},children:"Save Credentials"})]})})]})]})})})]})}function E0({provider:n}){const a=Na(i=>i.setCredential),l=Rl[n],t=Na(i=>i[n]);return e(b,{direction:"column",gap:"size-100",children:l.map(i=>o(vo,{isRequired:i.isRequired,onChange:r=>{a({provider:n,envVarName:i.envVarName,value:r})},value:(t==null?void 0:t[i.envVarName])??void 0,children:[e(H,{children:i.envVarName}),e(So,{})]},i.envVarName))})}function bT(){const n=Me();return Oe(n),e(R0,{query:n})}const Os={fragment:{argumentDefinitions:[],kind:"Fragment",metadata:null,name:"settingsAIProvidersPageLoaderQuery",selections:[{args:null,kind:"FragmentSpread",name:"GenerativeProvidersCard_data"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"settingsAIProvidersPageLoaderQuery",selections:[{alias:null,args:null,concreteType:"GenerativeProvider",kind:"LinkedField",name:"modelProviders",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dependenciesInstalled",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dependencies",storageKey:null},{alias:null,args:null,concreteType:"GenerativeProviderCredentialConfig",kind:"LinkedField",name:"credentialRequirements",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"envVarName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"isRequired",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"credentialsSet",storageKey:null}],storageKey:null}]},params:{cacheID:"1238ea27e05b70fd2c203ab4be6a1209",id:null,metadata:{},name:"settingsAIProvidersPageLoaderQuery",operationKind:"query",text:`query settingsAIProvidersPageLoaderQuery {
|
|
2
2
|
...GenerativeProvidersCard_data
|
|
3
3
|
}
|
|
4
4
|
|
|
@@ -1069,7 +1069,7 @@ fragment ProjectTraceRetentionPolicySelectFragment on Query {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
1071
|
}
|
|
1072
|
-
`}}}();Md.hash="3d4a317421ae07c5ad4ddd7f22b99771";const Vd=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i=[{kind:"Literal",name:"first",value:30},{kind:"Literal",name:"sort",value:{col:"startTime",dir:"desc"}},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],r=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectPageQueriesSessionsQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"SessionsTable_sessions"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectPageQueriesSessionsQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:i,concreteType:"ProjectSessionConnection",kind:"LinkedField",name:"sessions",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectSessionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"session",args:null,concreteType:"ProjectSession",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"sessionId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"numTraces",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"firstInput",plural:!1,selections:r,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"lastOutput",plural:!1,selections:r,storageKey:null},{alias:null,args:null,concreteType:"TokenUsage",kind:"LinkedField",name:"tokenUsage",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null}],storageKey:null},{alias:"traceLatencyMsP50",args:[{kind:"Literal",name:"probability",value:.5}],kind:"ScalarField",name:"traceLatencyMsQuantile",storageKey:"traceLatencyMsQuantile(probability:0.5)"},{alias:"traceLatencyMsP99",args:[{kind:"Literal",name:"probability",value:.99}],kind:"ScalarField",name:"traceLatencyMsQuantile",storageKey:"traceLatencyMsQuantile(probability:0.99)"}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ProjectSession",kind:"LinkedField",name:"node",plural:!1,selections:[l,t],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},{alias:null,args:i,filters:["sort","filterIoSubstring","timeRange"],handle:"connection",key:"SessionsTable_sessions",kind:"LinkedHandle",name:"sessions"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"f6148dfd72fd9ac4e48b8cc3e29167e6",id:null,metadata:{},name:"ProjectPageQueriesSessionsQuery",operationKind:"query",text:`query ProjectPageQueriesSessionsQuery(
|
|
1072
|
+
`}}}();Md.hash="3d4a317421ae07c5ad4ddd7f22b99771";const Vd=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"id"},{defaultValue:null,kind:"LocalArgument",name:"timeRange"}],a=[{kind:"Variable",name:"id",variableName:"id"}],l={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},i=[{kind:"Literal",name:"first",value:30},{kind:"Literal",name:"sort",value:{col:"startTime",dir:"desc"}},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],r=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}];return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"ProjectPageQueriesSessionsQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"SessionsTable_sessions"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"ProjectPageQueriesSessionsQuery",selections:[{alias:"project",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:i,concreteType:"ProjectSessionConnection",kind:"LinkedField",name:"sessions",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectSessionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"session",args:null,concreteType:"ProjectSession",kind:"LinkedField",name:"node",plural:!1,selections:[t,{alias:null,args:null,kind:"ScalarField",name:"sessionId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"numTraces",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"firstInput",plural:!1,selections:r,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"lastOutput",plural:!1,selections:r,storageKey:null},{alias:null,args:null,concreteType:"TokenUsage",kind:"LinkedField",name:"tokenUsage",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null}],storageKey:null},{alias:"traceLatencyMsP50",args:[{kind:"Literal",name:"probability",value:.5}],kind:"ScalarField",name:"traceLatencyMsQuantile",storageKey:"traceLatencyMsQuantile(probability:0.5)"},{alias:"traceLatencyMsP99",args:[{kind:"Literal",name:"probability",value:.99}],kind:"ScalarField",name:"traceLatencyMsQuantile",storageKey:"traceLatencyMsQuantile(probability:0.99)"}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ProjectSession",kind:"LinkedField",name:"node",plural:!1,selections:[l,t],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},{alias:null,args:i,filters:["sort","filterIoSubstring","timeRange","sessionId"],handle:"connection",key:"SessionsTable_sessions",kind:"LinkedHandle",name:"sessions"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"f6148dfd72fd9ac4e48b8cc3e29167e6",id:null,metadata:{},name:"ProjectPageQueriesSessionsQuery",operationKind:"query",text:`query ProjectPageQueriesSessionsQuery(
|
|
1073
1073
|
$id: ID!
|
|
1074
1074
|
$timeRange: TimeRange!
|
|
1075
1075
|
) {
|
|
@@ -5024,24 +5024,25 @@ fragment StreamToggle_data on Project {
|
|
|
5024
5024
|
}
|
|
5025
5025
|
}
|
|
5026
5026
|
}
|
|
5027
|
-
`;function aP(){const{projectId:n}=Qe(),{timeRange:a}=Ct();return e(m.Suspense,{fallback:e(ge,{}),children:e(yC,{projectId:n,timeRange:a})})}const pC=["spans","traces","sessions","config"],ao=n=>pC.includes(n),lo={spans:0,traces:1,sessions:2,config:3};function yC({projectId:n,timeRange:a}){const l=Pl(V=>V.treatOrphansAsRoots),t=m.useMemo(()=>{var V,Q;return{start:(V=a==null?void 0:a.start)==null?void 0:V.toISOString(),end:(Q=a==null?void 0:a.end)==null?void 0:Q.toISOString()}},[a]),i=ce(),{rootPath:r,tab:s}=zt(),d=P.useLazyLoadQuery(Fm,{id:n,timeRange:t},{fetchPolicy:"store-and-network",fetchKey:`${n}-${t.start}-${t.end}`}),[c,g,f]=P.useQueryLoader($d),[u,p,y]=P.useQueryLoader(jd),[h,k,S]=P.useQueryLoader(Od),[K,T,L]=P.useQueryLoader(Qd),x=ao(s)?lo[s]:0;m.useEffect(()=>(x===0?p({id:n,timeRange:t,orphanSpanAsRootSpan:l}):x===1?g({id:n,timeRange:t}):x===2?k({id:n,timeRange:t}):x===3&&T({id:n}),()=>{y(),S(),f(),L()}),[g,n,t,x,y,S,f,p,k,T,L,l]);const w=m.useCallback(V=>{m.startTransition(()=>{i(V===1?`${r}/traces`:V===2?`${r}/sessions`:V===3?`${r}/config`:`${r}/spans`)})},[i,r]);return e(mb,{children:o("main",{css:gC,children:[e(dC,{project:d.project,extra:o(b,{direction:"row",alignItems:"center",gap:"size-100",children:[e(mC,{project:d.project}),e(mt,{})]})}),e(Bd.Provider,{value:{spansQueryReference:u??null,sessionsQueryReference:h??null,tracesQueryReference:c??null,projectConfigQueryReference:K??null},children:o(cn,{onSelectionChange:V=>{typeof V=="string"&&ao(V)&&w(lo[V])},selectedKey:s,children:[o(dn,{children:[e(le,{id:"spans",children:"Spans"}),e(le,{id:"traces",children:"Traces"}),e(le,{id:"sessions",children:"Sessions"}),e(le,{id:"config",children:"Config"})]}),e(re,{padded:!1,id:"spans",children:e(ve,{})}),e(re,{padded:!1,id:"traces",children:e(ve,{})}),e(re,{padded:!1,id:"sessions",children:e(ve,{})}),e(re,{padded:!1,id:"config",children:e(ve,{})})]})})]})})}const Lm=m.createContext(null);function _m(){const n=m.useContext(Lm);if(n===null)throw new Error("useSessionSubstring must be used within a SessionSubstringProvider");return n}function fC(n){const[a,l]=m.useState(""),t=m.useCallback(i=>{m.startTransition(()=>{l(i)})},[]);return e(Lm.Provider,{value:{
|
|
5027
|
+
`;function aP(){const{projectId:n}=Qe(),{timeRange:a}=Ct();return e(m.Suspense,{fallback:e(ge,{}),children:e(yC,{projectId:n,timeRange:a})})}const pC=["spans","traces","sessions","config"],ao=n=>pC.includes(n),lo={spans:0,traces:1,sessions:2,config:3};function yC({projectId:n,timeRange:a}){const l=Pl(V=>V.treatOrphansAsRoots),t=m.useMemo(()=>{var V,Q;return{start:(V=a==null?void 0:a.start)==null?void 0:V.toISOString(),end:(Q=a==null?void 0:a.end)==null?void 0:Q.toISOString()}},[a]),i=ce(),{rootPath:r,tab:s}=zt(),d=P.useLazyLoadQuery(Fm,{id:n,timeRange:t},{fetchPolicy:"store-and-network",fetchKey:`${n}-${t.start}-${t.end}`}),[c,g,f]=P.useQueryLoader($d),[u,p,y]=P.useQueryLoader(jd),[h,k,S]=P.useQueryLoader(Od),[K,T,L]=P.useQueryLoader(Qd),x=ao(s)?lo[s]:0;m.useEffect(()=>(x===0?p({id:n,timeRange:t,orphanSpanAsRootSpan:l}):x===1?g({id:n,timeRange:t}):x===2?k({id:n,timeRange:t}):x===3&&T({id:n}),()=>{y(),S(),f(),L()}),[g,n,t,x,y,S,f,p,k,T,L,l]);const w=m.useCallback(V=>{m.startTransition(()=>{i(V===1?`${r}/traces`:V===2?`${r}/sessions`:V===3?`${r}/config`:`${r}/spans`)})},[i,r]);return e(mb,{children:o("main",{css:gC,children:[e(dC,{project:d.project,extra:o(b,{direction:"row",alignItems:"center",gap:"size-100",children:[e(mC,{project:d.project}),e(mt,{})]})}),e(Bd.Provider,{value:{spansQueryReference:u??null,sessionsQueryReference:h??null,tracesQueryReference:c??null,projectConfigQueryReference:K??null},children:o(cn,{onSelectionChange:V=>{typeof V=="string"&&ao(V)&&w(lo[V])},selectedKey:s,children:[o(dn,{children:[e(le,{id:"spans",children:"Spans"}),e(le,{id:"traces",children:"Traces"}),e(le,{id:"sessions",children:"Sessions"}),e(le,{id:"config",children:"Config"})]}),e(re,{padded:!1,id:"spans",children:e(ve,{})}),e(re,{padded:!1,id:"traces",children:e(ve,{})}),e(re,{padded:!1,id:"sessions",children:e(ve,{})}),e(re,{padded:!1,id:"config",children:e(ve,{})})]})})]})})}const Lm=m.createContext(null);function _m(){const n=m.useContext(Lm);if(n===null)throw new Error("useSessionSubstring must be used within a SessionSubstringProvider");return n}function fC(n){const[a,l]=m.useState(""),t=m.useCallback(i=>{m.startTransition(()=>{l(i)})},[]);return e(Lm.Provider,{value:{filterIoSubstringOrSessionId:a,setFilterIoSubstringOrSessionId:t},children:n.children})}const Am=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterIoSubstring"},l={defaultValue:30,kind:"LocalArgument",name:"first"},t={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:null,kind:"LocalArgument",name:"sessionId"},r={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},s={defaultValue:null,kind:"LocalArgument",name:"timeRange"},d=[{kind:"Variable",name:"id",variableName:"id"}],c={kind:"Variable",name:"after",variableName:"after"},g={kind:"Variable",name:"filterIoSubstring",variableName:"filterIoSubstring"},f={kind:"Variable",name:"first",variableName:"first"},u={kind:"Variable",name:"sessionId",variableName:"sessionId"},p={kind:"Variable",name:"sort",variableName:"sort"},y={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},k=[c,g,f,u,p,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],S=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}];return{fragment:{argumentDefinitions:[n,a,l,t,i,r,s],kind:"Fragment",metadata:null,name:"SessionsTableQuery",selections:[{alias:null,args:d,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[c,g,f,u,p],kind:"FragmentSpread",name:"SessionsTable_sessions"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,l,i,r,s,t],kind:"Operation",name:"SessionsTableQuery",selections:[{alias:null,args:d,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[y,h,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:k,concreteType:"ProjectSessionConnection",kind:"LinkedField",name:"sessions",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectSessionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"session",args:null,concreteType:"ProjectSession",kind:"LinkedField",name:"node",plural:!1,selections:[h,{alias:null,args:null,kind:"ScalarField",name:"sessionId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"numTraces",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"firstInput",plural:!1,selections:S,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"lastOutput",plural:!1,selections:S,storageKey:null},{alias:null,args:null,concreteType:"TokenUsage",kind:"LinkedField",name:"tokenUsage",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null}],storageKey:null},{alias:"traceLatencyMsP50",args:[{kind:"Literal",name:"probability",value:.5}],kind:"ScalarField",name:"traceLatencyMsQuantile",storageKey:"traceLatencyMsQuantile(probability:0.5)"},{alias:"traceLatencyMsP99",args:[{kind:"Literal",name:"probability",value:.99}],kind:"ScalarField",name:"traceLatencyMsQuantile",storageKey:"traceLatencyMsQuantile(probability:0.99)"}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ProjectSession",kind:"LinkedField",name:"node",plural:!1,selections:[y,h],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},{alias:null,args:k,filters:["sort","filterIoSubstring","timeRange","sessionId"],handle:"connection",key:"SessionsTable_sessions",kind:"LinkedHandle",name:"sessions"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"8e0c691fd84e82ab067bb818774e5592",id:null,metadata:{},name:"SessionsTableQuery",operationKind:"query",text:`query SessionsTableQuery(
|
|
5028
5028
|
$after: String = null
|
|
5029
5029
|
$filterIoSubstring: String = null
|
|
5030
5030
|
$first: Int = 30
|
|
5031
|
+
$sessionId: String = null
|
|
5031
5032
|
$sort: ProjectSessionSort = {col: startTime, dir: desc}
|
|
5032
5033
|
$timeRange: TimeRange
|
|
5033
5034
|
$id: ID!
|
|
5034
5035
|
) {
|
|
5035
5036
|
node(id: $id) {
|
|
5036
5037
|
__typename
|
|
5037
|
-
...
|
|
5038
|
+
...SessionsTable_sessions_371pAD
|
|
5038
5039
|
id
|
|
5039
5040
|
}
|
|
5040
5041
|
}
|
|
5041
5042
|
|
|
5042
|
-
fragment
|
|
5043
|
+
fragment SessionsTable_sessions_371pAD on Project {
|
|
5043
5044
|
name
|
|
5044
|
-
sessions(first: $first, after: $after, sort: $sort, filterIoSubstring: $filterIoSubstring, timeRange: $timeRange) {
|
|
5045
|
+
sessions(first: $first, after: $after, sort: $sort, filterIoSubstring: $filterIoSubstring, timeRange: $timeRange, sessionId: $sessionId) {
|
|
5045
5046
|
edges {
|
|
5046
5047
|
session: node {
|
|
5047
5048
|
id
|
|
@@ -5074,7 +5075,7 @@ fragment SessionsTable_sessions_2MhLSo on Project {
|
|
|
5074
5075
|
}
|
|
5075
5076
|
id
|
|
5076
5077
|
}
|
|
5077
|
-
`}}}();Am.hash="
|
|
5078
|
+
`}}}();Am.hash="c52b6e8a736a75aaebe4f63f960ad9c1";const wm=function(){var n=["sessions"],a={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l=[{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}];return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterIoSubstring"},{defaultValue:30,kind:"LocalArgument",name:"first"},{defaultValue:null,kind:"LocalArgument",name:"sessionId"},{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:Am,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"SessionsTable_sessions",selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:"sessions",args:[{kind:"Variable",name:"filterIoSubstring",variableName:"filterIoSubstring"},{kind:"Variable",name:"sessionId",variableName:"sessionId"},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"ProjectSessionConnection",kind:"LinkedField",name:"__SessionsTable_sessions_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"ProjectSessionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"session",args:null,concreteType:"ProjectSession",kind:"LinkedField",name:"node",plural:!1,selections:[a,{alias:null,args:null,kind:"ScalarField",name:"sessionId",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"numTraces",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"endTime",storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"firstInput",plural:!1,selections:l,storageKey:null},{alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"lastOutput",plural:!1,selections:l,storageKey:null},{alias:null,args:null,concreteType:"TokenUsage",kind:"LinkedField",name:"tokenUsage",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null}],storageKey:null},{alias:"traceLatencyMsP50",args:[{kind:"Literal",name:"probability",value:.5}],kind:"ScalarField",name:"traceLatencyMsQuantile",storageKey:"traceLatencyMsQuantile(probability:0.5)"},{alias:"traceLatencyMsP99",args:[{kind:"Literal",name:"probability",value:.99}],kind:"ScalarField",name:"traceLatencyMsQuantile",storageKey:"traceLatencyMsQuantile(probability:0.99)"}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"ProjectSession",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},a],type:"Project",abstractKey:null}}();wm.hash="c52b6e8a736a75aaebe4f63f960ad9c1";const Rm=m.createContext(null);function hC({children:n,...a}){const[l]=m.useState(()=>eh(a));return e(Rm.Provider,{value:l,children:n})}function en(n,a){const l=m.useContext(Rm);if(!l)throw new Error("Missing TracingContext.Provider in the tree");return _l(l,n,a)}const kC=C`
|
|
5078
5079
|
flex: 1 1 auto;
|
|
5079
5080
|
.cm-content {
|
|
5080
5081
|
padding: var(--ac-global-dimension-static-size-100) 0;
|
|
@@ -5105,7 +5106,7 @@ fragment SessionsTable_sessions_2MhLSo on Project {
|
|
|
5105
5106
|
border-color: var(--ac-global-color-danger);
|
|
5106
5107
|
}
|
|
5107
5108
|
box-sizing: border-box;
|
|
5108
|
-
`;function SC(n){const{placeholder:a="Search messages"}=n,[l,t]=m.useState(!1),{
|
|
5109
|
+
`;function SC(n){const{placeholder:a="Search messages or session ID"}=n,[l,t]=m.useState(!1),{filterIoSubstringOrSessionId:i,setFilterIoSubstringOrSessionId:r}=_m(),{theme:s}=ca();return e("div",{"data-is-focused":l,className:"sessions-substring-field",css:bC,children:o(b,{direction:"row",children:[e(fi,{children:e(D,{svg:e(Mi,{})})}),e(wa,{css:kC,indentWithTab:!1,basicSetup:{lineNumbers:!1,foldGutter:!1,bracketMatching:!1,syntaxHighlighting:!1,highlightActiveLine:!1,highlightActiveLineGutter:!1,defaultKeymap:!1},onFocus:()=>t(!0),onBlur:()=>t(!1),value:i,onChange:r,height:"36px",width:"100%",theme:s==="light"?_a:Aa,placeholder:a}),e("button",{css:C`
|
|
5109
5110
|
margin-right: var(--ac-global-dimension-static-size-100);
|
|
5110
5111
|
color: var(--ac-global-text-color-700);
|
|
5111
5112
|
visibility: ${i!==""?"visible":"hidden"};
|
|
@@ -5232,7 +5233,7 @@ await assistant({
|
|
|
5232
5233
|
.ac-dropdown-button {
|
|
5233
5234
|
min-width: var(--ac-global-dimension-static-size-300);
|
|
5234
5235
|
}
|
|
5235
|
-
`,to=Bi,Em=({table:n})=>{const a=ce();return e("tbody",{children:n.getRowModel().rows.map(l=>e("tr",{onClick:()=>a(`${encodeURIComponent(l.id)}`),children:l.getVisibleCells().map(t=>e("td",{style:{width:`calc(var(--col-${t.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${t.column.id}-size) * 1px)`,textWrap:"nowrap",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W(t.column.columnDef.cell,t.getContext())},t.id))},l.id))})},DC=fn.memo(Em,(n,a)=>n.table.options.data===a.table.options.data);function LC(n){const a=m.useRef(null),[l,t]=m.useState([]),{
|
|
5236
|
+
`,to=Bi,Em=({table:n})=>{const a=ce();return e("tbody",{children:n.getRowModel().rows.map(l=>e("tr",{onClick:()=>a(`${encodeURIComponent(l.id)}`),children:l.getVisibleCells().map(t=>e("td",{style:{width:`calc(var(--col-${t.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${t.column.id}-size) * 1px)`,textWrap:"nowrap",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:W(t.column.columnDef.cell,t.getContext())},t.id))},l.id))})},DC=fn.memo(Em,(n,a)=>n.table.options.data===a.table.options.data);function LC(n){const a=m.useRef(null),[l,t]=m.useState([]),{filterIoSubstringOrSessionId:i}=_m(),{fetchKey:r}=qa(),{data:s,loadNext:d,hasNext:c,isLoadingNext:g,refetch:f}=P.usePaginationFragment(wm,n.project),u=m.useMemo(()=>s.sessions.edges.map(({session:z})=>({...z,tokenCountTotal:z.tokenUsage.total})),[s.sessions]),p=[{header:"session id",accessorKey:"sessionId",enableSorting:!1,cell:Re},{header:"first input",accessorKey:"firstInput.value",enableSorting:!1,cell:Re},{header:"last output",accessorKey:"lastOutput.value",enableSorting:!1,cell:Re},{header:"start time",accessorKey:"startTime",enableSorting:!0,cell:_e},{header:"end time",accessorKey:"endTime",enableSorting:!0,cell:_e},{header:"p50 latency",accessorKey:"traceLatencyMsP50",enableSorting:!1,cell:({getValue:z})=>{const N=z();return N===null||typeof N!="number"?null:e(je,{latencyMs:N})}},{header:"p99 latency",accessorKey:"traceLatencyMsP99",enableSorting:!1,cell:({getValue:z})=>{const N=z();return N===null||typeof N!="number"?null:e(je,{latencyMs:N})}},{header:"total tokens",accessorKey:"tokenCountTotal",enableSorting:!0,minSize:80,cell:({row:z,getValue:N})=>{const j=N();return j==null||typeof j!="number"?"--":e(La,{tokenCountTotal:j,nodeId:z.original.id})}},{header:"total traces",accessorKey:"numTraces",enableSorting:!0,cell:ss}];m.useEffect(()=>{const z=l[0];m.startTransition(()=>{f({sort:z?{col:z.id,dir:z.desc?"desc":"asc"}:{col:"startTime",dir:"desc"},after:null,first:to,filterIoSubstring:i,sessionId:i},{fetchPolicy:"store-and-network"})})},[l,f,i,r]);const y=fn.useCallback(z=>{if(z){const{scrollHeight:N,scrollTop:j,clientHeight:Y}=z;N-j-Y<300&&!g&&c&&d(to)}},[c,g,d]),[h,k]=m.useState({}),S=en(z=>z.columnVisibility),K=en(z=>z.columnSizing),T=en(z=>z.setColumnSizing),L=Ce({columns:p,data:u,onExpandedChange:k,manualSorting:!0,state:{sorting:l,expanded:h,columnVisibility:S,columnSizing:K},columnResizeMode:"onChange",onColumnSizingChange:T,enableSubRowSelection:!1,onSortingChange:t,getCoreRowModel:Ke(),getSortedRowModel:ln(),getExpandedRowModel:fo(),getRowId:z=>z.id}),w=L.getRowModel().rows.length===0,{columnSizingInfo:V,columnSizing:Q}=L.getState(),I=L.getFlatHeaders,R=p.length,A=fn.useMemo(()=>{const z=I(),N={};for(let j=0;j<z.length;j++){const Y=z[j];N[`--header-${Y.id}-size`]=Y.getSize(),N[`--col-${Y.column.id}-size`]=Y.column.getSize()}return N},[I,V,Q,R]);return o("div",{css:rr,children:[e(v,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:e(SC,{})}),e("div",{css:C`
|
|
5236
5237
|
flex: 1 1 auto;
|
|
5237
5238
|
overflow: auto;
|
|
5238
5239
|
`,onScroll:z=>y(z.target),ref:a,children:o("table",{css:Un,style:{...A,width:L.getTotalSize(),minWidth:"100%"},children:[e("thead",{children:L.getHeaderGroups().map(z=>e("tr",{children:z.headers.map(N=>e("th",{style:{width:`calc(var(--header-${N.id}-size) * 1px)`},children:N.isPlaceholder?null:o(J,{children:[o("div",{"data-sortable":N.column.getCanSort(),className:N.column.getCanSort()?"sort":"",onClick:N.column.getToggleSortingHandler(),style:{left:N.getStart(),width:N.getSize()},children:[W(N.column.columnDef.header,N.getContext()),N.column.getIsSorted()?e(D,{className:"sort-icon",svg:N.column.getIsSorted()==="asc"?e(Xe,{}):e(Ze,{})}):null]}),e("div",{onMouseDown:N.getResizeHandler(),onTouchStart:N.getResizeHandler(),className:`resizer ${N.column.getIsResizing()?"isResizing":""}`})]})},N.id))},z.id))}),w?e(IC,{}):V.isResizingColumn?e(DC,{table:L}):e(Em,{table:L})]})})]})}function or({children:n}){const{projectId:a}=Qe();if(!a)throw new Error("projectId is required");const{tab:l}=zt();if(!Ld(l))throw new Error(`Invalid tab: ${l}`);return e(hC,{projectId:a,tableId:l||"table",children:n})}function _C({queryReference:n}){const a=P.usePreloadedQuery(Od,n);return e(fC,{children:e(LC,{project:a.project})})}const lP=()=>{const{sessionsQueryReference:n}=At();return n?o(or,{children:[e(nr,{children:e(m.Suspense,{fallback:e(ge,{}),children:e(_C,{queryReference:n})})}),e(m.Suspense,{children:e(ve,{})})]}):null},Mm=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterCondition"},l={defaultValue:30,kind:"LocalArgument",name:"first"},t={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:null,kind:"LocalArgument",name:"orphanSpanAsRootSpan"},r={defaultValue:!0,kind:"LocalArgument",name:"rootSpansOnly"},s={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},d={defaultValue:null,kind:"LocalArgument",name:"timeRange"},c=[{kind:"Variable",name:"id",variableName:"id"}],g={kind:"Variable",name:"after",variableName:"after"},f={kind:"Variable",name:"filterCondition",variableName:"filterCondition"},u={kind:"Variable",name:"first",variableName:"first"},p={kind:"Variable",name:"rootSpansOnly",variableName:"rootSpansOnly"},y={kind:"Variable",name:"sort",variableName:"sort"},h={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},k={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},S={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},K=[g,f,u,{kind:"Variable",name:"orphanSpanAsRootSpan",variableName:"orphanSpanAsRootSpan"},p,y,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],T=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],L={alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},x={alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null};return{fragment:{argumentDefinitions:[n,a,l,t,i,r,s,d],kind:"Fragment",metadata:null,name:"SpansTableSpansQuery",selections:[{alias:null,args:c,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[g,f,u,p,y],kind:"FragmentSpread",name:"SpansTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,l,i,r,s,d,t],kind:"Operation",name:"SpansTableSpansQuery",selections:[{alias:null,args:c,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[h,k,{kind:"InlineFragment",selections:[S,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:null,args:K,concreteType:"SpanConnection",kind:"LinkedField",name:"spans",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:[k,{alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},S,{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:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},{alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[k,{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:[k,S,L,x,{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null},{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"username",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"profilePictureUrl",storageKey:null},k],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"AnnotationSummary",kind:"LinkedField",name:"spanAnnotationSummaries",plural:!0,selections:[{alias:null,args:null,concreteType:"LabelFraction",kind:"LinkedField",name:"labelFractions",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"fraction",storageKey:null},L],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"meanScore",storageKey:null},S],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},{alias:null,args:null,concreteType:"Project",kind:"LinkedField",name:"project",plural:!1,selections:[k,{alias:null,args:null,concreteType:"AnnotationConfigConnection",kind:"LinkedField",name:"annotationConfigs",plural:!1,selections:[{alias:null,args:null,concreteType:"AnnotationConfigEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[h,{kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"annotationType",storageKey:null}],type:"AnnotationConfigBase",abstractKey:"__isAnnotationConfigBase"},{kind:"InlineFragment",selections:[k,S,{alias:null,args:null,kind:"ScalarField",name:"optimizationDirection",storageKey:null},{alias:null,args:null,concreteType:"CategoricalAnnotationValue",kind:"LinkedField",name:"values",plural:!0,selections:[L,x],storageKey:null}],type:"CategoricalAnnotationConfig",abstractKey:null},{kind:"InlineFragment",selections:[k],type:"Node",abstractKey:"__isNode"}],storageKey:null}],storageKey:null}],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:[h,k],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},{alias:null,args:K,filters:["sort","rootSpansOnly","filterCondition","orphanSpanAsRootSpan","timeRange"],handle:"connection",key:"SpansTable_spans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"fc79d02f18fbddd3427e6290828530b7",id:null,metadata:{},name:"SpansTableSpansQuery",operationKind:"query",text:`query SpansTableSpansQuery(
|
|
@@ -6061,7 +6062,7 @@ fragment DatasetsTable_datasets_3JsJJ3 on Query {
|
|
|
6061
6062
|
`}}}();Fg.hash="bd97316dd472eec18504f66e16088abc";function x2({datasetId:n,datasetName:a,onDatasetDelete:l,onDatasetDeleteError:t}){const[i,r]=P.useMutation(Fg),s=m.useCallback(()=>{m.startTransition(()=>{i({variables:{datasetId:n},onCompleted:()=>{l()},onError:d=>{t(d)}})})},[i,n,l,t]);return o(oe,{size:"S",title:"Delete Dataset",children:[e(v,{padding:"size-200",children:e(F,{color:"danger",children:`Are you sure you want to delete dataset ${a}? This will also delete all associated experiments and traces, and it cannot be undone.`})}),e(v,{paddingEnd:"size-200",paddingTop:"size-100",paddingBottom:"size-100",borderTopColor:"light",borderTopWidth:"thin",children:e(b,{direction:"row",justifyContent:"end",children:e(M,{variant:"danger",onPress:()=>{s()},isDisabled:r,leadingVisual:e(D,{svg:r?e(sn,{}):e(Je,{})}),children:"Delete Dataset"})})})]})}function I2({datasetName:n,datasetId:a,datasetDescription:l,datasetMetadata:t,onDatasetEdited:i,onDatasetEditError:r}){return e(oe,{title:"Edit Dataset",size:"M",children:e(uh,{datasetName:n,datasetId:a,datasetDescription:l,datasetMetadata:t,onDatasetEdited:i,onDatasetEditError:r})})}function D2(n){const{datasetId:a,datasetName:l,datasetDescription:t,datasetMetadata:i,onDatasetDelete:r,onDatasetDeleteError:s,onDatasetEdit:d,onDatasetEditError:c}=n,[g,f]=m.useState(null),u=m.useCallback(()=>{f(e(x2,{datasetId:a,datasetName:l,onDatasetDelete:()=>{r(),f(null)},onDatasetDeleteError:s}))},[a,l,r,s]),p=m.useCallback(()=>{f(e(I2,{datasetId:a,datasetName:l,datasetDescription:t,datasetMetadata:i,onDatasetEdited:()=>{d(),f(null)},onDatasetEditError:c}))},[t,a,i,l,d,c]);return o("div",{onClick:y=>{y.preventDefault(),y.stopPropagation()},children:[o(ra,{align:"end",buttonSize:"compact",onAction:y=>{switch(y){case"deleteDataset":u();break;case"editDataset":p();break}},children:[e(xe,{children:o(b,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(D,{svg:e(Je,{})}),e(F,{children:"Delete"})]})},"deleteDataset"),e(xe,{children:o(b,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(D,{svg:e(kt,{})}),e(F,{children:"Edit"})]})},"editDataset")]}),e(ue,{type:"modal",isDismissable:!0,onDismiss:()=>f(null),children:g})]})}function L2(){return e(v,{width:"100%",paddingY:"size-400",children:e(b,{direction:"column",width:"100%",alignItems:"center",justifyContent:"center",children:e(v,{width:"100%",maxWidth:"780px",children:o(b,{direction:"column",gap:"size-400",alignItems:"center",children:[e(F,{size:"XL",children:"Create datasets for testing prompts, experimentation, and fine-tuning."}),e(zi,{src:"https://storage.googleapis.com/arize-phoenix-assets/assets/videos/datasets.mp4",autoPlay:!0,muted:!0,loop:!0}),o(b,{direction:"row",gap:"size-200",children:[e(nl,{href:"https://arize.com/docs/phoenix/datasets-and-experiments/overview-datasets",target:"_blank",leadingVisual:e(D,{svg:e(Ni,{})}),children:"Documentation"}),e(nl,{href:"https://colab.research.google.com/github/arize-ai/phoenix/blob/main/tutorials/experiments/datasets_and_experiments_quickstart.ipynb",target:"_blank",leadingVisual:e(D,{svg:e(mh,{})}),children:"Quickstart"})]})]})})})})}const ro=100;function _2(n){const a=n.id;if(a!=="createdAt"&&a!=="name")throw new Error("Invalid sort column");return{col:a,dir:n.desc?"desc":"asc"}}function A2(n){const{filter:a}=n,[l,t]=m.useState([]),i=m.useRef(null),r=ce(),s=me(),d=be(),{data:c,loadNext:g,hasNext:f,isLoadingNext:u,refetch:p}=P.usePaginationFragment(vg,n.query),y=m.useMemo(()=>c.datasets.edges.map(T=>T.node),[c]),h=m.useCallback(T=>{if(T){const{scrollHeight:L,scrollTop:x,clientHeight:w}=T;L-x-w<300&&!u&&f&&g(ro,{UNSTABLE_extraVariables:{filter:a?{col:"name",value:a}:null}})}},[f,u,g,a]),k=Ce({columns:[{header:"name",accessorKey:"name",cell:({row:T})=>{const x=T.original.experimentCount>0?`${T.original.id}/experiments`:`${T.original.id}/examples`;return e(we,{to:x,children:T.original.name})}},{header:"description",accessorKey:"description",enableSorting:!1},{header:"created at",accessorKey:"createdAt",cell:_e},{header:"example count",accessorKey:"exampleCount",enableSorting:!1,meta:{textAlign:"right"}},{header:"experiment count",accessorKey:"experimentCount",enableSorting:!1,meta:{textAlign:"right"}},{header:"metadata",accessorKey:"metadata",enableSorting:!1,cell:Xa},{header:"",id:"actions",enableSorting:!1,size:10,cell:({row:T})=>e(D2,{datasetId:T.original.id,datasetName:T.original.name,datasetDescription:T.original.description,datasetMetadata:T.original.metadata,onDatasetEdit:()=>{s({title:"Dataset updated",message:`${T.original.name} has been successfully updated.`}),p({filter:a?{col:"name",value:a}:null},{fetchPolicy:"store-and-network"})},onDatasetEditError:L=>{const x=De(L);d({title:"Dataset update failed",message:(x==null?void 0:x[0])??L.message})},onDatasetDelete:()=>{s({title:"Dataset deleted",message:`${T.original.name} has been successfully deleted.`}),p({filter:a?{col:"name",value:a}:null},{fetchPolicy:"store-and-network"})},onDatasetDeleteError:L=>{const x=De(L);d({title:"Dataset deletion failed",message:(x==null?void 0:x[0])??L.message})}})}],data:y,state:{sorting:l},getCoreRowModel:Ke(),getSortedRowModel:ln(),onSortingChange:t,manualSorting:!0});m.useEffect(()=>{const T=l[0];m.startTransition(()=>{p({sort:T?_2(T):{col:"createdAt",dir:"desc"},after:null,first:ro,filter:a?{col:"name",value:a}:null},{fetchPolicy:"store-and-network"})})},[l,p,a]);const S=k.getRowModel().rows,K=S.length===0;return e("div",{css:C`
|
|
6062
6063
|
flex: 1 1 auto;
|
|
6063
6064
|
overflow: auto;
|
|
6064
|
-
`,onScroll:T=>h(T.target),ref:i,children:o("table",{css:Un,children:[e("thead",{children:k.getHeaderGroups().map(T=>e("tr",{children:T.headers.map(L=>{var x;return e("th",{colSpan:L.colSpan,children:L.isPlaceholder?null:o("div",{className:L.column.getCanSort()?"sort":"",onClick:L.column.getToggleSortingHandler(),style:{textAlign:(x=L.column.columnDef.meta)==null?void 0:x.textAlign},children:[W(L.column.columnDef.header,L.getContext()),L.column.getIsSorted()?e(D,{className:"sort-icon",svg:L.column.getIsSorted()==="asc"?e(Xe,{}):e(Ze,{})}):null]})},L.id)})},T.id))}),K?e(gh,{children:e(L2,{})}):e("tbody",{children:S.map(T=>e("tr",{onClick:()=>{const x=T.original.experimentCount>0?`${T.original.id}/experiments`:`${T.original.id}/examples`;r(x)},children:T.getVisibleCells().map(L=>{var x;return e("td",{align:(x=L.column.columnDef.meta)==null?void 0:x.textAlign,children:W(L.column.columnDef.cell,L.getContext())},L.id)})},T.id))})]})})}function uP(){return e(m.Suspense,{fallback:e(ge,{}),children:e(w2,{})})}function w2(){const[n,a]=m.useState(0),l=P.useLazyLoadQuery(bg,{},{fetchKey:n,fetchPolicy:"store-and-network"}),t=m.useCallback(()=>{a(i=>i+1)},[a]);return o(b,{direction:"column",height:"100%",children:[e(v,{padding:"size-200",borderBottomWidth:"thin",borderBottomColor:"dark",flex:"none",children:e(b,{direction:"column",gap:"size-200",children:o(b,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(ae,{level:1,children:"Datasets"}),e(E2,{onDatasetCreated:t})]})})}),e(R2,{query:l})]})}function R2({query:n}){const[a,l]=m.useState("");return o(J,{children:[e(v,{padding:"size-200",flex:"none",children:e(P2,{onChange:l,value:a})}),e(A2,{query:n,filter:a})]})}function E2({onDatasetCreated:n}){const a=ce(),l=me(),t=be(),[i,r]=m.useState(null),s=()=>{r(e(oe,{size:"S",title:"New Dataset",children:e(us,{onDatasetCreated:c=>{l({title:"Dataset created",message:`${c.name} has been successfully created.`,action:{text:"Go to Dataset",onClick:()=>{a(`/datasets/${c.id}`)}}}),r(null),n()},onDatasetCreateError:c=>{const g=De(c);t({title:"Dataset creation failed",message:(g==null?void 0:g[0])??c.message})}})}))},d=()=>{r(e(oe,{size:"M",title:"New Dataset from CSV",children:e(K2,{onDatasetCreated:c=>{l({title:"Dataset created",message:`${c.name} has been successfully created.`,action:{text:"Go to Dataset",onClick:()=>{a(`/datasets/${c.id}`)}}}),r(null),n()},onDatasetCreateError:c=>{const g=De(c);t({title:"Dataset creation failed",message:(g==null?void 0:g[0])??c.message})}})}))};return o(J,{children:[o(ra,{buttonText:"Create Dataset",align:"end",icon:e(D,{svg:e(gt,{})}),onAction:c=>{switch(c){case"newDataset":s();break;case"datasetFromCSV":d();break}},children:[e(xe,{children:"New Dataset"},"newDataset"),e(xe,{children:"Dataset from CSV"},"datasetFromCSV")]}),e(ue,{type:"modal",isDismissable:!0,onDismiss:()=>r(null),children:i})]})}const Cg=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"datasetId"}],a=[{kind:"Variable",name:"id",variableName:"datasetId"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={kind:"InlineFragment",selections:[{alias:"latestVersions",args:[{kind:"Literal",name:"first",value:1},{kind:"Literal",name:"sort",value:{col:"createdAt",dir:"desc"}}],concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"version",args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'versions(first:1,sort:{"col":"createdAt","dir":"desc"})'}],type:"Dataset",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"datasetStore_latestVersionQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"datasetStore_latestVersionQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,t],storageKey:null}]},params:{cacheID:"8d1b89f8e5b4cd2774b9862c9aff1d3e",id:null,metadata:{},name:"datasetStore_latestVersionQuery",operationKind:"query",text:`query datasetStore_latestVersionQuery(
|
|
6065
|
+
`,onScroll:T=>h(T.target),ref:i,children:o("table",{css:Un,children:[e("thead",{children:k.getHeaderGroups().map(T=>e("tr",{children:T.headers.map(L=>{var x;return e("th",{colSpan:L.colSpan,children:L.isPlaceholder?null:o("div",{className:L.column.getCanSort()?"sort":"",onClick:L.column.getToggleSortingHandler(),style:{textAlign:(x=L.column.columnDef.meta)==null?void 0:x.textAlign},children:[W(L.column.columnDef.header,L.getContext()),L.column.getIsSorted()?e(D,{className:"sort-icon",svg:L.column.getIsSorted()==="asc"?e(Xe,{}):e(Ze,{})}):null]})},L.id)})},T.id))}),K?e(gh,{children:e(L2,{})}):e("tbody",{children:S.map(T=>e("tr",{onClick:()=>{const x=T.original.experimentCount>0?`${T.original.id}/experiments`:`${T.original.id}/examples`;r(x)},children:T.getVisibleCells().map(L=>{var x;return e("td",{align:(x=L.column.columnDef.meta)==null?void 0:x.textAlign,children:W(L.column.columnDef.cell,L.getContext())},L.id)})},T.id))})]})})}function uP(){return e(m.Suspense,{fallback:e(ge,{}),children:e(w2,{})})}function w2(){const[n,a]=m.useState(0),l=P.useLazyLoadQuery(bg,{},{fetchKey:n,fetchPolicy:"store-and-network"}),t=m.useCallback(()=>{a(i=>i+1)},[a]);return o(b,{direction:"column",height:"100%",children:[e(v,{padding:"size-200",borderBottomWidth:"thin",borderBottomColor:"dark",flex:"none",children:e(b,{direction:"column",gap:"size-200",children:o(b,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(ae,{level:1,children:"Datasets"}),e(E2,{onDatasetCreated:t})]})})}),e(R2,{query:l})]})}function R2({query:n}){const[a,l]=m.useState("");return o(J,{children:[e(v,{padding:"size-200",flex:"none",borderBottomWidth:"thin",borderBottomColor:"dark",children:e(P2,{onChange:l,value:a})}),e(A2,{query:n,filter:a})]})}function E2({onDatasetCreated:n}){const a=ce(),l=me(),t=be(),[i,r]=m.useState(null),s=()=>{r(e(oe,{size:"S",title:"New Dataset",children:e(us,{onDatasetCreated:c=>{l({title:"Dataset created",message:`${c.name} has been successfully created.`,action:{text:"Go to Dataset",onClick:()=>{a(`/datasets/${c.id}`)}}}),r(null),n()},onDatasetCreateError:c=>{const g=De(c);t({title:"Dataset creation failed",message:(g==null?void 0:g[0])??c.message})}})}))},d=()=>{r(e(oe,{size:"M",title:"New Dataset from CSV",children:e(K2,{onDatasetCreated:c=>{l({title:"Dataset created",message:`${c.name} has been successfully created.`,action:{text:"Go to Dataset",onClick:()=>{a(`/datasets/${c.id}`)}}}),r(null),n()},onDatasetCreateError:c=>{const g=De(c);t({title:"Dataset creation failed",message:(g==null?void 0:g[0])??c.message})}})}))};return o(J,{children:[o(ra,{buttonText:"Create Dataset",align:"end",icon:e(D,{svg:e(gt,{})}),onAction:c=>{switch(c){case"newDataset":s();break;case"datasetFromCSV":d();break}},children:[e(xe,{children:"New Dataset"},"newDataset"),e(xe,{children:"Dataset from CSV"},"datasetFromCSV")]}),e(ue,{type:"modal",isDismissable:!0,onDismiss:()=>r(null),children:i})]})}const Cg=function(){var n=[{defaultValue:null,kind:"LocalArgument",name:"datasetId"}],a=[{kind:"Variable",name:"id",variableName:"datasetId"}],l={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},t={kind:"InlineFragment",selections:[{alias:"latestVersions",args:[{kind:"Literal",name:"first",value:1},{kind:"Literal",name:"sort",value:{col:"createdAt",dir:"desc"}}],concreteType:"DatasetVersionConnection",kind:"LinkedField",name:"versions",plural:!1,selections:[{alias:null,args:null,concreteType:"DatasetVersionEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"version",args:null,concreteType:"DatasetVersion",kind:"LinkedField",name:"node",plural:!1,selections:[l,{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"createdAt",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:'versions(first:1,sort:{"col":"createdAt","dir":"desc"})'}],type:"Dataset",abstractKey:null};return{fragment:{argumentDefinitions:n,kind:"Fragment",metadata:null,name:"datasetStore_latestVersionQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[l,t],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:n,kind:"Operation",name:"datasetStore_latestVersionQuery",selections:[{alias:"dataset",args:a,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},l,t],storageKey:null}]},params:{cacheID:"8d1b89f8e5b4cd2774b9862c9aff1d3e",id:null,metadata:{},name:"datasetStore_latestVersionQuery",operationKind:"query",text:`query datasetStore_latestVersionQuery(
|
|
6065
6066
|
$datasetId: ID!
|
|
6066
6067
|
) {
|
|
6067
6068
|
dataset: node(id: $datasetId) {
|
phoenix/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "10.
|
|
1
|
+
__version__ = "10.12.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|