arize-phoenix 8.28.0__py3-none-any.whl → 8.28.1__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arize-phoenix
3
- Version: 8.28.0
3
+ Version: 8.28.1
4
4
  Summary: AI Observability and Evaluation
5
5
  Project-URL: Documentation, https://docs.arize.com/phoenix/
6
6
  Project-URL: Issues, https://github.com/Arize-ai/phoenix/issues
@@ -6,13 +6,13 @@ 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=Rkgz24pUZ2-Ffe8Cn8jTlH_6JjkwxEfhVaqgOZ6c7cI,23
9
+ phoenix/version.py,sha256=gsPW9piraEXxZqmMeTmM62F-5-fa2a-qU5TOrQPD4Gs,23
10
10
  phoenix/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  phoenix/core/embedding_dimension.py,sha256=zKGbcvwOXgLf-yrJBpQyKtd-LEOPRKHnUToyAU8Owis,87
12
12
  phoenix/core/model.py,sha256=qBFraOtmwCCnWJltKNP18DDG0mULXigytlFsa6YOz6k,4837
13
13
  phoenix/core/model_schema.py,sha256=9JChtyXtid0GzEYImDcNA8Ppk7jmCO5xC5dBIUMNYjE,50504
14
14
  phoenix/core/model_schema_adapter.py,sha256=y1RXPYGt2HLTGpkB2X-XVQvRJXYGmJ9EL4m7TpOMvj0,8456
15
- phoenix/db/README.md,sha256=Mjrq0tG68uKQ81mN1Vmu3C795EEpZndmnE6CJXsPCXE,1909
15
+ phoenix/db/README.md,sha256=7BFJuecWJjFSxEYmoSv4CvoFHHszX4tFy3HJExOxS-4,8661
16
16
  phoenix/db/__init__.py,sha256=pDjEFXukHmJBM-1D8RjmXkvLsz85YWNxMQczt81ec3A,118
17
17
  phoenix/db/alembic.ini,sha256=GIS6HpHaKaJbbuahZg1Rc1D2_QqyCkV9r58wdARGf6w,3262
18
18
  phoenix/db/bulk_inserter.py,sha256=faNjuwLqqsw4ky8sa4D0h9u5TvEDTOjrccUW89L008E,12725
@@ -99,7 +99,7 @@ phoenix/server/api/auth.py,sha256=nywpmfMI1trZTbZRD3oBj4kFjzg_vnxDljcM431T1eY,12
99
99
  phoenix/server/api/context.py,sha256=gB9bNgdqqD4Bn-6V4zlKeILl6L76jynPtOuM_5UZBNw,6557
100
100
  phoenix/server/api/exceptions.py,sha256=TA0JuY2YRnj35qGuMSQ8d0ToHum9gWm9W--3fSKHrX0,1171
101
101
  phoenix/server/api/interceptor.py,sha256=ykDnoC_apUd-llVli3m1CW18kNSIgjz2qZ6m5JmPDu8,1294
102
- phoenix/server/api/queries.py,sha256=WNH1LxB7bobfOMdBJts-9_ncfVhv2LThAKu14MRPMpk,35810
102
+ phoenix/server/api/queries.py,sha256=nQA39BqVlrlXy6guOURGKslcD4OZNhmzuCw_bw_yGms,35638
103
103
  phoenix/server/api/schema.py,sha256=fcs36xQwFF_Qe41_5cWR8wYpDvOrnbcyTeo5WNMbDsA,1702
104
104
  phoenix/server/api/subscriptions.py,sha256=TnZhdoNHMXp1NkUVLA-eB54woll7FvxtsB2pLt1dO0w,23001
105
105
  phoenix/server/api/utils.py,sha256=quCBRcusc6PUq9tJq7M8PgwFZp7nXgVAxtbw8feribY,833
@@ -257,7 +257,7 @@ phoenix/server/api/types/ExperimentComparison.py,sha256=cFQZy5rj_klzTV-3jnxIlkrC
257
257
  phoenix/server/api/types/ExperimentRun.py,sha256=DMqxXEDFP4evEzCCnJ7JZHdv9z-nrcDxl0uKQOL6_ps,4179
258
258
  phoenix/server/api/types/ExperimentRunAnnotation.py,sha256=YGw5zIbjRXUK3zH475DnEeg4SDNGOmdxtuUVkzGw1E8,1734
259
259
  phoenix/server/api/types/ExportedFile.py,sha256=e3GTn7B5LgsTbqiwjhMCQH7VsiqXitrBO4aCMS1lHsg,163
260
- phoenix/server/api/types/Functionality.py,sha256=tzV9xdhB8zqfsjWxP66NDC7EZsplYkYO7jRbLWJIeeg,382
260
+ phoenix/server/api/types/Functionality.py,sha256=zDDl2bANIqjwfooSOHg-VQk6-wQy05mREwjV_-VbSIg,262
261
261
  phoenix/server/api/types/GenerativeModel.py,sha256=P7eBUMXbeqaLwSSGBKdZy3a5gOLd9I0fuP8o1st6H08,193
262
262
  phoenix/server/api/types/GenerativeProvider.py,sha256=v5wXUbAJaQA4GL8xOgTjNOWV-x39p20zMC9MOvS8ruM,3941
263
263
  phoenix/server/api/types/Identifier.py,sha256=n3rxpoKNCwEvZu7QY8yr7g3AW2mU-U62BxFXYaiHLKk,306
@@ -318,10 +318,10 @@ phoenix/server/static/apple-touch-icon-76x76.png,sha256=CT_xT12I0u2i0WU8JzBZBuOQ
318
318
  phoenix/server/static/apple-touch-icon.png,sha256=fOfpjqGpWYbJ0eAurKsyoZP1EAs6ZVooBJ_SGk2ZkDs,3801
319
319
  phoenix/server/static/favicon.ico,sha256=bY0vvCKRftemZfPShwZtE93DiiQdaYaozkPGwNFr6H8,34494
320
320
  phoenix/server/static/modernizr.js,sha256=mvK-XtkNqjOral-QvzoqsyOMECXIMu5BQwSVN_wcU9c,2564
321
- phoenix/server/static/.vite/manifest.json,sha256=axwOLEZmLciheqzgexZ9Ao7nYZApU2uMj65JfnJpcSs,2165
322
- phoenix/server/static/assets/components-BEtrHoeq.js,sha256=Y7waBKBaggGTSGs8OpwRLglkfiq2WLM2g9v4wBXYiuk,456114
323
- phoenix/server/static/assets/index-Cdj4_6tq.js,sha256=hZwod6aJMtX5GTUcjMQQmhdL9U_O8mK9MJsaiIhS18Y,60460
324
- phoenix/server/static/assets/pages-CZ0wMeOx.js,sha256=-qLg2uI78An1HJGFjlyTG93iMYwlJtzqkLuhXD0OFHo,864757
321
+ phoenix/server/static/.vite/manifest.json,sha256=6QTURnF280ofNocGEl8gB6sl5MV89eY-ud75tIEL_9s,2165
322
+ phoenix/server/static/assets/components-DepxScNF.js,sha256=carDtPUQBqqHy_r-R915p_M-9nTJg-AL2Wbc2dAK3GQ,456419
323
+ phoenix/server/static/assets/index-DUj7q3Q4.js,sha256=c5CoeDmjEu__Js2Je0WtUH-_94J2_IOARtC8tF37Kf4,60460
324
+ phoenix/server/static/assets/pages-CJUakDKi.js,sha256=7z0F3KAcyUcdXrMrBorbSmOYJDlG7olc3hrATdEfnJA,864692
325
325
  phoenix/server/static/assets/vendor-BfhM_F1u.js,sha256=S90L1KRZOw_NX6C9FENfLs6bSuEzf7zVDAqjZAZJZgE,2514280
326
326
  phoenix/server/static/assets/vendor-Cg6lcjUC.css,sha256=nZrkr0u6NNElFGvpWHk9GTHeGoibCXCli1bE7mXZGZg,1816
327
327
  phoenix/server/static/assets/vendor-arizeai-CxXYQNUl.js,sha256=V0umBNhH2psKhzwNKvLylYrqVfHu4I6NDSqejmR2OIU,193248
@@ -368,9 +368,9 @@ phoenix/utilities/project.py,sha256=auVpARXkDb-JgeX5f2aStyFIkeKvGwN9l7qrFeJMVxI,
368
368
  phoenix/utilities/re.py,sha256=6YyUWIkv0zc2SigsxfOWIHzdpjKA_TZo2iqKq7zJKvw,2081
369
369
  phoenix/utilities/span_store.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
370
370
  phoenix/utilities/template_formatters.py,sha256=gh9PJD6WEGw7TEYXfSst1UR4pWWwmjxMLrDVQ_CkpkQ,2779
371
- arize_phoenix-8.28.0.dist-info/METADATA,sha256=IV0uwvRdRd36AWOvFzZeRUcSkx_gOsuVDkImPwNTCa4,24478
372
- arize_phoenix-8.28.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
- arize_phoenix-8.28.0.dist-info/entry_points.txt,sha256=Pgpn8Upxx9P8z8joPXZWl2LlnAlGc3gcQoVchb06X1Q,94
374
- arize_phoenix-8.28.0.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
375
- arize_phoenix-8.28.0.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
376
- arize_phoenix-8.28.0.dist-info/RECORD,,
371
+ arize_phoenix-8.28.1.dist-info/METADATA,sha256=piSQBdxjMSPCEXL3HRfFaSsgivBPxTHLu4yeSq-FxB8,24478
372
+ arize_phoenix-8.28.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
373
+ arize_phoenix-8.28.1.dist-info/entry_points.txt,sha256=Pgpn8Upxx9P8z8joPXZWl2LlnAlGc3gcQoVchb06X1Q,94
374
+ arize_phoenix-8.28.1.dist-info/licenses/IP_NOTICE,sha256=JBqyyCYYxGDfzQ0TtsQgjts41IJoa-hiwDrBjCb9gHM,469
375
+ arize_phoenix-8.28.1.dist-info/licenses/LICENSE,sha256=HFkW9REuMOkvKRACuwLPT0hRydHb3zNg-fdFt94td18,3794
376
+ arize_phoenix-8.28.1.dist-info/RECORD,,
phoenix/db/README.md CHANGED
@@ -52,3 +52,302 @@ alembic revision -m "your_revision_name"
52
52
  ```
53
53
 
54
54
  Then fill the migration file with the necessary changes.
55
+
56
+ ## Entity Relationship Diagram
57
+
58
+ Below is a Mermaid diagram showing the current relationships between the main entities in the database:
59
+
60
+ ```mermaid
61
+ erDiagram
62
+ Project ||--o{ Trace : has
63
+ Project {
64
+ int id PK
65
+ string name
66
+ string description
67
+ string gradient_start_color
68
+ string gradient_end_color
69
+ datetime created_at
70
+ datetime updated_at
71
+ }
72
+
73
+ ProjectSession ||--o{ Trace : has
74
+ ProjectSession {
75
+ int id PK
76
+ string session_id
77
+ int project_id FK
78
+ datetime start_time
79
+ datetime end_time
80
+ }
81
+
82
+ Trace ||--o{ Span : contains
83
+ Trace ||--o{ ExperimentRun : has
84
+ Trace ||--o{ TraceAnnotation : has
85
+ Trace ||--o{ ExperimentRunAnnotation : has
86
+ Trace {
87
+ int id PK
88
+ int project_rowid FK
89
+ string trace_id
90
+ int project_session_rowid FK
91
+ datetime start_time
92
+ datetime end_time
93
+ }
94
+
95
+ Span ||--o{ DocumentAnnotation : has
96
+ Span ||--o{ DatasetExample : has
97
+ Span ||--o{ SpanAnnotation : has
98
+ Span {
99
+ int id PK
100
+ int trace_rowid FK
101
+ string span_id
102
+ string parent_id
103
+ string name
104
+ string span_kind
105
+ datetime start_time
106
+ datetime end_time
107
+ json attributes
108
+ json events
109
+ string status_code
110
+ string status_message
111
+ int cumulative_error_count
112
+ int cumulative_llm_token_count_prompt
113
+ int cumulative_llm_token_count_completion
114
+ int llm_token_count_prompt
115
+ int llm_token_count_completion
116
+ }
117
+
118
+ DocumentAnnotation {
119
+ int id PK
120
+ int span_rowid FK
121
+ int document_position
122
+ string name
123
+ string label
124
+ float score
125
+ string explanation
126
+ json metadata
127
+ string annotator_kind
128
+ datetime created_at
129
+ datetime updated_at
130
+ }
131
+
132
+ SpanAnnotation {
133
+ int id PK
134
+ int span_rowid FK
135
+ string name
136
+ string label
137
+ float score
138
+ string explanation
139
+ json metadata
140
+ string annotator_kind
141
+ datetime created_at
142
+ datetime updated_at
143
+ }
144
+
145
+ TraceAnnotation {
146
+ int id PK
147
+ int trace_rowid FK
148
+ string name
149
+ string label
150
+ float score
151
+ string explanation
152
+ json metadata
153
+ string annotator_kind
154
+ datetime created_at
155
+ datetime updated_at
156
+ }
157
+
158
+ Dataset ||--o{ DatasetVersion : has
159
+ Dataset ||--o{ DatasetExample : contains
160
+ Dataset {
161
+ int id PK
162
+ string name
163
+ string description
164
+ json metadata
165
+ datetime created_at
166
+ datetime updated_at
167
+ }
168
+
169
+ DatasetVersion ||--o{ DatasetExampleRevision : has
170
+ DatasetVersion {
171
+ int id PK
172
+ int dataset_id FK
173
+ string description
174
+ json metadata
175
+ datetime created_at
176
+ }
177
+
178
+ DatasetExample ||--o{ DatasetExampleRevision : has
179
+ DatasetExample {
180
+ int id PK
181
+ int dataset_id FK
182
+ int span_rowid FK
183
+ datetime created_at
184
+ }
185
+
186
+ DatasetExampleRevision {
187
+ int id PK
188
+ int dataset_example_id FK
189
+ int dataset_version_id FK
190
+ json input
191
+ json output
192
+ json metadata
193
+ string revision_kind
194
+ datetime created_at
195
+ }
196
+
197
+ Experiment ||--o{ ExperimentRun : has
198
+ Experiment {
199
+ int id PK
200
+ int dataset_id FK
201
+ int dataset_version_id FK
202
+ string name
203
+ string description
204
+ int repetitions
205
+ json metadata
206
+ string project_name
207
+ datetime created_at
208
+ datetime updated_at
209
+ }
210
+
211
+ ExperimentRun ||--o{ ExperimentRunAnnotation : has
212
+ ExperimentRun {
213
+ int id PK
214
+ int experiment_id FK
215
+ int dataset_example_id FK
216
+ int repetition_number
217
+ string trace_id
218
+ json output
219
+ datetime start_time
220
+ datetime end_time
221
+ int prompt_token_count
222
+ int completion_token_count
223
+ string error
224
+ }
225
+
226
+ ExperimentRunAnnotation {
227
+ int id PK
228
+ int experiment_run_id FK
229
+ string name
230
+ string annotator_kind
231
+ string label
232
+ float score
233
+ string explanation
234
+ string trace_id
235
+ string error
236
+ json metadata
237
+ datetime start_time
238
+ datetime end_time
239
+ }
240
+
241
+ User ||--o{ ApiKey : has
242
+ User ||--o{ AccessToken : has
243
+ User ||--o{ RefreshToken : has
244
+ User ||--o{ PasswordResetToken : has
245
+ User ||--o{ PromptVersion : has
246
+ User ||--o{ PromptVersionTag : has
247
+ User {
248
+ int id PK
249
+ int user_role_id FK
250
+ string username
251
+ string email
252
+ string profile_picture_url
253
+ bytes password_hash
254
+ bytes password_salt
255
+ boolean reset_password
256
+ string oauth2_client_id
257
+ string oauth2_user_id
258
+ datetime created_at
259
+ datetime updated_at
260
+ }
261
+
262
+ UserRole ||--o{ User : has
263
+ UserRole {
264
+ int id PK
265
+ string name
266
+ }
267
+
268
+ ApiKey {
269
+ int id PK
270
+ int user_id FK
271
+ string name
272
+ string description
273
+ datetime created_at
274
+ datetime expires_at
275
+ }
276
+
277
+ AccessToken {
278
+ int id PK
279
+ int user_id FK
280
+ datetime created_at
281
+ datetime expires_at
282
+ int refresh_token_id FK
283
+ }
284
+
285
+ RefreshToken {
286
+ int id PK
287
+ int user_id FK
288
+ datetime created_at
289
+ datetime expires_at
290
+ }
291
+
292
+ PasswordResetToken {
293
+ int id PK
294
+ int user_id FK
295
+ datetime created_at
296
+ datetime expires_at
297
+ }
298
+
299
+ Prompt ||--o{ PromptVersion : has
300
+ Prompt ||--o{ PromptPromptLabel : has
301
+ Prompt ||--o{ PromptVersionTag : has
302
+ Prompt ||--o{ Prompt : has
303
+ Prompt {
304
+ int id PK
305
+ int source_prompt_id FK
306
+ string name
307
+ string description
308
+ json metadata
309
+ datetime created_at
310
+ datetime updated_at
311
+ }
312
+
313
+ PromptVersion ||--o{ PromptVersionTag : has
314
+ PromptVersion {
315
+ int id PK
316
+ int prompt_id FK
317
+ string description
318
+ int user_id FK
319
+ string template_type
320
+ string template_format
321
+ json template
322
+ json invocation_parameters
323
+ json tools
324
+ json response_format
325
+ string model_provider
326
+ string model_name
327
+ json metadata
328
+ datetime created_at
329
+ }
330
+
331
+ PromptLabel ||--o{ PromptPromptLabel : has
332
+ PromptLabel {
333
+ int id PK
334
+ string name
335
+ string description
336
+ string color
337
+ }
338
+
339
+ PromptPromptLabel {
340
+ int id PK
341
+ int prompt_label_id FK
342
+ int prompt_id FK
343
+ }
344
+
345
+ PromptVersionTag {
346
+ int id PK
347
+ string name
348
+ string description
349
+ int prompt_id FK
350
+ int prompt_version_id FK
351
+ int user_id FK
352
+ }
353
+ ```
@@ -427,11 +427,8 @@ class Query:
427
427
  @strawberry.field
428
428
  async def functionality(self, info: Info[Context, None]) -> "Functionality":
429
429
  has_model_inferences = not info.context.model.is_empty
430
- async with info.context.db() as session:
431
- has_traces = (await session.scalar(select(models.Trace).limit(1))) is not None
432
430
  return Functionality(
433
431
  model_inferences=has_model_inferences,
434
- tracing=has_traces,
435
432
  )
436
433
 
437
434
  @strawberry.field
@@ -10,6 +10,3 @@ class Functionality:
10
10
  model_inferences: bool = strawberry.field(
11
11
  description="Model inferences are available for analysis"
12
12
  )
13
- tracing: bool = strawberry.field(
14
- description="Generative tracing records are available for analysis"
15
- )
@@ -1,22 +1,22 @@
1
1
  {
2
- "_components-BEtrHoeq.js": {
3
- "file": "assets/components-BEtrHoeq.js",
2
+ "_components-DepxScNF.js": {
3
+ "file": "assets/components-DepxScNF.js",
4
4
  "name": "components",
5
5
  "imports": [
6
6
  "_vendor-BfhM_F1u.js",
7
- "_pages-CZ0wMeOx.js",
7
+ "_pages-CJUakDKi.js",
8
8
  "_vendor-arizeai-CxXYQNUl.js",
9
9
  "_vendor-codemirror-B0NIFPOL.js",
10
10
  "_vendor-three-C5WAXd5r.js"
11
11
  ]
12
12
  },
13
- "_pages-CZ0wMeOx.js": {
14
- "file": "assets/pages-CZ0wMeOx.js",
13
+ "_pages-CJUakDKi.js": {
14
+ "file": "assets/pages-CJUakDKi.js",
15
15
  "name": "pages",
16
16
  "imports": [
17
17
  "_vendor-BfhM_F1u.js",
18
18
  "_vendor-arizeai-CxXYQNUl.js",
19
- "_components-BEtrHoeq.js",
19
+ "_components-DepxScNF.js",
20
20
  "_vendor-codemirror-B0NIFPOL.js",
21
21
  "_vendor-recharts-CrrDFWK1.js"
22
22
  ]
@@ -69,15 +69,15 @@
69
69
  "name": "vendor-three"
70
70
  },
71
71
  "index.tsx": {
72
- "file": "assets/index-Cdj4_6tq.js",
72
+ "file": "assets/index-DUj7q3Q4.js",
73
73
  "name": "index",
74
74
  "src": "index.tsx",
75
75
  "isEntry": true,
76
76
  "imports": [
77
77
  "_vendor-BfhM_F1u.js",
78
78
  "_vendor-arizeai-CxXYQNUl.js",
79
- "_pages-CZ0wMeOx.js",
80
- "_components-BEtrHoeq.js",
79
+ "_pages-CJUakDKi.js",
80
+ "_components-DepxScNF.js",
81
81
  "_vendor-three-C5WAXd5r.js",
82
82
  "_vendor-codemirror-B0NIFPOL.js",
83
83
  "_vendor-shiki-C5bJ-RPf.js",
@@ -1,4 +1,4 @@
1
- import{r as p,R as U,j as e,u as dn,a as ze,e as r1,s as P1,b as O1,c as Be,d as X1,f as wi,g as Le,h as xi,i as ki,k as Y1,l as s,m as _e,p as b1,n as Xe,o as Ze,q as Si,C as c1,t as Mi,v as Ti,w as N,L as wa,x as xa,y as ka,z as ge,A as C,B as v1,D as un,E as m,F as Sa,$ as zi,G as Ma,H as Ta,I as Ne,J as gn,K as X,M as Ii,N as Ai,O as Ei,P as K,Q as d1,S as O,T as H,U as R,V as za,W as Ia,X as Vi,Y as Aa,Z as Di,_ as Pi,a0 as Oi,a1 as Fi,a2 as _i,a3 as Ni,a4 as Ri,a5 as $i,a6 as Hi,a7 as C1,a8 as Ki,a9 as Bi,aa as Zi,ab as ji,ac as Me,ad as J1,ae as en,af as nn,ag as _,ah as Te,ai as $n,aj as Gi,ak as Ui,al as Ea,am as Wi,an as Qi,ao as qi,ap as Xi,aq as Yi,ar as Ji,as as er,at as nr,au as ar,av as tr,aw as ir,ax as F,ay as mn,az as rr,aA as or,aB as lr,aC as sr,aD as cr,aE as Hn,aF as Ee,aG as Va,aH as dr,aI as Da,aJ as ur,aK as gr,aL as pn,aM as mr,aN as pr,aO as hr,aP as fr,aQ as br,aR as vr,aS as Cr,aT as Kn,aU as yr,aV as Lr,aW as wr,aX as F1,aY as xr,aZ as kr,a_ as Sr,a$ as Mr,b0 as Tr,b1 as zr,b2 as Ir,b3 as Ar,b4 as Er}from"./vendor-BfhM_F1u.js";import{a as Bn,R as Vr,b as Dr,c as Pr,m as Or,T as Fr,u as _r}from"./pages-CZ0wMeOx.js";import{u as Nr,_ as Pa,a as he,T as le,E as Oa,b as Re,c as fe,d as Rr,D as y1,e as $r,f as ue,g as Hr,C as Fa,P as hn,h as _a,i as Kr,F as Na,I as Br,j as Zr,k as jr,l as Gr,m as Ur,n as Wr,o as Qr,p as qr,q as Ra,r as $a,s as Xr,t as Yr}from"./vendor-arizeai-CxXYQNUl.js";import{L as Ha,a as Ka,d as Ue,E as fn,k as Ba,b as Za,l as an,h as Jr,j as eo,c as no,e as ao,f as to,s as io,g as Ye,i as Je,R as e1,p as ro,m as oo}from"./vendor-codemirror-B0NIFPOL.js";import{V as lo}from"./vendor-three-C5WAXd5r.js";const ja=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"},o=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],l=[{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:o,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:o,storageKey:null}]}],storageKey:null}];return{fragment:{argumentDefinitions:[n,a,t,i,r],kind:"Fragment",metadata:null,name:"pointCloudStore_clusterMetricsQuery",selections:l,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a,i,r],kind:"Operation",name:"pointCloudStore_clusterMetricsQuery",selections:l},params:{cacheID:"86666967012812887ac0a0149d2d2535",id:null,metadata:{},name:"pointCloudStore_clusterMetricsQuery",operationKind:"query",text:`query pointCloudStore_clusterMetricsQuery(
1
+ import{r as p,R as U,j as e,u as dn,a as ze,e as r1,s as P1,b as O1,c as Be,d as X1,f as wi,g as Le,h as xi,i as ki,k as Y1,l as s,m as _e,p as b1,n as Xe,o as Ze,q as Si,C as c1,t as Mi,v as Ti,w as N,L as wa,x as xa,y as ka,z as ge,A as C,B as v1,D as un,E as m,F as Sa,$ as zi,G as Ma,H as Ta,I as Ne,J as gn,K as X,M as Ii,N as Ai,O as Ei,P as K,Q as d1,S as O,T as H,U as R,V as za,W as Ia,X as Vi,Y as Aa,Z as Di,_ as Pi,a0 as Oi,a1 as Fi,a2 as _i,a3 as Ni,a4 as Ri,a5 as $i,a6 as Hi,a7 as C1,a8 as Ki,a9 as Bi,aa as Zi,ab as ji,ac as Me,ad as J1,ae as en,af as nn,ag as _,ah as Te,ai as $n,aj as Gi,ak as Ui,al as Ea,am as Wi,an as Qi,ao as qi,ap as Xi,aq as Yi,ar as Ji,as as er,at as nr,au as ar,av as tr,aw as ir,ax as F,ay as mn,az as rr,aA as or,aB as lr,aC as sr,aD as cr,aE as Hn,aF as Ee,aG as Va,aH as dr,aI as Da,aJ as ur,aK as gr,aL as pn,aM as mr,aN as pr,aO as hr,aP as fr,aQ as br,aR as vr,aS as Cr,aT as Kn,aU as yr,aV as Lr,aW as wr,aX as F1,aY as xr,aZ as kr,a_ as Sr,a$ as Mr,b0 as Tr,b1 as zr,b2 as Ir,b3 as Ar,b4 as Er}from"./vendor-BfhM_F1u.js";import{a as Bn,R as Vr,b as Dr,c as Pr,m as Or,T as Fr,u as _r}from"./pages-CJUakDKi.js";import{u as Nr,_ as Pa,a as he,T as le,E as Oa,b as Re,c as fe,d as Rr,D as y1,e as $r,f as ue,g as Hr,C as Fa,P as hn,h as _a,i as Kr,F as Na,I as Br,j as Zr,k as jr,l as Gr,m as Ur,n as Wr,o as Qr,p as qr,q as Ra,r as $a,s as Xr,t as Yr}from"./vendor-arizeai-CxXYQNUl.js";import{L as Ha,a as Ka,d as Ue,E as fn,k as Ba,b as Za,l as an,h as Jr,j as eo,c as no,e as ao,f as to,s as io,g as Ye,i as Je,R as e1,p as ro,m as oo}from"./vendor-codemirror-B0NIFPOL.js";import{V as lo}from"./vendor-three-C5WAXd5r.js";const ja=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"},o=[{alias:null,args:null,kind:"ScalarField",name:"primaryValue",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"referenceValue",storageKey:null}],l=[{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:o,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:o,storageKey:null}]}],storageKey:null}];return{fragment:{argumentDefinitions:[n,a,t,i,r],kind:"Fragment",metadata:null,name:"pointCloudStore_clusterMetricsQuery",selections:l,type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,t,a,i,r],kind:"Operation",name:"pointCloudStore_clusterMetricsQuery",selections:l},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
@@ -1755,6 +1755,9 @@ import{r as p,R as U,j as e,u as dn,a as ze,e as r1,s as P1,b as O1,c as Be,d as
1755
1755
  }
1756
1756
  }
1757
1757
  `;function W2(n,a){const{size:t="M",...i}=n;return e(nt,{size:t,children:e(ir,{"data-size":t,className:"ac-select",ref:a,...i,css:m(be,U2)})})}p.forwardRef(W2);const Q2=p.forwardRef((n,a)=>{const{children:t,...i}=n;return e(d1,{...i,ref:a,children:({isSelected:r})=>s(k,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e("span",{children:t}),r&&e(M,{svg:e(xt,{})})]})})});Q2.displayName="SelectItem";const h1={OPENAI:["required","auto","none"],AZURE_OPENAI:["required","auto","none"],ANTHROPIC:["any","auto","none"]},q2=(n,a)=>{switch(n){case"AZURE_OPENAI":case"OPENAI":return J(a)&&"type"in a&&typeof a.type=="string"?a.type:a;case"ANTHROPIC":return J(a)&&"type"in a&&typeof a.type=="string"?a.type:a;case"GOOGLE":return"auto";default:I()}},H4=n=>n in h1,ca=(n,a)=>{var t;return((t=h1[n])==null?void 0:t.includes(a))??!1},f1="tool_",da=n=>`${f1}${n}`,ua=n=>n.startsWith(f1)?n.slice(f1.length):n,X2=({choiceType:n})=>{switch(n){case"any":case"required":return s(k,{gap:"size-100",width:"100%",children:["Use at least one tool"," ",e(ke,{color:"var(--ac-global-color-grey-900)",size:"S",children:n})]});case"none":return s(k,{gap:"size-100",width:"100%",children:["Don't use any tools"," ",e(ke,{color:"var(--ac-global-color-grey-900)",size:"S",children:n})]});case"auto":default:return s(k,{gap:"size-100",width:"100%",children:["Tools auto-selected by LLM"," ",e(ke,{color:"var(--ac-global-color-grey-900)",size:"S",children:n})]})}};function K4({choice:n,onChange:a,toolNames:t,provider:i}){const r=q2(i,n),l=ca(i,r)?r:da(xl(n)??"");return e(Re,{selectedKey:l,label:"Tool Choice","aria-label":"Tool Choice for an LLM",onSelectionChange:c=>{if(typeof c=="string"){if(c.startsWith(f1))switch(i){case"AZURE_OPENAI":case"OPENAI":a(Jn({type:"function",function:{name:ua(c)}}));break;case"ANTHROPIC":a(ea({type:"tool",name:ua(c)}));break;default:I()}else if(ca(i,c))switch(i){case"AZURE_OPENAI":case"OPENAI":a(Jn(c));break;case"ANTHROPIC":a(ea({type:c}));break;default:I()}}},children:[...h1[i]?h1[i].map(c=>e(F,{textValue:c,children:e(X2,{choiceType:c})},c)):[],...t.map(c=>e(F,{textValue:c,children:c},da(c)))]})}const Y2=({height:n})=>s("svg",{viewBox:"0 0 24 24",width:n,height:n,xmlns:"http://www.w3.org/2000/svg",children:[e("title",{children:"Azure"}),e("path",{d:"M11.49 2H2v9.492h9.492V2h-.002z",fill:"#F25022"}),e("path",{d:"M22 2h-9.492v9.492H22V2z",fill:"#7FBA00"}),e("path",{d:"M11.49 12.508H2V22h9.492v-9.492h-.002z",fill:"#00A4EF"}),e("path",{d:"M22 12.508h-9.492V22H22v-9.492z",fill:"#FFB900"})]}),J2=({height:n})=>s("svg",{viewBox:"0 0 24 24",width:n,height:n,xmlns:"http://www.w3.org/2000/svg",children:[e("title",{children:"Google"}),e("defs",{children:s("linearGradient",{id:"lobe-icons-google-fill",x1:"0%",x2:"68.73%",y1:"100%",y2:"30.395%",children:[e("stop",{offset:"0%",stopColor:"#1C7DFF"}),e("stop",{offset:"52.021%",stopColor:"#1C69FF"}),e("stop",{offset:"100%",stopColor:"#F0DCD6"})]})}),e("path",{d:"M12 24A14.304 14.304 0 000 12 14.304 14.304 0 0012 0a14.305 14.305 0 0012 12 14.305 14.305 0 00-12 12",fill:"url(#lobe-icons-google-fill)",fillRule:"nonzero"})]}),es=({height:n})=>s("svg",{fill:"var(--ac-global-text-color-900)",fillRule:"evenodd",viewBox:"0 0 24 24",width:n,height:n,xmlns:"http://www.w3.org/2000/svg",children:[e("title",{children:"OpenAI"}),e("path",{d:"M21.55 10.004a5.416 5.416 0 00-.478-4.501c-1.217-2.09-3.662-3.166-6.05-2.66A5.59 5.59 0 0010.831 1C8.39.995 6.224 2.546 5.473 4.838A5.553 5.553 0 001.76 7.496a5.487 5.487 0 00.691 6.5 5.416 5.416 0 00.477 4.502c1.217 2.09 3.662 3.165 6.05 2.66A5.586 5.586 0 0013.168 23c2.443.006 4.61-1.546 5.361-3.84a5.553 5.553 0 003.715-2.66 5.488 5.488 0 00-.693-6.497v.001zm-8.381 11.558a4.199 4.199 0 01-2.675-.954c.034-.018.093-.05.132-.074l4.44-2.53a.71.71 0 00.364-.623v-6.176l1.877 1.069c.02.01.033.029.036.05v5.115c-.003 2.274-1.87 4.118-4.174 4.123zM4.192 17.78a4.059 4.059 0 01-.498-2.763c.032.02.09.055.131.078l4.44 2.53c.225.13.504.13.73 0l5.42-3.088v2.138a.068.068 0 01-.027.057L9.9 19.288c-1.999 1.136-4.552.46-5.707-1.51h-.001zM3.023 8.216A4.15 4.15 0 015.198 6.41l-.002.151v5.06a.711.711 0 00.364.624l5.42 3.087-1.876 1.07a.067.067 0 01-.063.005l-4.489-2.559c-1.995-1.14-2.679-3.658-1.53-5.63h.001zm15.417 3.54l-5.42-3.088L14.896 7.6a.067.067 0 01.063-.006l4.489 2.557c1.998 1.14 2.683 3.662 1.529 5.633a4.163 4.163 0 01-2.174 1.807V12.38a.71.71 0 00-.363-.623zm1.867-2.773a6.04 6.04 0 00-.132-.078l-4.44-2.53a.731.731 0 00-.729 0l-5.42 3.088V7.325a.068.068 0 01.027-.057L14.1 4.713c2-1.137 4.555-.46 5.707 1.513.487.833.664 1.809.499 2.757h.001zm-11.741 3.81l-1.877-1.068a.065.065 0 01-.036-.051V6.559c.001-2.277 1.873-4.122 4.181-4.12.976 0 1.92.338 2.671.954-.034.018-.092.05-.131.073l-4.44 2.53a.71.71 0 00-.365.623l-.003 6.173v.002zm1.02-2.168L12 9.25l2.414 1.375v2.75L12 14.75l-2.415-1.375v-2.75z"})]}),ns=({height:n})=>s("svg",{fill:"var(--ac-global-text-color-900)",fillRule:"evenodd",viewBox:"0 0 24 24",width:n,height:n,xmlns:"http://www.w3.org/2000/svg",children:[e("title",{children:"Anthropic"}),e("path",{d:"M13.827 3.52h3.603L24 20h-3.603l-6.57-16.48zm-7.258 0h3.767L16.906 20h-3.674l-1.343-3.461H5.017l-1.344 3.46H0L6.57 3.522zm4.132 9.959L8.453 7.687 6.205 13.48H10.7z"})]}),as={AZURE_OPENAI:Y2,GOOGLE:J2,OPENAI:es,ANTHROPIC:ns};function B4({provider:n,height:a=18}){return as[n]({height:a})}const Dt=m`
1758
+ // fixes table row sizing issues with full height cell children
1759
+ // this enables features like hovering anywhere on a cell to display controls
1760
+ height: fit-content;
1758
1761
  font-size: var(--ac-global-font-size-s);
1759
1762
  width: 100%;
1760
1763
  border-collapse: separate;
@@ -1814,6 +1817,8 @@ import{r as p,R as U,j as e,u as dn,a as ze,e as r1,s as P1,b as O1,c as Be,d as
1814
1817
  }
1815
1818
  tbody:not(.is-empty) {
1816
1819
  tr {
1820
+ // when paired with table.height:fit-content, allows table cells and their children to fill entire row height
1821
+ height: 100%;
1817
1822
  &:not(:last-of-type) {
1818
1823
  & > td {
1819
1824
  border-bottom: 1px solid var(--ac-global-border-color-default);
@@ -1,4 +1,4 @@
1
- import{r as t,j as o,bp as z,l as c,P as w,R as P,E as b,cx as k,ei as S,ej as F,ek as L,bF as C,el as l,w as E,em as R}from"./vendor-BfhM_F1u.js";import{c as I,x as j,D as A,K as T,M as _}from"./vendor-arizeai-CxXYQNUl.js";import{L as D,r as O,d as G,e as M,F as N,f as V,P as q,h as K,M as m,g as U,D as W,i as B,E as H,j as J,k as Y,p as $,l as X,n as p,o as Z,q as Q,s as oo,S as lo,t as ao,v as ro,w as co,x as go,y as eo,z as bo,A as u,B as f,C as y,G as no,H as io,I as so,J as to,K as mo,N as po,O as uo,Q as fo,U as yo,V as vo,W as ho,X as xo,Y as zo,Z as wo,_ as Po,$ as ko,a0 as So,a1 as Fo,a2 as Lo,a3 as Co,a4 as Eo,a5 as Ro,a6 as Io,a7 as jo,a8 as Ao,a9 as To,aa as _o,ab as Do,ac as Oo,ad as Go,ae as Mo,af as No,ag as Vo,ah as qo}from"./pages-CZ0wMeOx.js";import{z as Ko,dX as Uo,bH as Wo,R as Bo,dY as Ho,dZ as Jo}from"./components-BEtrHoeq.js";import"./vendor-three-C5WAXd5r.js";import"./vendor-codemirror-B0NIFPOL.js";import"./vendor-shiki-C5bJ-RPf.js";import"./vendor-recharts-CrrDFWK1.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const g of r)if(g.type==="childList")for(const n of g.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&s(n)}).observe(document,{childList:!0,subtree:!0});function i(r){const g={};return r.integrity&&(g.integrity=r.integrity),r.referrerPolicy&&(g.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?g.credentials="include":r.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function s(r){if(r.ep)return;r.ep=!0;const g=i(r);fetch(r.href,g)}})();const v="arize-phoenix-feature-flags",d={__RESET__:!1};function Yo(){const a=localStorage.getItem(v);if(!a)return d;try{const e=JSON.parse(a);return Object.assign({},d,e)}catch{return d}}const h=t.createContext(null);function $o(){const a=P.useContext(h);if(a===null)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return a}function Xo(a){const[e,i]=t.useState(Yo()),s=r=>{localStorage.setItem(v,JSON.stringify(r)),i(r)};return o(h.Provider,{value:{featureFlags:e,setFeatureFlags:s},children:o(Zo,{children:a.children})})}function Zo(a){const{children:e}=a,{featureFlags:i,setFeatureFlags:s}=$o(),[r,g]=t.useState(!1);return z("ctrl+shift+f",()=>g(!0)),c(w,{children:[e,o(A,{type:"modal",isDismissable:!0,onDismiss:()=>g(!1),children:r&&o(I,{title:"Feature Flags",children:o(Ko,{height:"size-1000",padding:"size-100",children:Object.keys(i).map(n=>o(j,{isSelected:i[n],onChange:x=>s({...i,[n]:x}),children:n},n))})})})]})}const Qo=b`
1
+ import{r as t,j as o,bp as z,l as c,P as w,R as P,E as b,cx as k,ei as S,ej as F,ek as L,bF as C,el as l,w as E,em as R}from"./vendor-BfhM_F1u.js";import{c as I,x as j,D as A,K as T,M as _}from"./vendor-arizeai-CxXYQNUl.js";import{L as D,r as O,d as G,e as M,F as N,f as V,P as q,h as K,M as m,g as U,D as W,i as B,E as H,j as J,k as Y,p as $,l as X,n as p,o as Z,q as Q,s as oo,S as lo,t as ao,v as ro,w as co,x as go,y as eo,z as bo,A as u,B as f,C as y,G as no,H as io,I as so,J as to,K as mo,N as po,O as uo,Q as fo,U as yo,V as vo,W as ho,X as xo,Y as zo,Z as wo,_ as Po,$ as ko,a0 as So,a1 as Fo,a2 as Lo,a3 as Co,a4 as Eo,a5 as Ro,a6 as Io,a7 as jo,a8 as Ao,a9 as To,aa as _o,ab as Do,ac as Oo,ad as Go,ae as Mo,af as No,ag as Vo,ah as qo}from"./pages-CJUakDKi.js";import{z as Ko,dX as Uo,bH as Wo,R as Bo,dY as Ho,dZ as Jo}from"./components-DepxScNF.js";import"./vendor-three-C5WAXd5r.js";import"./vendor-codemirror-B0NIFPOL.js";import"./vendor-shiki-C5bJ-RPf.js";import"./vendor-recharts-CrrDFWK1.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const g of r)if(g.type==="childList")for(const n of g.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&s(n)}).observe(document,{childList:!0,subtree:!0});function i(r){const g={};return r.integrity&&(g.integrity=r.integrity),r.referrerPolicy&&(g.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?g.credentials="include":r.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function s(r){if(r.ep)return;r.ep=!0;const g=i(r);fetch(r.href,g)}})();const v="arize-phoenix-feature-flags",d={__RESET__:!1};function Yo(){const a=localStorage.getItem(v);if(!a)return d;try{const e=JSON.parse(a);return Object.assign({},d,e)}catch{return d}}const h=t.createContext(null);function $o(){const a=P.useContext(h);if(a===null)throw new Error("useFeatureFlags must be used within a FeatureFlagsProvider");return a}function Xo(a){const[e,i]=t.useState(Yo()),s=r=>{localStorage.setItem(v,JSON.stringify(r)),i(r)};return o(h.Provider,{value:{featureFlags:e,setFeatureFlags:s},children:o(Zo,{children:a.children})})}function Zo(a){const{children:e}=a,{featureFlags:i,setFeatureFlags:s}=$o(),[r,g]=t.useState(!1);return z("ctrl+shift+f",()=>g(!0)),c(w,{children:[e,o(A,{type:"modal",isDismissable:!0,onDismiss:()=>g(!1),children:r&&o(I,{title:"Feature Flags",children:o(Ko,{height:"size-1000",padding:"size-100",children:Object.keys(i).map(n=>o(j,{isSelected:i[n],onChange:x=>s({...i,[n]:x}),children:n},n))})})})]})}const Qo=b`
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{A as w,b5 as fe,b6 as Ae,b7 as ze,b8 as Tt,B as Dt,r as u,j as e,R as he,u as ut,w as I,l as s,aA as Le,aB as In,aD as we,aE as J,S as W,T as re,b9 as qe,ba as Je,ad as Dl,bb as Ki,ac as Qe,ah as ln,ag as G,U as xe,P as U,ax as ie,E as F,bc as Te,aI as ue,bd as Be,be as hm,a8 as _t,ay as Ca,a9 as Lt,bf as gn,bg as km,aJ as bm,bh as Sm,H as Ti,bi as mt,aP as _e,aO as Cn,bj as yn,bk as xn,m as yr,$ as vm,F as Pi,K as Cm,bl as Fm,bm as dl,bn as cl,bo as Ga,o as pt,bp as Km,aU as fr,bq as Tm,br as Ii,bs as Pm,bt as Im,bu as xm,bv as Dm,bw as _m,bx as Lm,by as wm,bz as Em,bA as Rm,bB as it,D as Mm,bC as Vm,bD as bt,g as hr,bE as Am,aF as _l,bF as kr,bG as br,bH as zm,ai as Nm,bI as $m,ae as Om,af as Qm,bJ as jm,n as qm}from"./vendor-BfhM_F1u.js";import{c as Z,D as ae,C as B,t as Ll,h as Dn,b as wt,L as Et,v as Rt,w as Sr,o as wl,P as Va,f as Oe,g as la,T as ve,E as Mt,q as ia,r as Aa,a as $e,d as ra,x as Fa,s as Vt,y as Bm,i as At,z as Um,A as Hm,B as Gm,G as El,H as Rl,u as Wm,J as Jm}from"./vendor-arizeai-CxXYQNUl.js";import{s as Zm,l as Xm,j as Ml,a as Ve,i as Vl,b as Ym,c as ep,d as ea,e as Fn,f as vr,D as Cr,g as Zn,h as tt,k as np,m as Ce,T as nn,n as ap,o as Al,p as xi,q as tp,r as Di,t as lp,u as ip,v as rp,G as zt,_ as h,w as v,x as V,I as _,E as gt,y as dn,z as C,A as X,R as Ke,B as Ie,C as ke,F as De,H as Ee,J as Re,K as cn,L as un,M as mn,N as zl,O as Fe,P as _n,Q as Fr,S as He,U as ne,V as ce,W as Ge,X as Kr,Y as It,Z as Ne,$ as zn,a0 as sp,a1 as Ye,a2 as Tr,a3 as Fl,a4 as Nl,a5 as $l,a6 as op,a7 as dp,a8 as Kl,a9 as St,aa as oe,ab as Pr,ac as cp,ad as up,ae as pn,af as mp,ag as En,ah as pp,ai as Ir,aj as Nt,ak as Ka,al as Ol,am as Ql,an as xr,ao as gp,ap as yp,aq as fp,ar as hp,as as kp,at as bp,au as Sp,av as rt,aw as vp,ax as me,ay as Tl,az as pe,aA as ge,aB as an,aC as Cp,aD as Fp,aE as Kp,aF as rn,aG as se,aH as Dr,aI as Tp,aJ as Pp,aK as Ip,aL as $t,aM as Ot,aN as _r,aO as xp,aP as Dp,aQ as _p,aR as Qt,aS as Lp,aT as Lr,aU as La,aV as st,aW as Ze,aX as wp,aY as jl,aZ as fn,a_ as Ep,a$ as Rp,b0 as Mp,b1 as Mn,b2 as Se,b3 as Ue,b4 as We,b5 as wr,b6 as sa,b7 as Me,b8 as za,b9 as Nn,ba as Vn,bb as jt,bc as Na,bd as Ta,be as Er,bf as sn,bg as Rr,bh as Vp,bi as ql,bj as fa,bk as Ap,bl as Gn,bm as zp,bn as Np,bo as Bl,bp as qt,bq as $n,br as oa,bs as _i,bt as Li,bu as $p,bv as Op,bw as Qp,bx as $a,by as jp,bz as qp,bA as ot,bB as Bp,bC as lt,bD as Kn,bE as Xn,bF as Bt,bG as Ut,bH as On,bI as Up,bJ as Hp,bK as on,bL as Tn,bM as ka,bN as Ul,bO as Mr,bP as Hl,bQ as Gp,bR as Wp,bS as Jp,bT as Gl,bU as Vr,bV as Ar,bW as zr,bX as Xe,bY as Nr,bZ as $r,b_ as Pl,b$ as Zp,c0 as Wl,c1 as Jl,c2 as Or,c3 as Xp,c4 as Yp,c5 as eg,c6 as Zl,c7 as ng,c8 as ag,c9 as Xl,ca as tg,cb as Qr,cc as lg,cd as ig,ce as rg,cf as sg,cg as og,ch as dg,ci as cg,cj as Ht,ck as ug,cl as mg,cm as jr,cn as qr,co as wi,cp as pg,cq as Ln,cr as Qn,cs as Yl,ct as Br,cu as Ur,cv as Ei,cw as Ri,cx as gg,cy as yg,cz as H,cA as Hr,cB as Gt,cC as Wt,cD as Oa,cE as Gr,cF as Qa,cG as ja,cH as Wr,cI as jn,cJ as Jt,cK as fg,cL as hg,cM as kg,cN as bg,cO as Sg,cP as vg,cQ as Cg,cR as ba,cS as Jr,cT as Fg,cU as Kg,cV as Mi,cW as Tg,cX as Pg,cY as Ig,cZ as xg,c_ as Dg,c$ as _g,d0 as Zr,d1 as Lg,d2 as wg,d3 as Eg,d4 as Rg,d5 as Sa,d6 as ei,d7 as Xr,d8 as _a,d9 as Zt,da as Yr,db as es,dc as ul,dd as Mg,de as ns,df as Vg,dg as ni,dh as Xt,di as kn,dj as Ag,dk as as,dl as zg,dm as Ng,dn as ts,dp as ls,dq as $g,dr as Og,ds as is,dt as Qg,du as na,dv as jg,dw as qg,dx as Vi,dy as Bg,dz as Ug,dA as Hg,dB as Gg,dC as Wg,dD as ml,dE as Jg,dF as wa,dG as Zg,dH as Xg,dI as Yg,dJ as ey,dK as Yt,dL as rs,dM as Ai,dN as ny,dO as ay,dP as ty,dQ as ly,dR as ss,dS as iy,dT as ry,dU as sy,dV as zi,dW as Ni}from"./components-BEtrHoeq.js";import{g as da,i as ca,d as oy,E as os,R as ua,k as ai,b as dy,p as yt,n as ds}from"./vendor-codemirror-B0NIFPOL.js";import{P as cs,C as us,T as qn,a as ms,R as Bn,b as ft,X as ma,Y as Pn,c as pa,B as Ra,A as dt,d as ps,e as ti,L as gs,f as cy}from"./vendor-recharts-CrrDFWK1.js";const uy=4,my={user:["user","human"],ai:["assistant","bot","ai"],system:["system"],tool:["tool"]},py="Unable to parse span input messages, expected messages which include a role and content.",gy="Unable to parse span output messages, expected messages which include a role and content.",yy="Unable to parse span output expected output.value to be present.",fy="Unable to parse span attributes, attributes must be valid JSON.",hy="Unable to parse model config, expected llm.model_name to be present.",ky="Unable to parse model config, expected llm.invocation_parameters JSON string to be present.",by="Unable to parse invocation parameters response_format, expected llm.invocation_parameters.response_format to be a well formed json object or undefined.",Sy="Unable to parse tools, expected tools to be an array of valid tools.",vy="Unable to parse prompt template variables, expected prompt template variables to be a valid JSON object string.",$i={AZURE_OPENAI:[],ANTHROPIC:["claude"],OPENAI:["gpt","o1"],GOOGLE:["gemini"]},Yn="TOOL_CHOICE",Ea="tool_choice",vn="RESPONSE_FORMAT",bn="response_format",Cy=[Yn,vn],Fy=w.object({tool_call:w.object({id:w.string().optional(),function:w.object({name:w.string(),arguments:w.string()}).partial()}).partial()}).partial(),ys=w.object({[fe.message]:w.object({[Ae.role]:w.string(),[Ae.content]:w.union([w.string(),w.array(w.record(w.string(),w.unknown()))]).default(""),[Ae.tool_calls]:w.array(Fy).optional(),[Ae.tool_call_id]:w.string().optional()})}),Ky=w.object({[fe.llm]:w.object({[ze.input_messages]:w.array(ys)})}),Ty=w.object({[fe.llm]:w.object({[ze.output_messages]:w.array(ys)})}),Py=w.object({[fe.output]:w.object({value:w.string()})}),fs=Zm()(w.enum(["user","ai","system","tool"])),Iy=w.object({id:w.number(),role:fs,content:w.string().optional(),toolCallId:w.string().optional(),toolCalls:w.array(Xm).optional()}),xy=w.array(Iy),hs=w.lazy(()=>w.record(Ml)),Dy=hs,ks=w.string().transform((n,a)=>{const{json:t}=Ve(n);if(!Vl(t))return a.addIssue({code:w.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),w.NEVER;const{success:l,data:i}=Dy.safeParse(t);return l?i:(a.addIssue({code:w.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),w.NEVER)}).default("{}"),_y=w.object({[fe.llm]:w.object({[ze.provider]:w.string().optional(),[ze.model_name]:w.string()})}),bs=w.object({[fe.llm]:w.object({[ze.invocation_parameters]:ks})}),Ly=w.object({[fe.llm]:w.object({[ze.invocation_parameters]:ks.pipe(w.object({response_format:hs.optional()}))})}),wy=w.object({url:w.object({full:w.string(),path:w.string().optional()})}),Ey=w.string().transform((n,a)=>{const{json:t}=Ve(n);return t==null||!Vl(t)?(a.addIssue({code:w.ZodIssueCode.custom,message:"The tool JSON schema must be a valid JSON object"}),w.NEVER):t}).transform((n,a)=>{const{data:t,success:l}=Ym.safeParse(n);return l?t:(a.addIssue({code:w.ZodIssueCode.custom,message:"The tool JSON schema must be a valid tool schema"}),w.NEVER)}),Ry=w.object({[fe.llm]:w.object({[ze.tools]:w.array(w.object({[fe.tool]:w.object({[Tt.json_schema]:Ey})}).optional()).optional()}).optional()}).optional(),My=w.lazy(()=>w.object({type:w.literal("json_schema"),json_schema:w.object({name:w.string().describe("The name of the schema"),schema:ep.describe("The schema itself in JSON schema format"),strict:w.literal(!0).describe("The schema must be strict")})})),Vy=Dt(My,{removeAdditionalStrategy:"passthrough"}),Ay=w.string().transform((n,a)=>{const{json:t}=Ve(n);return ea(t)?Object.entries(t).reduce((i,[r,o])=>{if(typeof o=="string")i[r]=o;else{const{json:d}=Fn(o);d!=null&&(i[r]=d)}return i},{}):(a.addIssue({code:w.ZodIssueCode.custom,message:"The prompt template variables must be a valid JSON object"}),w.NEVER)}),zy=w.object({[fe.llm]:w.object({[ze.prompt_template]:w.object({variables:Ay}).optional()}).optional()}).optional();function Ss(n){return fs.safeParse(n).success}function Wn(n){const a=n.toLowerCase();if(Ss(a))return a;for(const[t,l]of Object.entries(my))if(l.includes(a))return t;return np}function Ny({toolCalls:n,provider:a}){if(n!=null)return n.map(({tool_call:t})=>{var i,r,o,d;if(t==null)return null;let l={};if(((i=t.function)==null?void 0:i.arguments)!=null){const{json:c}=Ve(t.function.arguments);ea(c)&&(l=c)}switch(a){case"OPENAI":case"AZURE_OPENAI":return{id:t.id??"",type:"function",function:{name:((r=t.function)==null?void 0:r.name)??"",arguments:l}};case"ANTHROPIC":return{id:t.id??"",type:"tool_use",name:((o=t.function)==null?void 0:o.name)??"",input:l};case"GOOGLE":return{id:t.id??"",function:{name:((d=t.function)==null?void 0:d.name)??"",arguments:l}};default:Ce()}}).filter(t=>t!=null)}function vs({messages:n,provider:a}){return n.map(({message:t})=>({id:Zn(),role:t.tool_call_id!=null?Wn("tool"):Wn(t.role),content:typeof t.content=="string"?t.content:void 0,toolCalls:Ny({provider:a,toolCalls:t.tool_calls}),toolCallId:t.tool_call_id}))}function $y({provider:n,parsedAttributes:a}){var l;const t=Ky.safeParse(a);if(!t.success)return{messageParsingErrors:[py],messages:null};if(n==="ANTHROPIC"){const{success:i,data:r}=bs.safeParse(a);if(i){const o=t.data.llm.input_messages,d=(l=r.llm.invocation_parameters)==null?void 0:l.system;typeof d=="string"&&d&&(!o||o[0].message.role!=="system")&&t.data.llm.input_messages.unshift({message:{role:"system",content:d}})}}return{messageParsingErrors:[],messages:vs({provider:n,messages:t.data.llm.input_messages})}}function Oy({provider:n,parsedAttributes:a}){const t=[],l=Ty.safeParse(a);if(l.success)return{output:vs({provider:n,messages:l.data.llm.output_messages}),outputParsingErrors:t};t.push(gy);const i=Py.safeParse(a);return i.success?{output:i.data.output.value,outputParsingErrors:t}:(t.push(yy),{output:void 0,outputParsingErrors:t})}function Cs(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 Qy(n){for(const a of Object.keys($i))if($i[a].some(l=>n.includes(l)))return a;return Cr}function jy(n){const{success:a,data:t}=_y.safeParse(n);if(a){const l=Cs(t.llm.provider)||Qy(t.llm.model_name),i=qy(n);return{modelConfig:{...Object.fromEntries(Object.entries(i).filter(([r,o])=>o!==null)),modelName:t.llm.model_name,provider:l,invocationParameters:[],supportedInvocationParameters:[]},parsingErrors:[]}}return{modelConfig:null,parsingErrors:[hy]}}function qy(n){const{success:a,data:t}=wy.safeParse(n);if(a)try{const l=new URL(t.url.full);let i=l;if(t.url.path)try{i=new URL(t.url.full.split(t.url.path)[0])}catch{}return{baseUrl:`${i.origin}${i.pathname}`,endpoint:l.origin,apiVersion:l.searchParams.get("api-version")||null}}catch{}return{baseUrl:null,apiVersion:null,endpoint:null}}function By(n,a=[]){const{success:t,data:l}=bs.safeParse(n),i=[];return t||i.push(ky),{invocationParameters:ef((l==null?void 0:l.llm.invocation_parameters)??{},a),parsingErrors:i}}function Uy(n){const{success:a,data:t}=Ly.safeParse(n);return a?{responseFormat:t.llm.invocation_parameters.response_format,parsingErrors:[]}:{responseFormat:void 0,parsingErrors:[by]}}function Hy(n){var a;return(((a=n==null?void 0:n.llm)==null?void 0:a.tools)??[]).map(t=>(t==null?void 0:t.tool)==null?null:{id:tt(),definition:t.tool.json_schema}).filter(t=>t!=null)}function Gy(n){var l;const{data:a,success:t}=Ry.safeParse(n);return t?((l=a==null?void 0:a.llm)==null?void 0:l.tools)==null?{tools:null,parsingErrors:[]}:{tools:Hy(a),parsingErrors:[]}:{tools:null,parsingErrors:[Sy]}}function Wy(n){var l;const{success:a,data:t}=zy.safeParse(n);return a?((l=t==null?void 0:t.llm)==null?void 0:l.prompt_template)==null?{variables:null,parsingErrors:[]}:{variables:t.llm.prompt_template.variables,parsingErrors:[]}:{variables:null,parsingErrors:[vy]}}function Jy(n){const{instance:a,instanceMessages:t}=vr(),l={...a,template:{__type:"chat",messages:Object.values(t)}},{json:i,parseError:r}=Ve(n.attributes);if(r)return{playgroundInstance:{...l,spanId:(n==null?void 0:n.id)??null},parsingErrors:[fy]};const o=n.invocationParameters,d=jy(i);let{modelConfig:c}=d;const{parsingErrors:p}=d,{messages:f,messageParsingErrors:m}=$y({provider:(c==null?void 0:c.provider)??l.model.provider,parsedAttributes:i}),{output:g,outputParsingErrors:y}=Oy({provider:(c==null?void 0:c.provider)??l.model.provider,parsedAttributes:i}),{invocationParameters:k,parsingErrors:b}=By(i,o),{variables:S,parsingErrors:K}=Wy(i),{parsingErrors:T}=Uy(i);c=c!=null?{...c,invocationParameters:T.length>0?k.filter(D=>D.invocationName!==bn&&D.canonicalName!==vn):k}:null;const{tools:x,parsingErrors:L}=Gy(i),P=f==null?void 0:f.map(D=>({...D,content:D.role==="tool"?li(D.content):D.content}));return{playgroundInstance:{...l,model:c??l.model,template:P!=null?{__type:"chat",messages:P}:l.template,output:g,spanId:n.id,tools:x??l.tools},playgroundInput:S!=null?{variablesValueCache:S}:void 0,parsingErrors:[...m,...y,...p,...L,...b,...T,...K]}}const Zy=n=>xy.safeParse(n).success,Fs=({instance:n,templateFormat:a})=>{if(a==nn.NONE)return[];const t=new Set,l=n.template.__type,i=ap(a);switch(l){case"chat":{n.template.messages.forEach(r=>{(r.content==null?[]:i.extractVariables(r.content)).forEach(d=>{t.add(d)})});break}case"text_completion":{i.extractVariables(n.template.prompt).forEach(o=>{t.add(o)});break}default:Ce()}return Array.from(t)},Xy=({instances:n,templateFormat:a})=>a==nn.NONE?[]:Array.from(new Set(n.flatMap(t=>Fs({instance:t,templateFormat:a})))),Ks=({instances:n,templateFormat:a,input:t})=>{if(a==nn.NONE)return{variablesMap:{},variableKeys:[]};const l=Xy({instances:n,templateFormat:a}),i=t.variablesValueCache??{};return{variablesMap:l.reduce((o,d)=>(o[d]=i[d]||"",o),{}),variableKeys:l}};function aa(n,a){return n.invocationName===a.invocationName||n.canonicalName!=null&&a.canonicalName!=null&&n.canonicalName===a.canonicalName}const Yy=(n,a)=>n.filter(t=>a.some(l=>aa(l,t))).map(t=>{var l;return{...t,invocationName:((l=a.find(i=>aa(i,t)))==null?void 0:l.invocationName)??t.invocationName}}),qa=n=>n.replace(/_([a-z])/g,(a,t)=>t.toUpperCase()),ef=(n,a)=>Object.entries(n).map(([t,l])=>{const i=a.find(r=>r.canonicalName&&r.canonicalName.toLowerCase()===t.toLowerCase()||r.invocationName&&r.invocationName.toLowerCase()===t.toLowerCase());return i==null||i.invocationInputField==null||i.invocationName==null?null:{canonicalName:i.canonicalName,invocationName:i.invocationName,[qa(i.invocationInputField)]:l}}).filter(t=>t!=null),Ts=n=>{const{provider:a,validatedToolDefinition:t}=ip(n.definition);switch(a){case"OPENAI":case"AZURE_OPENAI":return t.function.name;case"ANTHROPIC":return t.name;case"UNKNOWN":return null;default:Ce()}},nf=({provider:n,toolNumber:a})=>{switch(n){case"OPENAI":case"AZURE_OPENAI":return{id:tt(),definition:Di(a)};case"ANTHROPIC":return{id:tt(),definition:lp(a)};case"GOOGLE":return{id:tt(),definition:Di(a)};default:Ce()}},af=n=>{switch(n){case"OPENAI":case"AZURE_OPENAI":return xi();case"ANTHROPIC":return tp();case"GOOGLE":return xi();default:Ce()}};function tf(n){return{content:n.content,role:lf(n.role),toolCalls:n.toolCalls,toolCallId:n.toolCallId}}function lf(n){switch(n){case"system":return"SYSTEM";case"user":return"USER";case"tool":return"TOOL";case"ai":return"AI";default:Ce()}}const Ps=({playgroundStore:n,instanceId:a,credentials:t})=>{var m;const{instances:l,allInstanceMessages:i}=n.getState(),r=l.find(g=>g.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 o=r.template.messageIds.map(g=>i[g]).filter(g=>g!=null),d=r.model.supportedInvocationParameters;let c=[...r.model.invocationParameters];const p=Al({toolChoice:r.toolChoice,targetProvider:r.model.provider});r.tools.length>0?(c=c.filter(g=>g.invocationName!==Ea&&g.canonicalName!==Yn),c.push({canonicalName:Yn,invocationName:Ea,valueJson:p})):c=c.filter(g=>g.invocationName!==Ea&&g.canonicalName!==Yn),c=d.length?Yy(c,d):c;const f=r.model.provider==="AZURE_OPENAI"?{endpoint:r.model.endpoint,apiVersion:r.model.apiVersion}:{};return{messages:o.map(tf),model:{providerKey:r.model.provider,name:r.model.modelName||"",baseUrl:r.model.baseUrl,...f},invocationParameters:xs(c,r.model.provider,r.model.modelName),tools:r.tools.length?r.tools.map(g=>g.definition):void 0,apiKey:t[r.model.provider]||null,promptName:(m=r.prompt)==null?void 0:m.name}},el=(n,a)=>{if(n.template.__type==="chat"){const{messageIds:t,...l}=n.template;return{...n,template:{...l,messages:n.template.messageIds.map(i=>a[i])}}}return n},rf=({playgroundStore:n,instanceId:a,credentials:t})=>{const l=Ps({playgroundStore:n,instanceId:a,credentials:t}),{instances:i,templateFormat:r,input:o,allInstanceMessages:d}=n.getState(),c=i.map(f=>el(f,d)),{variablesMap:p}=Ks({instances:c,input:o,templateFormat:r});return{...l,template:{variables:p,format:r}}},Oi=({playgroundStore:n,instanceId:a,credentials:t,datasetId:l})=>({...Ps({playgroundStore:n,instanceId:a,credentials:t}),templateFormat:n.getState().templateFormat,datasetId:l});function li(n){if(typeof n=="string"){const a=n.startsWith('"{')||n.startsWith('"[')||n.startsWith('"\\"');try{if(a){const l=JSON.parse(n),i=typeof l=="string"?JSON.parse(l):l;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 Is(n,a){return a.filter(t=>t.required).every(t=>n.some(l=>aa(l,t)))}const sf=n=>{for(const[a,t]of Object.entries(n))if(a.endsWith("DefaultValue")&&t!=null)return n[a]};function WC(n,a){const t=new Map(n.map(l=>[l.invocationName,l]));return a.forEach(l=>{var c;const i=l.invocationName,r=sf(l),o=qa(l.invocationInputField||"");if(!l.invocationName||!l.invocationInputField||!i||r==null||((c=t.get(i))==null?void 0:c[o])!=null)return;const d={canonicalName:l.canonicalName,invocationName:l.invocationName,[o]:r};t.set(i,d)}),Array.from(t.values())}const of=w.object({type:w.literal("enabled")}).passthrough(),df=w.object({type:w.enum(["any","tool"])}).passthrough(),cf=(n,a)=>{if(!a)return n;const t=n.some(l=>l.canonicalName==="ANTHROPIC_EXTENDED_THINKING"&&l.valueJson&&of.safeParse(l.valueJson).success);return n.filter(l=>{if(l.canonicalName==="ANTHROPIC_EXTENDED_THINKING"&&!l.valueJson)return!1;if(t){if(l.canonicalName==="TEMPERATURE"||l.canonicalName==="TOP_P")return!1;if(l.canonicalName===Yn)return!df.safeParse(l.valueJson).success}return!0})},xs=(n,a,t)=>a==="ANTHROPIC"?cf(n,t):n,Ds=u.createContext(null);function JC({children:n,...a}){const[t]=u.useState(()=>rp(a));return e(Ds.Provider,{value:t,children:n})}function Ma(n,a){const t=he.useContext(Ds);if(!t)throw new Error("Missing CredentialsContext.Provider in the tree");return ut(t,n,a)}const _s=u.createContext(null);function uf(){const n=u.useContext(_s);if(n===null)throw new Error("useFunctionality must be used within a FunctionalityProvider");return n}function ZC(n){return e(_s.Provider,{value:{authenticationEnabled:window.Config.authenticationEnabled},children:n.children})}const Ls={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,kind:"ScalarField",name:"apiKeyEnvVar",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"apiKeySet",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};Ls.hash="0168d590171b96e7a2e41449a41754be";function mf({query:n}){const[a,t]=u.useState(null),l=Ma(f=>f),i=Ma(f=>f.setCredential),r=I.useFragment(Ls,n),o=u.useMemo(()=>[...r.modelProviders],[r]),d=u.useMemo(()=>[{header:"Name",accessorKey:"name",cell:({row:f})=>s(h,{direction:"row",alignItems:"center",gap:"size-100",children:[e(zt,{provider:f.original.key,height:18}),f.original.name]})},{header:"Environment Variable",accessorKey:"apiKeyEnvVar",cell:({row:f})=>e(v,{children:f.original.apiKeyEnvVar})},{header:"configuration",accessorKey:"apiKeySet",cell:({row:f})=>f.original.dependenciesInstalled?l[f.original.key]?e(v,{color:"success",children:"local"}):f.original.apiKeySet?e(v,{color:"success",children:"configured on the server"}):e(v,{color:"text-700",children:"not configured"}):e(v,{color:"warning",children:"missing dependencies"})},{header:"",accessorKey:"id",cell:({row:f})=>e(h,{direction:"row",justifyContent:"end",gap:"size-100",width:"100%",children:e(V,{size:"S",leadingVisual:e(_,{svg:e(gt,{})}),onPress:()=>{t(f.original)}})})}],[l]),c=Le({columns:d,data:o,getCoreRowModel:we(),getSortedRowModel:In()}),p=c.getRowModel().rows;return s(B,{title:"AI Providers",bodyStyle:{padding:0},variant:"compact",children:[s("table",{css:dn,children:[e("thead",{children:c.getHeaderGroups().map(f=>e("tr",{children:f.headers.map(m=>e("th",{colSpan:m.colSpan,children:m.isPlaceholder?null:e("div",{children:J(m.column.columnDef.header,m.getContext())})},m.id))},f.id))}),e("tbody",{children:p.map(f=>e("tr",{children:f.getVisibleCells().map(m=>e("td",{children:J(m.column.columnDef.cell,m.getContext())},m.id))},f.id))})]}),e(ae,{type:"modal",isDismissable:!0,onDismiss:()=>t(null),children:a&&s(Z,{title:`Set ${a.name} API Key`,size:"S",children:[s(C,{padding:"size-200",children:[e(C,{paddingBottom:"size-100",children:s(v,{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."]})}),s(X,{onChange:f=>{i({provider:a.key,value:f})},value:l[a.key],type:"password",children:[e(W,{children:`${a.name} API Key`}),e(re,{placeholder:`e.g. ${a.apiKeyEnvVar}`}),e(v,{slot:"description",children:"The API key will be stored locally in your browser"})]})]}),e(C,{paddingX:"size-200",paddingY:"size-100",borderTopWidth:"thin",borderColor:"light",children:e(h,{direction:"row",justifyContent:"end",gap:"size-100",children:e(V,{variant:"primary",size:"S",onPress:()=>{t(null)},children:"Set API Key"})})})]})})]})}function XC(){const n=qe();return Je(n),e(mf,{query:n})}const ws={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,kind:"ScalarField",name:"apiKeyEnvVar",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"apiKeySet",storageKey:null}],storageKey:null}]},params:{cacheID:"cc6e19e54ea894e905970362ee382e43",id:null,metadata:{},name:"settingsAIProvidersPageLoaderQuery",operationKind:"query",text:`query settingsAIProvidersPageLoaderQuery {
1
+ import{A as w,b5 as fe,b6 as Ae,b7 as ze,b8 as Tt,B as Dt,r as u,j as e,R as he,u as ut,w as I,l as s,aA as Le,aB as In,aD as we,aE as J,S as W,T as re,b9 as qe,ba as Je,ad as Dl,bb as Ki,ac as Qe,ah as ln,ag as G,U as xe,P as U,ax as ie,E as F,bc as Te,aI as ue,bd as Be,be as hm,a8 as _t,ay as Ca,a9 as Lt,bf as gn,bg as km,aJ as bm,bh as Sm,H as Ti,bi as mt,aP as _e,aO as Cn,bj as yn,bk as xn,m as yr,$ as vm,F as Pi,K as Cm,bl as Fm,bm as dl,bn as cl,bo as Ga,o as pt,bp as Km,aU as fr,bq as Tm,br as Ii,bs as Pm,bt as Im,bu as xm,bv as Dm,bw as _m,bx as Lm,by as wm,bz as Em,bA as Rm,bB as it,D as Mm,bC as Vm,bD as bt,g as hr,bE as Am,aF as _l,bF as kr,bG as br,bH as zm,ai as Nm,bI as $m,ae as Om,af as Qm,bJ as jm,n as qm}from"./vendor-BfhM_F1u.js";import{c as Z,D as ae,C as B,t as Ll,h as Dn,b as wt,L as Et,v as Rt,w as Sr,o as wl,P as Va,f as Oe,g as la,T as ve,E as Mt,q as ia,r as Aa,a as $e,d as ra,x as Fa,s as Vt,y as Bm,i as At,z as Um,A as Hm,B as Gm,G as El,H as Rl,u as Wm,J as Jm}from"./vendor-arizeai-CxXYQNUl.js";import{s as Zm,l as Xm,j as Ml,a as Ve,i as Vl,b as Ym,c as ep,d as ea,e as Fn,f as vr,D as Cr,g as Zn,h as tt,k as np,m as Ce,T as nn,n as ap,o as Al,p as xi,q as tp,r as Di,t as lp,u as ip,v as rp,G as zt,_ as h,w as v,x as V,I as _,E as gt,y as dn,z as C,A as X,R as Ke,B as Ie,C as ke,F as De,H as Ee,J as Re,K as cn,L as un,M as mn,N as zl,O as Fe,P as _n,Q as Fr,S as He,U as ne,V as ce,W as Ge,X as Kr,Y as It,Z as Ne,$ as zn,a0 as sp,a1 as Ye,a2 as Tr,a3 as Fl,a4 as Nl,a5 as $l,a6 as op,a7 as dp,a8 as Kl,a9 as St,aa as oe,ab as Pr,ac as cp,ad as up,ae as pn,af as mp,ag as En,ah as pp,ai as Ir,aj as Nt,ak as Ka,al as Ol,am as Ql,an as xr,ao as gp,ap as yp,aq as fp,ar as hp,as as kp,at as bp,au as Sp,av as rt,aw as vp,ax as me,ay as Tl,az as pe,aA as ge,aB as an,aC as Cp,aD as Fp,aE as Kp,aF as rn,aG as se,aH as Dr,aI as Tp,aJ as Pp,aK as Ip,aL as $t,aM as Ot,aN as _r,aO as xp,aP as Dp,aQ as _p,aR as Qt,aS as Lp,aT as Lr,aU as La,aV as st,aW as Ze,aX as wp,aY as jl,aZ as fn,a_ as Ep,a$ as Rp,b0 as Mp,b1 as Mn,b2 as Se,b3 as Ue,b4 as We,b5 as wr,b6 as sa,b7 as Me,b8 as za,b9 as Nn,ba as Vn,bb as jt,bc as Na,bd as Ta,be as Er,bf as sn,bg as Rr,bh as Vp,bi as ql,bj as fa,bk as Ap,bl as Gn,bm as zp,bn as Np,bo as Bl,bp as qt,bq as $n,br as oa,bs as _i,bt as Li,bu as $p,bv as Op,bw as Qp,bx as $a,by as jp,bz as qp,bA as ot,bB as Bp,bC as lt,bD as Kn,bE as Xn,bF as Bt,bG as Ut,bH as On,bI as Up,bJ as Hp,bK as on,bL as Tn,bM as ka,bN as Ul,bO as Mr,bP as Hl,bQ as Gp,bR as Wp,bS as Jp,bT as Gl,bU as Vr,bV as Ar,bW as zr,bX as Xe,bY as Nr,bZ as $r,b_ as Pl,b$ as Zp,c0 as Wl,c1 as Jl,c2 as Or,c3 as Xp,c4 as Yp,c5 as eg,c6 as Zl,c7 as ng,c8 as ag,c9 as Xl,ca as tg,cb as Qr,cc as lg,cd as ig,ce as rg,cf as sg,cg as og,ch as dg,ci as cg,cj as Ht,ck as ug,cl as mg,cm as jr,cn as qr,co as wi,cp as pg,cq as Ln,cr as Qn,cs as Yl,ct as Br,cu as Ur,cv as Ei,cw as Ri,cx as gg,cy as yg,cz as H,cA as Hr,cB as Gt,cC as Wt,cD as Oa,cE as Gr,cF as Qa,cG as ja,cH as Wr,cI as jn,cJ as Jt,cK as fg,cL as hg,cM as kg,cN as bg,cO as Sg,cP as vg,cQ as Cg,cR as ba,cS as Jr,cT as Fg,cU as Kg,cV as Mi,cW as Tg,cX as Pg,cY as Ig,cZ as xg,c_ as Dg,c$ as _g,d0 as Zr,d1 as Lg,d2 as wg,d3 as Eg,d4 as Rg,d5 as Sa,d6 as ei,d7 as Xr,d8 as _a,d9 as Zt,da as Yr,db as es,dc as ul,dd as Mg,de as ns,df as Vg,dg as ni,dh as Xt,di as kn,dj as Ag,dk as as,dl as zg,dm as Ng,dn as ts,dp as ls,dq as $g,dr as Og,ds as is,dt as Qg,du as na,dv as jg,dw as qg,dx as Vi,dy as Bg,dz as Ug,dA as Hg,dB as Gg,dC as Wg,dD as ml,dE as Jg,dF as wa,dG as Zg,dH as Xg,dI as Yg,dJ as ey,dK as Yt,dL as rs,dM as Ai,dN as ny,dO as ay,dP as ty,dQ as ly,dR as ss,dS as iy,dT as ry,dU as sy,dV as zi,dW as Ni}from"./components-DepxScNF.js";import{g as da,i as ca,d as oy,E as os,R as ua,k as ai,b as dy,p as yt,n as ds}from"./vendor-codemirror-B0NIFPOL.js";import{P as cs,C as us,T as qn,a as ms,R as Bn,b as ft,X as ma,Y as Pn,c as pa,B as Ra,A as dt,d as ps,e as ti,L as gs,f as cy}from"./vendor-recharts-CrrDFWK1.js";const uy=4,my={user:["user","human"],ai:["assistant","bot","ai"],system:["system"],tool:["tool"]},py="Unable to parse span input messages, expected messages which include a role and content.",gy="Unable to parse span output messages, expected messages which include a role and content.",yy="Unable to parse span output expected output.value to be present.",fy="Unable to parse span attributes, attributes must be valid JSON.",hy="Unable to parse model config, expected llm.model_name to be present.",ky="Unable to parse model config, expected llm.invocation_parameters JSON string to be present.",by="Unable to parse invocation parameters response_format, expected llm.invocation_parameters.response_format to be a well formed json object or undefined.",Sy="Unable to parse tools, expected tools to be an array of valid tools.",vy="Unable to parse prompt template variables, expected prompt template variables to be a valid JSON object string.",$i={AZURE_OPENAI:[],ANTHROPIC:["claude"],OPENAI:["gpt","o1"],GOOGLE:["gemini"]},Yn="TOOL_CHOICE",Ea="tool_choice",vn="RESPONSE_FORMAT",bn="response_format",Cy=[Yn,vn],Fy=w.object({tool_call:w.object({id:w.string().optional(),function:w.object({name:w.string(),arguments:w.string()}).partial()}).partial()}).partial(),ys=w.object({[fe.message]:w.object({[Ae.role]:w.string(),[Ae.content]:w.union([w.string(),w.array(w.record(w.string(),w.unknown()))]).default(""),[Ae.tool_calls]:w.array(Fy).optional(),[Ae.tool_call_id]:w.string().optional()})}),Ky=w.object({[fe.llm]:w.object({[ze.input_messages]:w.array(ys)})}),Ty=w.object({[fe.llm]:w.object({[ze.output_messages]:w.array(ys)})}),Py=w.object({[fe.output]:w.object({value:w.string()})}),fs=Zm()(w.enum(["user","ai","system","tool"])),Iy=w.object({id:w.number(),role:fs,content:w.string().optional(),toolCallId:w.string().optional(),toolCalls:w.array(Xm).optional()}),xy=w.array(Iy),hs=w.lazy(()=>w.record(Ml)),Dy=hs,ks=w.string().transform((n,a)=>{const{json:t}=Ve(n);if(!Vl(t))return a.addIssue({code:w.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),w.NEVER;const{success:l,data:i}=Dy.safeParse(t);return l?i:(a.addIssue({code:w.ZodIssueCode.custom,message:"The invocation parameters must be a valid JSON object"}),w.NEVER)}).default("{}"),_y=w.object({[fe.llm]:w.object({[ze.provider]:w.string().optional(),[ze.model_name]:w.string()})}),bs=w.object({[fe.llm]:w.object({[ze.invocation_parameters]:ks})}),Ly=w.object({[fe.llm]:w.object({[ze.invocation_parameters]:ks.pipe(w.object({response_format:hs.optional()}))})}),wy=w.object({url:w.object({full:w.string(),path:w.string().optional()})}),Ey=w.string().transform((n,a)=>{const{json:t}=Ve(n);return t==null||!Vl(t)?(a.addIssue({code:w.ZodIssueCode.custom,message:"The tool JSON schema must be a valid JSON object"}),w.NEVER):t}).transform((n,a)=>{const{data:t,success:l}=Ym.safeParse(n);return l?t:(a.addIssue({code:w.ZodIssueCode.custom,message:"The tool JSON schema must be a valid tool schema"}),w.NEVER)}),Ry=w.object({[fe.llm]:w.object({[ze.tools]:w.array(w.object({[fe.tool]:w.object({[Tt.json_schema]:Ey})}).optional()).optional()}).optional()}).optional(),My=w.lazy(()=>w.object({type:w.literal("json_schema"),json_schema:w.object({name:w.string().describe("The name of the schema"),schema:ep.describe("The schema itself in JSON schema format"),strict:w.literal(!0).describe("The schema must be strict")})})),Vy=Dt(My,{removeAdditionalStrategy:"passthrough"}),Ay=w.string().transform((n,a)=>{const{json:t}=Ve(n);return ea(t)?Object.entries(t).reduce((i,[r,o])=>{if(typeof o=="string")i[r]=o;else{const{json:d}=Fn(o);d!=null&&(i[r]=d)}return i},{}):(a.addIssue({code:w.ZodIssueCode.custom,message:"The prompt template variables must be a valid JSON object"}),w.NEVER)}),zy=w.object({[fe.llm]:w.object({[ze.prompt_template]:w.object({variables:Ay}).optional()}).optional()}).optional();function Ss(n){return fs.safeParse(n).success}function Wn(n){const a=n.toLowerCase();if(Ss(a))return a;for(const[t,l]of Object.entries(my))if(l.includes(a))return t;return np}function Ny({toolCalls:n,provider:a}){if(n!=null)return n.map(({tool_call:t})=>{var i,r,o,d;if(t==null)return null;let l={};if(((i=t.function)==null?void 0:i.arguments)!=null){const{json:c}=Ve(t.function.arguments);ea(c)&&(l=c)}switch(a){case"OPENAI":case"AZURE_OPENAI":return{id:t.id??"",type:"function",function:{name:((r=t.function)==null?void 0:r.name)??"",arguments:l}};case"ANTHROPIC":return{id:t.id??"",type:"tool_use",name:((o=t.function)==null?void 0:o.name)??"",input:l};case"GOOGLE":return{id:t.id??"",function:{name:((d=t.function)==null?void 0:d.name)??"",arguments:l}};default:Ce()}}).filter(t=>t!=null)}function vs({messages:n,provider:a}){return n.map(({message:t})=>({id:Zn(),role:t.tool_call_id!=null?Wn("tool"):Wn(t.role),content:typeof t.content=="string"?t.content:void 0,toolCalls:Ny({provider:a,toolCalls:t.tool_calls}),toolCallId:t.tool_call_id}))}function $y({provider:n,parsedAttributes:a}){var l;const t=Ky.safeParse(a);if(!t.success)return{messageParsingErrors:[py],messages:null};if(n==="ANTHROPIC"){const{success:i,data:r}=bs.safeParse(a);if(i){const o=t.data.llm.input_messages,d=(l=r.llm.invocation_parameters)==null?void 0:l.system;typeof d=="string"&&d&&(!o||o[0].message.role!=="system")&&t.data.llm.input_messages.unshift({message:{role:"system",content:d}})}}return{messageParsingErrors:[],messages:vs({provider:n,messages:t.data.llm.input_messages})}}function Oy({provider:n,parsedAttributes:a}){const t=[],l=Ty.safeParse(a);if(l.success)return{output:vs({provider:n,messages:l.data.llm.output_messages}),outputParsingErrors:t};t.push(gy);const i=Py.safeParse(a);return i.success?{output:i.data.output.value,outputParsingErrors:t}:(t.push(yy),{output:void 0,outputParsingErrors:t})}function Cs(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 Qy(n){for(const a of Object.keys($i))if($i[a].some(l=>n.includes(l)))return a;return Cr}function jy(n){const{success:a,data:t}=_y.safeParse(n);if(a){const l=Cs(t.llm.provider)||Qy(t.llm.model_name),i=qy(n);return{modelConfig:{...Object.fromEntries(Object.entries(i).filter(([r,o])=>o!==null)),modelName:t.llm.model_name,provider:l,invocationParameters:[],supportedInvocationParameters:[]},parsingErrors:[]}}return{modelConfig:null,parsingErrors:[hy]}}function qy(n){const{success:a,data:t}=wy.safeParse(n);if(a)try{const l=new URL(t.url.full);let i=l;if(t.url.path)try{i=new URL(t.url.full.split(t.url.path)[0])}catch{}return{baseUrl:`${i.origin}${i.pathname}`,endpoint:l.origin,apiVersion:l.searchParams.get("api-version")||null}}catch{}return{baseUrl:null,apiVersion:null,endpoint:null}}function By(n,a=[]){const{success:t,data:l}=bs.safeParse(n),i=[];return t||i.push(ky),{invocationParameters:ef((l==null?void 0:l.llm.invocation_parameters)??{},a),parsingErrors:i}}function Uy(n){const{success:a,data:t}=Ly.safeParse(n);return a?{responseFormat:t.llm.invocation_parameters.response_format,parsingErrors:[]}:{responseFormat:void 0,parsingErrors:[by]}}function Hy(n){var a;return(((a=n==null?void 0:n.llm)==null?void 0:a.tools)??[]).map(t=>(t==null?void 0:t.tool)==null?null:{id:tt(),definition:t.tool.json_schema}).filter(t=>t!=null)}function Gy(n){var l;const{data:a,success:t}=Ry.safeParse(n);return t?((l=a==null?void 0:a.llm)==null?void 0:l.tools)==null?{tools:null,parsingErrors:[]}:{tools:Hy(a),parsingErrors:[]}:{tools:null,parsingErrors:[Sy]}}function Wy(n){var l;const{success:a,data:t}=zy.safeParse(n);return a?((l=t==null?void 0:t.llm)==null?void 0:l.prompt_template)==null?{variables:null,parsingErrors:[]}:{variables:t.llm.prompt_template.variables,parsingErrors:[]}:{variables:null,parsingErrors:[vy]}}function Jy(n){const{instance:a,instanceMessages:t}=vr(),l={...a,template:{__type:"chat",messages:Object.values(t)}},{json:i,parseError:r}=Ve(n.attributes);if(r)return{playgroundInstance:{...l,spanId:(n==null?void 0:n.id)??null},parsingErrors:[fy]};const o=n.invocationParameters,d=jy(i);let{modelConfig:c}=d;const{parsingErrors:p}=d,{messages:f,messageParsingErrors:m}=$y({provider:(c==null?void 0:c.provider)??l.model.provider,parsedAttributes:i}),{output:g,outputParsingErrors:y}=Oy({provider:(c==null?void 0:c.provider)??l.model.provider,parsedAttributes:i}),{invocationParameters:k,parsingErrors:b}=By(i,o),{variables:S,parsingErrors:K}=Wy(i),{parsingErrors:T}=Uy(i);c=c!=null?{...c,invocationParameters:T.length>0?k.filter(D=>D.invocationName!==bn&&D.canonicalName!==vn):k}:null;const{tools:x,parsingErrors:L}=Gy(i),P=f==null?void 0:f.map(D=>({...D,content:D.role==="tool"?li(D.content):D.content}));return{playgroundInstance:{...l,model:c??l.model,template:P!=null?{__type:"chat",messages:P}:l.template,output:g,spanId:n.id,tools:x??l.tools},playgroundInput:S!=null?{variablesValueCache:S}:void 0,parsingErrors:[...m,...y,...p,...L,...b,...T,...K]}}const Zy=n=>xy.safeParse(n).success,Fs=({instance:n,templateFormat:a})=>{if(a==nn.NONE)return[];const t=new Set,l=n.template.__type,i=ap(a);switch(l){case"chat":{n.template.messages.forEach(r=>{(r.content==null?[]:i.extractVariables(r.content)).forEach(d=>{t.add(d)})});break}case"text_completion":{i.extractVariables(n.template.prompt).forEach(o=>{t.add(o)});break}default:Ce()}return Array.from(t)},Xy=({instances:n,templateFormat:a})=>a==nn.NONE?[]:Array.from(new Set(n.flatMap(t=>Fs({instance:t,templateFormat:a})))),Ks=({instances:n,templateFormat:a,input:t})=>{if(a==nn.NONE)return{variablesMap:{},variableKeys:[]};const l=Xy({instances:n,templateFormat:a}),i=t.variablesValueCache??{};return{variablesMap:l.reduce((o,d)=>(o[d]=i[d]||"",o),{}),variableKeys:l}};function aa(n,a){return n.invocationName===a.invocationName||n.canonicalName!=null&&a.canonicalName!=null&&n.canonicalName===a.canonicalName}const Yy=(n,a)=>n.filter(t=>a.some(l=>aa(l,t))).map(t=>{var l;return{...t,invocationName:((l=a.find(i=>aa(i,t)))==null?void 0:l.invocationName)??t.invocationName}}),qa=n=>n.replace(/_([a-z])/g,(a,t)=>t.toUpperCase()),ef=(n,a)=>Object.entries(n).map(([t,l])=>{const i=a.find(r=>r.canonicalName&&r.canonicalName.toLowerCase()===t.toLowerCase()||r.invocationName&&r.invocationName.toLowerCase()===t.toLowerCase());return i==null||i.invocationInputField==null||i.invocationName==null?null:{canonicalName:i.canonicalName,invocationName:i.invocationName,[qa(i.invocationInputField)]:l}}).filter(t=>t!=null),Ts=n=>{const{provider:a,validatedToolDefinition:t}=ip(n.definition);switch(a){case"OPENAI":case"AZURE_OPENAI":return t.function.name;case"ANTHROPIC":return t.name;case"UNKNOWN":return null;default:Ce()}},nf=({provider:n,toolNumber:a})=>{switch(n){case"OPENAI":case"AZURE_OPENAI":return{id:tt(),definition:Di(a)};case"ANTHROPIC":return{id:tt(),definition:lp(a)};case"GOOGLE":return{id:tt(),definition:Di(a)};default:Ce()}},af=n=>{switch(n){case"OPENAI":case"AZURE_OPENAI":return xi();case"ANTHROPIC":return tp();case"GOOGLE":return xi();default:Ce()}};function tf(n){return{content:n.content,role:lf(n.role),toolCalls:n.toolCalls,toolCallId:n.toolCallId}}function lf(n){switch(n){case"system":return"SYSTEM";case"user":return"USER";case"tool":return"TOOL";case"ai":return"AI";default:Ce()}}const Ps=({playgroundStore:n,instanceId:a,credentials:t})=>{var m;const{instances:l,allInstanceMessages:i}=n.getState(),r=l.find(g=>g.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 o=r.template.messageIds.map(g=>i[g]).filter(g=>g!=null),d=r.model.supportedInvocationParameters;let c=[...r.model.invocationParameters];const p=Al({toolChoice:r.toolChoice,targetProvider:r.model.provider});r.tools.length>0?(c=c.filter(g=>g.invocationName!==Ea&&g.canonicalName!==Yn),c.push({canonicalName:Yn,invocationName:Ea,valueJson:p})):c=c.filter(g=>g.invocationName!==Ea&&g.canonicalName!==Yn),c=d.length?Yy(c,d):c;const f=r.model.provider==="AZURE_OPENAI"?{endpoint:r.model.endpoint,apiVersion:r.model.apiVersion}:{};return{messages:o.map(tf),model:{providerKey:r.model.provider,name:r.model.modelName||"",baseUrl:r.model.baseUrl,...f},invocationParameters:xs(c,r.model.provider,r.model.modelName),tools:r.tools.length?r.tools.map(g=>g.definition):void 0,apiKey:t[r.model.provider]||null,promptName:(m=r.prompt)==null?void 0:m.name}},el=(n,a)=>{if(n.template.__type==="chat"){const{messageIds:t,...l}=n.template;return{...n,template:{...l,messages:n.template.messageIds.map(i=>a[i])}}}return n},rf=({playgroundStore:n,instanceId:a,credentials:t})=>{const l=Ps({playgroundStore:n,instanceId:a,credentials:t}),{instances:i,templateFormat:r,input:o,allInstanceMessages:d}=n.getState(),c=i.map(f=>el(f,d)),{variablesMap:p}=Ks({instances:c,input:o,templateFormat:r});return{...l,template:{variables:p,format:r}}},Oi=({playgroundStore:n,instanceId:a,credentials:t,datasetId:l})=>({...Ps({playgroundStore:n,instanceId:a,credentials:t}),templateFormat:n.getState().templateFormat,datasetId:l});function li(n){if(typeof n=="string"){const a=n.startsWith('"{')||n.startsWith('"[')||n.startsWith('"\\"');try{if(a){const l=JSON.parse(n),i=typeof l=="string"?JSON.parse(l):l;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 Is(n,a){return a.filter(t=>t.required).every(t=>n.some(l=>aa(l,t)))}const sf=n=>{for(const[a,t]of Object.entries(n))if(a.endsWith("DefaultValue")&&t!=null)return n[a]};function WC(n,a){const t=new Map(n.map(l=>[l.invocationName,l]));return a.forEach(l=>{var c;const i=l.invocationName,r=sf(l),o=qa(l.invocationInputField||"");if(!l.invocationName||!l.invocationInputField||!i||r==null||((c=t.get(i))==null?void 0:c[o])!=null)return;const d={canonicalName:l.canonicalName,invocationName:l.invocationName,[o]:r};t.set(i,d)}),Array.from(t.values())}const of=w.object({type:w.literal("enabled")}).passthrough(),df=w.object({type:w.enum(["any","tool"])}).passthrough(),cf=(n,a)=>{if(!a)return n;const t=n.some(l=>l.canonicalName==="ANTHROPIC_EXTENDED_THINKING"&&l.valueJson&&of.safeParse(l.valueJson).success);return n.filter(l=>{if(l.canonicalName==="ANTHROPIC_EXTENDED_THINKING"&&!l.valueJson)return!1;if(t){if(l.canonicalName==="TEMPERATURE"||l.canonicalName==="TOP_P")return!1;if(l.canonicalName===Yn)return!df.safeParse(l.valueJson).success}return!0})},xs=(n,a,t)=>a==="ANTHROPIC"?cf(n,t):n,Ds=u.createContext(null);function JC({children:n,...a}){const[t]=u.useState(()=>rp(a));return e(Ds.Provider,{value:t,children:n})}function Ma(n,a){const t=he.useContext(Ds);if(!t)throw new Error("Missing CredentialsContext.Provider in the tree");return ut(t,n,a)}const _s=u.createContext(null);function uf(){const n=u.useContext(_s);if(n===null)throw new Error("useFunctionality must be used within a FunctionalityProvider");return n}function ZC(n){return e(_s.Provider,{value:{authenticationEnabled:window.Config.authenticationEnabled},children:n.children})}const Ls={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,kind:"ScalarField",name:"apiKeyEnvVar",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"apiKeySet",storageKey:null}],storageKey:null}],type:"Query",abstractKey:null};Ls.hash="0168d590171b96e7a2e41449a41754be";function mf({query:n}){const[a,t]=u.useState(null),l=Ma(f=>f),i=Ma(f=>f.setCredential),r=I.useFragment(Ls,n),o=u.useMemo(()=>[...r.modelProviders],[r]),d=u.useMemo(()=>[{header:"Name",accessorKey:"name",cell:({row:f})=>s(h,{direction:"row",alignItems:"center",gap:"size-100",children:[e(zt,{provider:f.original.key,height:18}),f.original.name]})},{header:"Environment Variable",accessorKey:"apiKeyEnvVar",cell:({row:f})=>e(v,{children:f.original.apiKeyEnvVar})},{header:"configuration",accessorKey:"apiKeySet",cell:({row:f})=>f.original.dependenciesInstalled?l[f.original.key]?e(v,{color:"success",children:"local"}):f.original.apiKeySet?e(v,{color:"success",children:"configured on the server"}):e(v,{color:"text-700",children:"not configured"}):e(v,{color:"warning",children:"missing dependencies"})},{header:"",accessorKey:"id",cell:({row:f})=>e(h,{direction:"row",justifyContent:"end",gap:"size-100",width:"100%",children:e(V,{size:"S",leadingVisual:e(_,{svg:e(gt,{})}),onPress:()=>{t(f.original)}})})}],[l]),c=Le({columns:d,data:o,getCoreRowModel:we(),getSortedRowModel:In()}),p=c.getRowModel().rows;return s(B,{title:"AI Providers",bodyStyle:{padding:0},variant:"compact",children:[s("table",{css:dn,children:[e("thead",{children:c.getHeaderGroups().map(f=>e("tr",{children:f.headers.map(m=>e("th",{colSpan:m.colSpan,children:m.isPlaceholder?null:e("div",{children:J(m.column.columnDef.header,m.getContext())})},m.id))},f.id))}),e("tbody",{children:p.map(f=>e("tr",{children:f.getVisibleCells().map(m=>e("td",{children:J(m.column.columnDef.cell,m.getContext())},m.id))},f.id))})]}),e(ae,{type:"modal",isDismissable:!0,onDismiss:()=>t(null),children:a&&s(Z,{title:`Set ${a.name} API Key`,size:"S",children:[s(C,{padding:"size-200",children:[e(C,{paddingBottom:"size-100",children:s(v,{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."]})}),s(X,{onChange:f=>{i({provider:a.key,value:f})},value:l[a.key],type:"password",children:[e(W,{children:`${a.name} API Key`}),e(re,{placeholder:`e.g. ${a.apiKeyEnvVar}`}),e(v,{slot:"description",children:"The API key will be stored locally in your browser"})]})]}),e(C,{paddingX:"size-200",paddingY:"size-100",borderTopWidth:"thin",borderColor:"light",children:e(h,{direction:"row",justifyContent:"end",gap:"size-100",children:e(V,{variant:"primary",size:"S",onPress:()=>{t(null)},children:"Set API Key"})})})]})})]})}function XC(){const n=qe();return Je(n),e(mf,{query:n})}const ws={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,kind:"ScalarField",name:"apiKeyEnvVar",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"apiKeySet",storageKey:null}],storageKey:null}]},params:{cacheID:"cc6e19e54ea894e905970362ee382e43",id:null,metadata:{},name:"settingsAIProvidersPageLoaderQuery",operationKind:"query",text:`query settingsAIProvidersPageLoaderQuery {
2
2
  ...GenerativeProvidersCard_data
3
3
  }
4
4
 
@@ -1884,7 +1884,6 @@ fragment SpanAside_span on Span {
1884
1884
  justify-content: center;
1885
1885
  height: 100%;
1886
1886
  min-height: 75px;
1887
- padding: var(--ac-global-dimension-static-size-200);
1888
1887
  .controls {
1889
1888
  transition: opacity 0.2s ease-in-out;
1890
1889
  opacity: 0;
@@ -1911,7 +1910,7 @@ fragment SpanAside_span on Span {
1911
1910
  overflow-y: auto;
1912
1911
  padding: var(--ac-global-dimension-static-size-100)
1913
1912
  var(--ac-global-dimension-static-size-200);
1914
- `,children:n})}function ck({getValue:n,collapseSingleKey:a}){const t=n();return e(yd,{children:e($a,{json:t,space:2,collapseSingleKey:a})})}function uk({isRunning:n,instanceVariables:a,datasetExampleInput:t}){const l=u.useMemo(()=>{const i=ea(t)?t:{};return a.filter(r=>i[r]==null)},[t,a]);return n?e(Fe,{}):l.length===0?null:e(yi,{children:`Missing input for variable${l.length>1?"s":""}: ${l.join(", ")}`})}function mk({exampleData:n,setDialog:a}){const{span:t,content:l,toolCalls:i,errorMessage:r,experimentRunId:o}=n,d=t!=null,c=o!=null,p=u.useMemo(()=>{if(d||c)return s(U,{children:[c&&s(ve,{children:[e(V,{size:"S","aria-label":"View experiment run details",leadingVisual:e(_,{svg:e(ot,{})}),onPress:()=>{u.startTransition(()=>{a(e(d0,{runId:o}))})}}),e($e,{children:"View run details"})]}),d&&e(U,{children:s(ve,{children:[e(V,{size:"S","aria-label":"View run trace",leadingVisual:e(_,{svg:e(jt,{})}),onPress:()=>{u.startTransition(()=>{a(e(md,{traceId:t.context.traceId,projectId:t.project.id,title:"Experiment Run Trace"}))})}}),e($e,{children:"View Trace"})]})})]})},[o,c,d,a,t]);return e(gd,{controls:p,children:s(h,{direction:"column",gap:"size-200",children:[r!=null?e(yi,{children:r}):null,e(v,{children:l}),i!=null?Object.values(i).map(f=>f==null?null:e(pd,{toolCall:f},f.id)):null,d?e(gk,{span:t}):null]})})}const pk=u.memo(function({isRunning:a,instanceId:t,exampleId:l,setDialog:i,instanceVariables:r,datasetExampleInput:o}){const d=xa(c=>{var p;return(p=c.exampleResponsesMap[t])==null?void 0:p[l]});return d==null?e(uk,{isRunning:a,instanceVariables:r,datasetExampleInput:o}):e(mk,{exampleData:d,setDialog:i})});function gk({span:n}){return s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(oa,{tokenCountTotal:n.tokenCountTotal||0,tokenCountPrompt:n.tokenCountPrompt||0,tokenCountCompletion:n.tokenCountCompletion||0}),e(Me,{latencyMs:n.latencyMs||0})]})}function fd({table:n}){return e("tbody",{children:n.getRowModel().rows.map(a=>e("tr",{children:a.getVisibleCells().map(t=>e("td",{style:{padding:0,height:1,width:`calc(var(--col-${t.column.id}-size) * 1px)`,wordBreak:"break-all"},children:J(t.column.columnDef.cell,t.getContext())},t.id))},a.id))})}const yk=he.memo(fd,(n,a)=>n.table.options.data===a.table.options.data);function fk({datasetId:n}){const a=I.useRelayEnvironment(),t=O(q=>q.instances),l=O(q=>q.allInstanceMessages),i=O(q=>q.templateFormat),r=O(q=>q.updateInstance),o=xa(q=>q.updateExampleData),d=xa(q=>q.setExampleDataForInstance),c=xa(q=>q.resetExampleData),p=xa(q=>q.appendExampleDataToolCallChunk),f=xa(q=>q.appendExampleDataTextChunk),[m,g]=u.useState(null),[,y]=xn(),k=t.some(q=>q.activeRunId!==null),b=Ma(q=>q),S=O(q=>q.markPlaygroundInstanceComplete),K=Ba(),T=Ie(),x=u.useCallback(q=>le=>{var M;if(le==null)return;const te=le.chatCompletionOverDataset;switch(te.__typename){case"ChatCompletionSubscriptionExperiment":r({instanceId:q,patch:{experimentId:te.experiment.id},dirty:null});break;case"ChatCompletionSubscriptionResult":if(te.datasetExampleId==null)return;o({instanceId:q,exampleId:te.datasetExampleId,patch:{span:te.span,experimentRunId:(M=te.experimentRun)==null?void 0:M.id}});break;case"ChatCompletionSubscriptionError":if(te.datasetExampleId==null)return;o({instanceId:q,exampleId:te.datasetExampleId,patch:{errorMessage:te.message}});break;case"TextChunk":if(te.datasetExampleId==null)return;f({instanceId:q,exampleId:te.datasetExampleId,textChunk:te.content});break;case"ToolCallChunk":{if(te.datasetExampleId==null)return;p({instanceId:q,exampleId:te.datasetExampleId,toolCallChunk:te});break}case"%other":return;default:return Ce()}},[f,p,o,r]),[L]=I.useMutation(Uo),P=u.useCallback(q=>(le,te)=>{if(S(q),te){T({title:"Chat completion failed",message:te[0].message});return}r({instanceId:q,patch:{experimentId:le.chatCompletionOverDataset.experimentId},dirty:null}),d({instanceId:q,data:sk(le.chatCompletionOverDataset)})},[S,T,d,r]);u.useEffect(()=>{if(!k)return;const{instances:q,streaming:le,updateInstance:te}=K.getState();if(c(),le){const M=[];for(const E of q){const{activeRunId:N}=E;if(te({instanceId:E.id,patch:{experimentId:null},dirty:null}),N===null)continue;const ee={input:Oi({credentials:b,instanceId:E.id,playgroundStore:K,datasetId:n})},ye={subscription:Ho,variables:ee,onNext:x(E.id),onCompleted:()=>{S(E.id)},onError:Un=>{S(E.id);const Ha=Ar(Un);Ha!=null&&Ha.length>0?T({title:"Failed to get output",message:Ha.join(`
1913
+ `,children:n})}function ck({getValue:n,collapseSingleKey:a}){const t=n();return e(yd,{children:e($a,{json:t,space:2,collapseSingleKey:a})})}function uk({isRunning:n,instanceVariables:a,datasetExampleInput:t}){const l=u.useMemo(()=>{const i=ea(t)?t:{};return a.filter(r=>i[r]==null)},[t,a]);return n?e(Fe,{}):l.length===0?null:e(yi,{children:`Missing input for variable${l.length>1?"s":""}: ${l.join(", ")}`})}function mk({exampleData:n,setDialog:a}){const{span:t,content:l,toolCalls:i,errorMessage:r,experimentRunId:o}=n,d=t!=null,c=o!=null,p=u.useMemo(()=>{if(d||c)return s(U,{children:[c&&s(ve,{children:[e(V,{size:"S","aria-label":"View experiment run details",leadingVisual:e(_,{svg:e(ot,{})}),onPress:()=>{u.startTransition(()=>{a(e(d0,{runId:o}))})}}),e($e,{children:"View run details"})]}),d&&e(U,{children:s(ve,{children:[e(V,{size:"S","aria-label":"View run trace",leadingVisual:e(_,{svg:e(jt,{})}),onPress:()=>{u.startTransition(()=>{a(e(md,{traceId:t.context.traceId,projectId:t.project.id,title:"Experiment Run Trace"}))})}}),e($e,{children:"View Trace"})]})})]})},[o,c,d,a,t]);return e(gd,{controls:p,children:e(C,{padding:"size-200",children:s(h,{direction:"column",gap:"size-200",children:[r!=null?e(yi,{children:r}):null,e(v,{children:l}),i!=null?Object.values(i).map(f=>f==null?null:e(pd,{toolCall:f},f.id)):null,d?e(gk,{span:t}):null]})})})}const pk=u.memo(function({isRunning:a,instanceId:t,exampleId:l,setDialog:i,instanceVariables:r,datasetExampleInput:o}){const d=xa(c=>{var p;return(p=c.exampleResponsesMap[t])==null?void 0:p[l]});return d==null?e(uk,{isRunning:a,instanceVariables:r,datasetExampleInput:o}):e(mk,{exampleData:d,setDialog:i})});function gk({span:n}){return s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(oa,{tokenCountTotal:n.tokenCountTotal||0,tokenCountPrompt:n.tokenCountPrompt||0,tokenCountCompletion:n.tokenCountCompletion||0}),e(Me,{latencyMs:n.latencyMs||0})]})}function fd({table:n}){return e("tbody",{children:n.getRowModel().rows.map(a=>e("tr",{children:a.getVisibleCells().map(t=>e("td",{style:{padding:0,width:`calc(var(--col-${t.column.id}-size) * 1px)`,wordBreak:"break-all"},children:J(t.column.columnDef.cell,t.getContext())},t.id))},a.id))})}const yk=he.memo(fd,(n,a)=>n.table.options.data===a.table.options.data);function fk({datasetId:n}){const a=I.useRelayEnvironment(),t=O(q=>q.instances),l=O(q=>q.allInstanceMessages),i=O(q=>q.templateFormat),r=O(q=>q.updateInstance),o=xa(q=>q.updateExampleData),d=xa(q=>q.setExampleDataForInstance),c=xa(q=>q.resetExampleData),p=xa(q=>q.appendExampleDataToolCallChunk),f=xa(q=>q.appendExampleDataTextChunk),[m,g]=u.useState(null),[,y]=xn(),k=t.some(q=>q.activeRunId!==null),b=Ma(q=>q),S=O(q=>q.markPlaygroundInstanceComplete),K=Ba(),T=Ie(),x=u.useCallback(q=>le=>{var M;if(le==null)return;const te=le.chatCompletionOverDataset;switch(te.__typename){case"ChatCompletionSubscriptionExperiment":r({instanceId:q,patch:{experimentId:te.experiment.id},dirty:null});break;case"ChatCompletionSubscriptionResult":if(te.datasetExampleId==null)return;o({instanceId:q,exampleId:te.datasetExampleId,patch:{span:te.span,experimentRunId:(M=te.experimentRun)==null?void 0:M.id}});break;case"ChatCompletionSubscriptionError":if(te.datasetExampleId==null)return;o({instanceId:q,exampleId:te.datasetExampleId,patch:{errorMessage:te.message}});break;case"TextChunk":if(te.datasetExampleId==null)return;f({instanceId:q,exampleId:te.datasetExampleId,textChunk:te.content});break;case"ToolCallChunk":{if(te.datasetExampleId==null)return;p({instanceId:q,exampleId:te.datasetExampleId,toolCallChunk:te});break}case"%other":return;default:return Ce()}},[f,p,o,r]),[L]=I.useMutation(Uo),P=u.useCallback(q=>(le,te)=>{if(S(q),te){T({title:"Chat completion failed",message:te[0].message});return}r({instanceId:q,patch:{experimentId:le.chatCompletionOverDataset.experimentId},dirty:null}),d({instanceId:q,data:sk(le.chatCompletionOverDataset)})},[S,T,d,r]);u.useEffect(()=>{if(!k)return;const{instances:q,streaming:le,updateInstance:te}=K.getState();if(c(),le){const M=[];for(const E of q){const{activeRunId:N}=E;if(te({instanceId:E.id,patch:{experimentId:null},dirty:null}),N===null)continue;const ee={input:Oi({credentials:b,instanceId:E.id,playgroundStore:K,datasetId:n})},ye={subscription:Ho,variables:ee,onNext:x(E.id),onCompleted:()=>{S(E.id)},onError:Un=>{S(E.id);const Ha=Ar(Un);Ha!=null&&Ha.length>0?T({title:"Failed to get output",message:Ha.join(`
1915
1914
  `),expireMs:1e4}):T({title:"Failed to get output",message:Un.message,expireMs:1e4})}},en=pt.requestSubscription(a,ye);M.push(en)}return()=>{for(const E of M)E.dispose()}}else{const M=[];for(const E of q){const{activeRunId:N}=E;if(N===null)continue;te({instanceId:E.id,patch:{experimentId:null},dirty:null});const ee={input:Oi({credentials:b,instanceId:E.id,playgroundStore:K,datasetId:n})},ye=L({variables:ee,onCompleted:P(E.id),onError(en){S(E.id);const Un=De(en);Un!=null&&Un.length>0?T({title:"Failed to get output",message:Un.join(`
1916
1915
  `),expireMs:1e4}):T({title:"Failed to get output",message:en.message,expireMs:1e4})}});M.push(ye)}return()=>{for(const E of M)E.dispose()}}},[b,n,a,L,k,S,T,P,x,K,c]);const{dataset:D}=I.useLazyLoadQuery(Jo,{datasetId:n}),$=u.useRef(null),{data:R,loadNext:Q,hasNext:z,isLoadingNext:A}=I.usePaginationFragment(Wo,D),j=u.useMemo(()=>R.examples.edges.map(q=>{const le=q.example,te=le.revision;return{id:le.id,input:te.input,output:te.output}}),[R]),Y=u.useMemo(()=>t.map((q,le)=>{const te=el(q,l),M=Fs({instance:te,templateFormat:i});return{id:`instance-${q.id}`,header:()=>s(h,{direction:"row",gap:"size-100",alignItems:"center",children:[e(Gl,{index:le}),e("span",{children:"Output"})]}),cell:({row:E})=>e(pk,{instanceId:q.id,exampleId:E.original.id,isRunning:k,setDialog:g,instanceVariables:M,datasetExampleInput:E.original.input}),size:500}}),[k,t,i,l]),de=[{header:"input",accessorKey:"input",cell:({row:q})=>e(gd,{controls:s(ve,{children:[e(V,{size:"S","aria-label":"View example details",leadingVisual:e(_,{svg:e(ot,{})}),onPress:()=>{y(le=>(le.set("exampleId",q.original.id),le))}}),e($e,{children:"View Example"})]}),children:e(yd,{children:e($a,{json:q.original.input,disableTitle:!0,space:2,collapseSingleKey:!1})})}),size:200},{header:"reference output",accessorKey:"output",cell:q=>ck({...q,collapseSingleKey:!0}),size:200},...Y],be=Le({columns:de,data:j,getCoreRowModel:we(),columnResizeMode:"onChange"}),hn=be.getRowModel().rows.length===0,ga=u.useCallback(q=>{if(q){const{scrollHeight:le,scrollTop:te,clientHeight:M}=q;le-te-M<300&&!A&&z&&Q(rk)}},[z,A,Q]),Ua=he.useMemo(()=>{const q=be.getFlatHeaders(),le={};for(let te=0;te<q.length;te++){const M=q[te];le[`--header-${M.id}-size`]=M.getSize(),le[`--col-${M.column.id}-size`]=M.column.getSize()}return le},[be.getState().columnSizingInfo,be.getState().columnSizing,de.length]);return s("div",{css:F`
1917
1916
  flex: 1 1 auto;
@@ -3881,7 +3880,7 @@ await assistant({
3881
3880
  .ac-dropdown-button {
3882
3881
  min-width: var(--ac-global-dimension-static-size-300);
3883
3882
  }
3884
- `,or=ii,$c=({table:n})=>{const a=ue();return e("tbody",{children:n.getRowModel().rows.map(t=>e("tr",{onClick:()=>a(`${encodeURIComponent(t.id)}`),children:t.getVisibleCells().map(l=>e("td",{style:{height:1,width:`calc(var(--col-${l.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${l.column.id}-size) * 1px)`,textWrap:"nowrap",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J(l.column.columnDef.cell,l.getContext())},l.id))},t.id))})},PS=he.memo($c,(n,a)=>n.table.options.data===a.table.options.data);function IS(n){const a=u.useRef(null),[t,l]=u.useState([]),{filterIoSubstring:i}=Vc(),{fetchKey:r}=Pa(),{data:o,loadNext:d,hasNext:c,isLoadingNext:p,refetch:f}=I.usePaginationFragment(zc,n.project),m=u.useMemo(()=>o.sessions.edges.map(({session:A})=>({...A,tokenCountTotal:A.tokenUsage.total})),[o.sessions]),g=[{header:"session id",accessorKey:"sessionId",enableSorting:!1,cell:Ee},{header:"first input",accessorKey:"firstInput.value",enableSorting:!1,cell:Ee},{header:"last output",accessorKey:"lastOutput.value",enableSorting:!1,cell:Ee},{header:"start time",accessorKey:"startTime",enableSorting:!0,cell:Re},{header:"end time",accessorKey:"endTime",enableSorting:!0,cell:Re},{header:"p50 latency",accessorKey:"traceLatencyMsP50",enableSorting:!1,cell:({getValue:A})=>{const j=A();return j===null||typeof j!="number"?null:e(Me,{latencyMs:j})}},{header:"p99 latency",accessorKey:"traceLatencyMsP99",enableSorting:!1,cell:({getValue:A})=>{const j=A();return j===null||typeof j!="number"?null:e(Me,{latencyMs:j})}},{header:"total tokens",accessorKey:"tokenCountTotal",enableSorting:!0,minSize:80,cell:({row:A,getValue:j})=>{const Y=j();if(Y==null||typeof Y!="number")return"--";const{prompt:de,completion:be}=A.original.tokenUsage;return e(oa,{tokenCountTotal:Y,tokenCountPrompt:de||0,tokenCountCompletion:be||0})}},{header:"total traces",accessorKey:"numTraces",enableSorting:!0,cell:as}];u.useEffect(()=>{const A=t[0];u.startTransition(()=>{f({sort:A?{col:A.id,dir:A.desc?"desc":"asc"}:{col:"startTime",dir:"desc"},after:null,first:or,filterIoSubstring:i},{fetchPolicy:"store-and-network"})})},[t,f,i,r]);const y=he.useCallback(A=>{if(A){const{scrollHeight:j,scrollTop:Y,clientHeight:de}=A;j-Y-de<300&&!p&&c&&d(or)}},[c,p,d]),[k,b]=u.useState({}),S=je(A=>A.columnVisibility),K=je(A=>A.columnSizing),T=je(A=>A.setColumnSizing),x=Le({columns:g,data:m,onExpandedChange:b,manualSorting:!0,state:{sorting:t,expanded:k,columnVisibility:S,columnSizing:K},columnResizeMode:"onChange",onColumnSizingChange:T,enableSubRowSelection:!1,onSortingChange:l,getCoreRowModel:we(),getSortedRowModel:In(),getExpandedRowModel:br(),getRowId:A=>A.id}),P=x.getRowModel().rows.length===0,{columnSizingInfo:D,columnSizing:$}=x.getState(),R=x.getFlatHeaders,Q=g.length,z=he.useMemo(()=>{const A=R(),j={};for(let Y=0;Y<A.length;Y++){const de=A[Y];j[`--header-${de.id}-size`]=de.getSize(),j[`--col-${de.column.id}-size`]=de.column.getSize()}return j},[R,D,$,Q]);return s("div",{css:bi,children:[e(C,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:e(hS,{})}),e("div",{css:F`
3883
+ `,or=ii,$c=({table:n})=>{const a=ue();return e("tbody",{children:n.getRowModel().rows.map(t=>e("tr",{onClick:()=>a(`${encodeURIComponent(t.id)}`),children:t.getVisibleCells().map(l=>e("td",{style:{width:`calc(var(--col-${l.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${l.column.id}-size) * 1px)`,textWrap:"nowrap",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J(l.column.columnDef.cell,l.getContext())},l.id))},t.id))})},PS=he.memo($c,(n,a)=>n.table.options.data===a.table.options.data);function IS(n){const a=u.useRef(null),[t,l]=u.useState([]),{filterIoSubstring:i}=Vc(),{fetchKey:r}=Pa(),{data:o,loadNext:d,hasNext:c,isLoadingNext:p,refetch:f}=I.usePaginationFragment(zc,n.project),m=u.useMemo(()=>o.sessions.edges.map(({session:A})=>({...A,tokenCountTotal:A.tokenUsage.total})),[o.sessions]),g=[{header:"session id",accessorKey:"sessionId",enableSorting:!1,cell:Ee},{header:"first input",accessorKey:"firstInput.value",enableSorting:!1,cell:Ee},{header:"last output",accessorKey:"lastOutput.value",enableSorting:!1,cell:Ee},{header:"start time",accessorKey:"startTime",enableSorting:!0,cell:Re},{header:"end time",accessorKey:"endTime",enableSorting:!0,cell:Re},{header:"p50 latency",accessorKey:"traceLatencyMsP50",enableSorting:!1,cell:({getValue:A})=>{const j=A();return j===null||typeof j!="number"?null:e(Me,{latencyMs:j})}},{header:"p99 latency",accessorKey:"traceLatencyMsP99",enableSorting:!1,cell:({getValue:A})=>{const j=A();return j===null||typeof j!="number"?null:e(Me,{latencyMs:j})}},{header:"total tokens",accessorKey:"tokenCountTotal",enableSorting:!0,minSize:80,cell:({row:A,getValue:j})=>{const Y=j();if(Y==null||typeof Y!="number")return"--";const{prompt:de,completion:be}=A.original.tokenUsage;return e(oa,{tokenCountTotal:Y,tokenCountPrompt:de||0,tokenCountCompletion:be||0})}},{header:"total traces",accessorKey:"numTraces",enableSorting:!0,cell:as}];u.useEffect(()=>{const A=t[0];u.startTransition(()=>{f({sort:A?{col:A.id,dir:A.desc?"desc":"asc"}:{col:"startTime",dir:"desc"},after:null,first:or,filterIoSubstring:i},{fetchPolicy:"store-and-network"})})},[t,f,i,r]);const y=he.useCallback(A=>{if(A){const{scrollHeight:j,scrollTop:Y,clientHeight:de}=A;j-Y-de<300&&!p&&c&&d(or)}},[c,p,d]),[k,b]=u.useState({}),S=je(A=>A.columnVisibility),K=je(A=>A.columnSizing),T=je(A=>A.setColumnSizing),x=Le({columns:g,data:m,onExpandedChange:b,manualSorting:!0,state:{sorting:t,expanded:k,columnVisibility:S,columnSizing:K},columnResizeMode:"onChange",onColumnSizingChange:T,enableSubRowSelection:!1,onSortingChange:l,getCoreRowModel:we(),getSortedRowModel:In(),getExpandedRowModel:br(),getRowId:A=>A.id}),P=x.getRowModel().rows.length===0,{columnSizingInfo:D,columnSizing:$}=x.getState(),R=x.getFlatHeaders,Q=g.length,z=he.useMemo(()=>{const A=R(),j={};for(let Y=0;Y<A.length;Y++){const de=A[Y];j[`--header-${de.id}-size`]=de.getSize(),j[`--col-${de.column.id}-size`]=de.column.getSize()}return j},[R,D,$,Q]);return s("div",{css:bi,children:[e(C,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:e(hS,{})}),e("div",{css:F`
3885
3884
  flex: 1 1 auto;
3886
3885
  overflow: auto;
3887
3886
  `,onScroll:A=>y(A.target),ref:a,children:s("table",{css:sa,style:{...z,width:x.getTotalSize(),minWidth:"100%"},children:[e("thead",{children:x.getHeaderGroups().map(A=>e("tr",{children:A.headers.map(j=>e("th",{style:{width:`calc(var(--header-${j.id}-size) * 1px)`},children:j.isPlaceholder?null:s(U,{children:[s("div",{"data-sortable":j.column.getCanSort(),className:j.column.getCanSort()?"cursor-pointer":"",onClick:j.column.getToggleSortingHandler(),style:{left:j.getStart(),width:j.getSize()},children:[J(j.column.columnDef.header,j.getContext()),j.column.getIsSorted()?e(_,{className:"sort-icon",svg:j.column.getIsSorted()==="asc"?e(cn,{}):e(un,{})}):null]}),e("div",{onMouseDown:j.getResizeHandler(),onTouchStart:j.getResizeHandler(),className:`resizer ${j.column.getIsResizing()?"isResizing":""}`})]})},j.id))},A.id))}),P?e(TS,{}):D.isResizingColumn?e(PS,{table:x}):e($c,{table:x})]})})]})}const Oc=u.createContext(null);function sl(){const n=u.useContext(Oc);if(n===null)throw new Error("useSpanFilterCondition must be used within a SpanFilterConditionProvider");return n}function Si(n){const[a,t]=u.useState(""),l=u.useCallback(r=>{u.startTransition(()=>{t(r)})},[]),i=u.useCallback(r=>{u.startTransition(()=>{a.length>0?t(a+" and "+r):t(r)})},[a]);return e(Oc.Provider,{value:{filterCondition:a,setFilterCondition:l,appendFilterCondition:i},children:n.children})}function vi({children:n}){const{projectId:a}=Be();if(!a)throw new Error("projectId is required");const{tab:t}=rl();if(!Xs(t))throw new Error(`Invalid tab: ${t}`);return e(gS,{projectId:a,tableId:t||"table",children:n})}function xS({queryReference:n}){const a=I.usePreloadedQuery(io,n);return e(pS,{children:e(IS,{project:a.project})})}const K2=()=>{const{sessionsQueryReference:n}=nl();return n?s(vi,{children:[e(Si,{children:e(u.Suspense,{fallback:e(Fe,{}),children:e(xS,{queryReference:n})})}),e(u.Suspense,{children:e(Te,{})})]}):null},Qc=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterCondition"},t={defaultValue:30,kind:"LocalArgument",name:"first"},l={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:null,kind:"LocalArgument",name:"orphanSpanAsRootSpan"},r={defaultValue:!0,kind:"LocalArgument",name:"rootSpansOnly"},o={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},d={defaultValue:null,kind:"LocalArgument",name:"timeRange"},c=[{kind:"Variable",name:"id",variableName:"id"}],p={kind:"Variable",name:"after",variableName:"after"},f={kind:"Variable",name:"filterCondition",variableName:"filterCondition"},m={kind:"Variable",name:"first",variableName:"first"},g={kind:"Variable",name:"rootSpansOnly",variableName:"rootSpansOnly"},y={kind:"Variable",name:"sort",variableName:"sort"},k={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},b={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},S={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},K=[p,f,m,{kind:"Variable",name:"orphanSpanAsRootSpan",variableName:"orphanSpanAsRootSpan"},g,y,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],T=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}];return{fragment:{argumentDefinitions:[n,a,t,l,i,r,o,d],kind:"Fragment",metadata:null,name:"SpansTableSpansQuery",selections:[{alias:null,args:c,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[p,f,m,g,y],kind:"FragmentSpread",name:"SpansTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,t,i,r,o,d,l],kind:"Operation",name:"SpansTableSpansQuery",selections:[{alias:null,args:c,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[k,{kind:"TypeDiscriminator",abstractKey:"__isNode"},b,{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:[b,{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:"tokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",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:[b,{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:[S,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DocumentRetrievalMetrics",kind:"LinkedField",name:"documentRetrievalMetrics",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"evaluationName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"ndcg",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"precision",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hit",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[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:"724a34c18ec17312b01be5ccae4d7159",id:null,metadata:{},name:"SpansTableSpansQuery",operationKind:"query",text:`query SpansTableSpansQuery(
@@ -4152,7 +4151,7 @@ fragment DatasetSelectorPopoverContent_datasets on Query {
4152
4151
  z-index: 1000;
4153
4152
  box-shadow: 8px 8px 20px 0 rgba(0, 0, 0, 0.4);
4154
4153
  border-radius: var(--ac-global-rounding-medium);
4155
- `,children:[e(C,{backgroundColor:"light",padding:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"medium",minWidth:"size-6000",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(v,{children:`${c.length} span${k?"s":""} selected`}),s(h,{direction:"row",gap:"size-100",children:[e(V,{variant:"default",size:"S",onPress:p,children:"Cancel"}),s(Va,{placement:"top end",crossOffset:300,isOpen:o,onOpenChange:T=>{d(T)},children:[e(Oe,{children:e(V,{variant:"default",size:"S",leadingVisual:m?e(We,{}):e(Nt,{}),onPress:()=>{d(!0)},isDisabled:m,children:m?"Adding...":"Add to Dataset"})}),e(u.Suspense,{children:e(qS,{onDatasetSelected:T=>{b(T),d(!1)},onCreateNewDataset:()=>{d(!1),l(e(Z,{title:"New Dataset",isDismissable:!0,onDismiss:()=>l(null),children:e(is,{onDatasetCreateError:T=>{const x=De(T);r({title:"Dataset creation failed",message:`Failed to create dataset: ${(x==null?void 0:x[0])??T.message}`})},onDatasetCreated:T=>{l(null),i({title:"Dataset created",message:`${T.name} has been successfully created.`}),d(!0)}})}))}})})]}),e(V,{variant:"danger",size:"S",leadingVisual:e(_,{svg:y?e(We,{}):e(Ye,{})}),isDisabled:y,onPress:K,children:y?"Deleting...":"Delete"})]})]})}),e(ae,{onDismiss:()=>{l(null)},children:t})]})}const ct="annotations",Rn=":",ru={col:"startTime",dir:"desc"};function su(n){let a=null,t=null;if(n.id&&n.id.startsWith(ct)){const[,l,i]=n.id.split(Rn);t={attr:l,name:i}}else a=n.id;return{col:a,evalResultKey:t,dir:n.desc?"desc":"asc"}}const Ft=ii,US={minSize:100};function HS(n){return n==="root"||n==="all"}const ou=({table:n,hasNext:a,onLoadNext:t,tableWidth:l,isLoadingNext:i})=>{const r=ue();return s("tbody",{children:[n.getRowModel().rows.map(o=>e("tr",{onClick:()=>r(`${o.original.trace.traceId}?selectedSpanNodeId=${o.original.id}`),children:o.getVisibleCells().map(d=>e("td",{style:{height:1,width:`calc(var(--col-${d.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${d.column.id}-size) * 1px)`,textWrap:"nowrap",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J(d.column.columnDef.cell,d.getContext())},d.id))},o.id)),a?e(Qg,{onLoadMore:t,width:l,isLoadingNext:i},"load-more"):null]})},GS=he.memo(ou,(n,a)=>n.table.options.data===a.table.options.data);function WS(n){const{fetchKey:a}=Pa(),t=u.useRef(null),l=u.useRef(!0),[i,r]=u.useState({}),[o,d]=u.useState([]),[c,p]=u.useState(""),[f,m]=u.useState(!0),g=je(E=>E.columnVisibility),{data:y,loadNext:k,hasNext:b,isLoadingNext:S,refetch:K}=I.usePaginationFragment(jc,n.project),T=je(E=>E.annotationColumnVisibility),x=u.useMemo(()=>Object.keys(T).filter(E=>T[E]),[T]),L=u.useMemo(()=>y.spans.edges.map(({span:N})=>N),[y]),P=x.map(E=>({header:E,columns:[{header:"label",accessorKey:`${ct}${Rn}label${Rn}${E}`,cell:({row:N})=>{const ee=N.original.spanAnnotations.find(ye=>ye.name===E);return ee?ee.label:null}},{header:"score",accessorKey:`${ct}${Rn}score${Rn}${E}`,cell:({row:N})=>{const ee=N.original.spanAnnotations.find(ye=>ye.name===E);return ee?ee.score:null}}]})),D=[{header:()=>s(h,{direction:"row",gap:"size-50",children:[e("span",{children:"feedback"}),s(Aa,{children:[e(se,{level:3,weight:"heavy",children:"Feedback"}),e(ia,{children:"Feedback includes evaluations and human annotations logged via the API or set via the UI."})]})]}),id:"feedback",accessorKey:"spanAnnotations",enableSorting:!1,cell:({row:E})=>s(h,{direction:"row",gap:"size-50",wrap:"wrap",children:[E.original.spanAnnotations.map(N=>e(za,{annotation:N,layout:"horizontal",width:"500px",extra:e(Uc,{annotation:N}),children:e(Nn,{annotation:N,annotationDisplayPreference:"label"})},N.name)),E.original.documentRetrievalMetrics.map(N=>s(U,{children:[e(tn,{name:N.evaluationName,metric:"ndcg",score:N.ndcg},"ndcg"),e(tn,{name:N.evaluationName,metric:"precision",score:N.precision},"precision"),e(tn,{name:N.evaluationName,metric:"hit",score:N.hit},"hit")]}))]})},...P],$=[{id:"select",maxSize:10,header:({table:E})=>e(na,{checked:E.getIsAllRowsSelected(),indeterminate:E.getIsSomeRowsSelected(),onChange:E.getToggleAllRowsSelectedHandler()}),cell:({row:E})=>e(na,{checked:E.getIsSelected(),disabled:!E.getCanSelect(),indeterminate:E.getIsSomeSelected(),onChange:E.getToggleSelectedHandler()})},{header:"status",accessorKey:"statusCode",maxSize:30,enableSorting:!1,cell:({getValue:E})=>{const N=E();return e(h,{direction:"row",gap:"size-50",alignItems:"center",children:e(qt,{statusCode:N})})}},{header:"kind",accessorKey:"spanKind",maxSize:100,enableSorting:!1,cell:({getValue:E})=>e(Bl,{spanKind:E()})},{header:"name",accessorKey:"name",enableSorting:!1,cell:({getValue:E,row:N})=>{const ee=N.original,{traceId:ye}=ee.trace;return e(Ze,{to:`${ye}?selectedSpanNodeId=${ee.id}`,children:E()})}},{header:"input",accessorKey:"input.value",cell:Ee,enableSorting:!1},{header:"output",accessorKey:"output.value",cell:Ee,enableSorting:!1},{header:"metadata",accessorKey:"metadata",cell:({row:E})=>e(Bc,{metadata:E.original.metadata}),enableSorting:!1},...D,{header:"start time",accessorKey:"startTime",cell:Re},{header:"latency",accessorKey:"latencyMs",cell:({getValue:E})=>{const N=E();return N===null||typeof N!="number"?null:e(Me,{latencyMs:N})}},{header:f?"cumulative tokens":"total tokens",accessorKey:f?"cumulativeTokenCountTotal":"tokenCountTotal",cell:({row:E,getValue:N})=>{if(N()===null)return"--";const ye=E.original,en=f?ye.cumulativeTokenCountTotal:ye.tokenCountTotal,Un=f?ye.cumulativeTokenCountPrompt:ye.tokenCountPrompt,Ha=f?ye.cumulativeTokenCountCompletion:ye.tokenCountCompletion;return e(oa,{tokenCountTotal:en||0,tokenCountPrompt:Un||0,tokenCountCompletion:Ha||0})}}];u.useEffect(()=>{if(l.current===!0){l.current=!1;return}u.startTransition(()=>{const E=o[0];K({sort:E?su(E):ru,after:null,first:Ft,filterCondition:c,rootSpansOnly:f},{fetchPolicy:"store-and-network"})})},[o,K,c,a,f]);const R=u.useCallback(E=>{if(E){const{scrollHeight:N,scrollTop:ee,clientHeight:ye}=E;N-ee-ye<300&&!S&&b&&k(Ft)}},[b,S,k]),Q=je(E=>E.setColumnSizing),z=je(E=>E.columnSizing),A=Le({columns:$,data:L,state:{sorting:o,columnVisibility:g,rowSelection:i,columnSizing:z},defaultColumn:US,columnResizeMode:"onChange",manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:r,onSortingChange:d,onColumnSizingChange:Q,getCoreRowModel:we(),getSortedRowModel:In()}),j=A.getRowModel().rows,Y=A.getSelectedRowModel().rows,de=Y.map(E=>({id:E.original.id,traceId:E.original.trace.id})),be=u.useCallback(()=>{r({})},[r]),wn=j.length===0,hn=A.getAllColumns().filter(E=>E.columns.length===0),{columnSizingInfo:ga,columnSizing:Ua}=A.getState(),q=A.getFlatHeaders,le=hn.length,[te,M]=he.useMemo(()=>{const E=q(),N={};let ee=0;for(let ye=0;ye<E.length;ye++){const en=E[ye];N[`--header-${en.id}-size`]=en.getSize(),N[`--col-${en.column.id}-size`]=en.column.getSize(),ee+=en.getSize()}return[N,ee]},[q,ga,Ua,le]);return s("div",{css:bi,children:[e(C,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:s(h,{direction:"row",gap:"size-100",width:"100%",alignItems:"center",children:[e(Yc,{onValidCondition:p}),s(Xl,{"aria-label":"Toggle between root and all spans",selectionMode:"single",selectedKeys:[f?"root":"all"],onSelectionChange:E=>{if(E.size===0)return;const N=E.keys().next().value;if(HS(N))m(N==="root");else throw new Error(`Unknown root span filter selection: ${N}`)},children:[e(Xn,{"aria-label":"root spans",id:"root",children:"Root Spans"}),e(Xn,{"aria-label":"all spans",id:"all",children:"All"})]}),e(Wc,{columns:hn,query:y}),e(MS,{})]})}),e("div",{css:F`
4154
+ `,children:[e(C,{backgroundColor:"light",padding:"size-200",borderColor:"light",borderWidth:"thin",borderRadius:"medium",minWidth:"size-6000",children:s(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e(v,{children:`${c.length} span${k?"s":""} selected`}),s(h,{direction:"row",gap:"size-100",children:[e(V,{variant:"default",size:"S",onPress:p,children:"Cancel"}),s(Va,{placement:"top end",crossOffset:300,isOpen:o,onOpenChange:T=>{d(T)},children:[e(Oe,{children:e(V,{variant:"default",size:"S",leadingVisual:m?e(We,{}):e(Nt,{}),onPress:()=>{d(!0)},isDisabled:m,children:m?"Adding...":"Add to Dataset"})}),e(u.Suspense,{children:e(qS,{onDatasetSelected:T=>{b(T),d(!1)},onCreateNewDataset:()=>{d(!1),l(e(Z,{title:"New Dataset",isDismissable:!0,onDismiss:()=>l(null),children:e(is,{onDatasetCreateError:T=>{const x=De(T);r({title:"Dataset creation failed",message:`Failed to create dataset: ${(x==null?void 0:x[0])??T.message}`})},onDatasetCreated:T=>{l(null),i({title:"Dataset created",message:`${T.name} has been successfully created.`}),d(!0)}})}))}})})]}),e(V,{variant:"danger",size:"S",leadingVisual:e(_,{svg:y?e(We,{}):e(Ye,{})}),isDisabled:y,onPress:K,children:y?"Deleting...":"Delete"})]})]})}),e(ae,{onDismiss:()=>{l(null)},children:t})]})}const ct="annotations",Rn=":",ru={col:"startTime",dir:"desc"};function su(n){let a=null,t=null;if(n.id&&n.id.startsWith(ct)){const[,l,i]=n.id.split(Rn);t={attr:l,name:i}}else a=n.id;return{col:a,evalResultKey:t,dir:n.desc?"desc":"asc"}}const Ft=ii,US={minSize:100};function HS(n){return n==="root"||n==="all"}const ou=({table:n,hasNext:a,onLoadNext:t,tableWidth:l,isLoadingNext:i})=>{const r=ue();return s("tbody",{children:[n.getRowModel().rows.map(o=>e("tr",{onClick:()=>r(`${o.original.trace.traceId}?selectedSpanNodeId=${o.original.id}`),children:o.getVisibleCells().map(d=>e("td",{style:{width:`calc(var(--col-${d.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${d.column.id}-size) * 1px)`,textWrap:"nowrap",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J(d.column.columnDef.cell,d.getContext())},d.id))},o.id)),a?e(Qg,{onLoadMore:t,width:l,isLoadingNext:i},"load-more"):null]})},GS=he.memo(ou,(n,a)=>n.table.options.data===a.table.options.data);function WS(n){const{fetchKey:a}=Pa(),t=u.useRef(null),l=u.useRef(!0),[i,r]=u.useState({}),[o,d]=u.useState([]),[c,p]=u.useState(""),[f,m]=u.useState(!0),g=je(E=>E.columnVisibility),{data:y,loadNext:k,hasNext:b,isLoadingNext:S,refetch:K}=I.usePaginationFragment(jc,n.project),T=je(E=>E.annotationColumnVisibility),x=u.useMemo(()=>Object.keys(T).filter(E=>T[E]),[T]),L=u.useMemo(()=>y.spans.edges.map(({span:N})=>N),[y]),P=x.map(E=>({header:E,columns:[{header:"label",accessorKey:`${ct}${Rn}label${Rn}${E}`,cell:({row:N})=>{const ee=N.original.spanAnnotations.find(ye=>ye.name===E);return ee?ee.label:null}},{header:"score",accessorKey:`${ct}${Rn}score${Rn}${E}`,cell:({row:N})=>{const ee=N.original.spanAnnotations.find(ye=>ye.name===E);return ee?ee.score:null}}]})),D=[{header:()=>s(h,{direction:"row",gap:"size-50",children:[e("span",{children:"feedback"}),s(Aa,{children:[e(se,{level:3,weight:"heavy",children:"Feedback"}),e(ia,{children:"Feedback includes evaluations and human annotations logged via the API or set via the UI."})]})]}),id:"feedback",accessorKey:"spanAnnotations",enableSorting:!1,cell:({row:E})=>s(h,{direction:"row",gap:"size-50",wrap:"wrap",children:[E.original.spanAnnotations.map(N=>e(za,{annotation:N,layout:"horizontal",width:"500px",extra:e(Uc,{annotation:N}),children:e(Nn,{annotation:N,annotationDisplayPreference:"label"})},N.name)),E.original.documentRetrievalMetrics.map(N=>s(U,{children:[e(tn,{name:N.evaluationName,metric:"ndcg",score:N.ndcg},"ndcg"),e(tn,{name:N.evaluationName,metric:"precision",score:N.precision},"precision"),e(tn,{name:N.evaluationName,metric:"hit",score:N.hit},"hit")]}))]})},...P],$=[{id:"select",maxSize:10,header:({table:E})=>e(na,{checked:E.getIsAllRowsSelected(),indeterminate:E.getIsSomeRowsSelected(),onChange:E.getToggleAllRowsSelectedHandler()}),cell:({row:E})=>e(na,{checked:E.getIsSelected(),disabled:!E.getCanSelect(),indeterminate:E.getIsSomeSelected(),onChange:E.getToggleSelectedHandler()})},{header:"status",accessorKey:"statusCode",maxSize:30,enableSorting:!1,cell:({getValue:E})=>{const N=E();return e(h,{direction:"row",gap:"size-50",alignItems:"center",children:e(qt,{statusCode:N})})}},{header:"kind",accessorKey:"spanKind",maxSize:100,enableSorting:!1,cell:({getValue:E})=>e(Bl,{spanKind:E()})},{header:"name",accessorKey:"name",enableSorting:!1,cell:({getValue:E,row:N})=>{const ee=N.original,{traceId:ye}=ee.trace;return e(Ze,{to:`${ye}?selectedSpanNodeId=${ee.id}`,children:E()})}},{header:"input",accessorKey:"input.value",cell:Ee,enableSorting:!1},{header:"output",accessorKey:"output.value",cell:Ee,enableSorting:!1},{header:"metadata",accessorKey:"metadata",cell:({row:E})=>e(Bc,{metadata:E.original.metadata}),enableSorting:!1},...D,{header:"start time",accessorKey:"startTime",cell:Re},{header:"latency",accessorKey:"latencyMs",cell:({getValue:E})=>{const N=E();return N===null||typeof N!="number"?null:e(Me,{latencyMs:N})}},{header:f?"cumulative tokens":"total tokens",accessorKey:f?"cumulativeTokenCountTotal":"tokenCountTotal",cell:({row:E,getValue:N})=>{if(N()===null)return"--";const ye=E.original,en=f?ye.cumulativeTokenCountTotal:ye.tokenCountTotal,Un=f?ye.cumulativeTokenCountPrompt:ye.tokenCountPrompt,Ha=f?ye.cumulativeTokenCountCompletion:ye.tokenCountCompletion;return e(oa,{tokenCountTotal:en||0,tokenCountPrompt:Un||0,tokenCountCompletion:Ha||0})}}];u.useEffect(()=>{if(l.current===!0){l.current=!1;return}u.startTransition(()=>{const E=o[0];K({sort:E?su(E):ru,after:null,first:Ft,filterCondition:c,rootSpansOnly:f},{fetchPolicy:"store-and-network"})})},[o,K,c,a,f]);const R=u.useCallback(E=>{if(E){const{scrollHeight:N,scrollTop:ee,clientHeight:ye}=E;N-ee-ye<300&&!S&&b&&k(Ft)}},[b,S,k]),Q=je(E=>E.setColumnSizing),z=je(E=>E.columnSizing),A=Le({columns:$,data:L,state:{sorting:o,columnVisibility:g,rowSelection:i,columnSizing:z},defaultColumn:US,columnResizeMode:"onChange",manualSorting:!0,enableRowSelection:!0,onRowSelectionChange:r,onSortingChange:d,onColumnSizingChange:Q,getCoreRowModel:we(),getSortedRowModel:In()}),j=A.getRowModel().rows,Y=A.getSelectedRowModel().rows,de=Y.map(E=>({id:E.original.id,traceId:E.original.trace.id})),be=u.useCallback(()=>{r({})},[r]),wn=j.length===0,hn=A.getAllColumns().filter(E=>E.columns.length===0),{columnSizingInfo:ga,columnSizing:Ua}=A.getState(),q=A.getFlatHeaders,le=hn.length,[te,M]=he.useMemo(()=>{const E=q(),N={};let ee=0;for(let ye=0;ye<E.length;ye++){const en=E[ye];N[`--header-${en.id}-size`]=en.getSize(),N[`--col-${en.column.id}-size`]=en.column.getSize(),ee+=en.getSize()}return[N,ee]},[q,ga,Ua,le]);return s("div",{css:bi,children:[e(C,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:s(h,{direction:"row",gap:"size-100",width:"100%",alignItems:"center",children:[e(Yc,{onValidCondition:p}),s(Xl,{"aria-label":"Toggle between root and all spans",selectionMode:"single",selectedKeys:[f?"root":"all"],onSelectionChange:E=>{if(E.size===0)return;const N=E.keys().next().value;if(HS(N))m(N==="root");else throw new Error(`Unknown root span filter selection: ${N}`)},children:[e(Xn,{"aria-label":"root spans",id:"root",children:"Root Spans"}),e(Xn,{"aria-label":"all spans",id:"all",children:"All"})]}),e(Wc,{columns:hn,query:y}),e(MS,{})]})}),e("div",{css:F`
4156
4155
  flex: 1 1 auto;
4157
4156
  overflow: auto;
4158
4157
  `,onScroll:E=>R(E.target),ref:t,children:s("table",{css:sa,style:{...te,width:A.getTotalSize(),minWidth:"100%"},children:[e("thead",{children:A.getHeaderGroups().map(E=>e("tr",{children:E.headers.map(N=>e("th",{style:{width:`calc(var(--header-${N.id}-size) * 1px)`},children:N.isPlaceholder?null:s(U,{children:[s("div",{className:N.column.getCanSort()?"cursor-pointer":"",onClick:N.column.getToggleSortingHandler(),style:{left:N.getStart(),width:N.getSize()},children:[J(N.column.columnDef.header,N.getContext()),N.column.getIsSorted()?e(_,{className:"sort-icon",svg:N.column.getIsSorted()==="asc"?e(cn,{}):e(un,{})}):null]}),e("div",{onMouseDown:N.getResizeHandler(),onTouchStart:N.getResizeHandler(),className:`resizer ${N.column.getIsResizing()?"isResizing":""}`})]})},N.id))},E.id))}),wn?e(Hc,{projectName:y.name}):ga.isResizingColumn?e(GS,{table:A,hasNext:b,onLoadNext:()=>k(Ft),tableWidth:M,isLoadingNext:S}):e(ou,{table:A,hasNext:b,onLoadNext:()=>k(Ft),tableWidth:M,isLoadingNext:S})]})}),Y.length?e(iu,{selectedSpans:de,onClearSelection:be}):null]})}function JS({queryReference:n}){const a=I.usePreloadedQuery(lo,n);return e(WS,{project:a.project})}const T2=()=>{const{spansQueryReference:n}=nl();return n?s(vi,{children:[e(Si,{children:e(u.Suspense,{fallback:e(Fe,{}),children:e(JS,{queryReference:n})})}),e(u.Suspense,{children:e(Te,{})})]}):null},du=function(){var n={defaultValue:null,kind:"LocalArgument",name:"after"},a={defaultValue:null,kind:"LocalArgument",name:"filterCondition"},t={defaultValue:30,kind:"LocalArgument",name:"first"},l={defaultValue:null,kind:"LocalArgument",name:"id"},i={defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},r={defaultValue:null,kind:"LocalArgument",name:"timeRange"},o=[{kind:"Variable",name:"id",variableName:"id"}],d={kind:"Variable",name:"after",variableName:"after"},c={kind:"Variable",name:"filterCondition",variableName:"filterCondition"},p={kind:"Variable",name:"first",variableName:"first"},f={kind:"Variable",name:"sort",variableName:"sort"},m={alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},y={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},k=[d,c,p,{kind:"Literal",name:"rootSpansOnly",value:!0},f,{kind:"Variable",name:"timeRange",variableName:"timeRange"}],b={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},S={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},K={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},T={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},x=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],L={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:x,storageKey:null},P={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:x,storageKey:null},D={alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},$={alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},R={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[g,y,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},Q={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};return{fragment:{argumentDefinitions:[n,a,t,l,i,r],kind:"Fragment",metadata:null,name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[{args:[d,c,p,f],kind:"FragmentSpread",name:"TracesTable_spans"}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[n,a,t,i,r,l],kind:"Operation",name:"TracesTableQuery",selections:[{alias:null,args:o,concreteType:null,kind:"LinkedField",name:"node",plural:!1,selections:[m,{kind:"TypeDiscriminator",abstractKey:"__isNode"},g,{kind:"InlineFragment",selections:[y,{alias:null,args:null,kind:"ScalarField",name:"spanAnnotationNames",storageKey:null},{alias:"rootSpans",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:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[g,b,y,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},S,K,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},T,L,P,D,{alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[g,$,{alias:null,args:null,kind:"ScalarField",name:"numSpans",storageKey:null}],storageKey:null},R,Q,{alias:null,args:[{kind:"Literal",name:"first",value:50}],concreteType:"SpanConnection",kind:"LinkedField",name:"descendants",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[g,b,y,{alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},S,K,T,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},L,P,D,{alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[g,$],storageKey:null},R,Q],storageKey:null}],storageKey:null}],storageKey:"descendants(first:50)"}],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:[m],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:"rootSpans",args:k,filters:["sort","rootSpansOnly","filterCondition","timeRange"],handle:"connection",key:"TracesTable_rootSpans",kind:"LinkedHandle",name:"spans"}],type:"Project",abstractKey:null}],storageKey:null}]},params:{cacheID:"d0a1b8418330452126093b027f027f43",id:null,metadata:{},name:"TracesTableQuery",operationKind:"query",text:`query TracesTableQuery(
@@ -4270,7 +4269,7 @@ fragment TracesTable_spans_1XEuU on Project {
4270
4269
  }
4271
4270
  id
4272
4271
  }
4273
- `}}}();du.hash="946e6d9bfbf43ac9def8bfcc2ff30661";const cu=function(){var n=["rootSpans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},d=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],c={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:d,storageKey:null},p={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:d,storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},g={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[t,a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},y={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};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:30,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:du,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"TracesTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"rootSpans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__TracesTable_rootSpans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,l,a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},i,r,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},o,c,p,f,{alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[t,m,{alias:null,args:null,kind:"ScalarField",name:"numSpans",storageKey:null}],storageKey:null},g,y,{alias:null,args:[{kind:"Literal",name:"first",value:50}],concreteType:"SpanConnection",kind:"LinkedField",name:"descendants",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,l,a,{alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},i,r,o,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},c,p,f,{alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[t,m],storageKey:null},g,y],storageKey:null}],storageKey:null}],storageKey:"descendants(first:50)"}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},t],type:"Project",abstractKey:null}}();cu.hash="946e6d9bfbf43ac9def8bfcc2ff30661";const dr=ii,ZS=50,uu=({table:n})=>{const a=ue();return e("tbody",{children:n.getRowModel().rows.map(t=>e("tr",{onClick:()=>a(`${t.original.trace.traceId}`),"data-is-additional-row":t.original.__additionalRow,css:ev,children:t.getVisibleCells().map(l=>e("td",{style:{height:1,width:`calc(var(--col-${l.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${l.column.id}-size) * 1px)`,textWrap:"nowrap",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J(l.column.columnDef.cell,l.getContext())},l.id))},t.id))})},XS=he.memo(uu,(n,a)=>n.table.options.data===a.table.options.data),YS=({row:n})=>n.original.__additionalRow?null:e(Bc,{metadata:n.original.metadata}),ev=F`
4272
+ `}}}();du.hash="946e6d9bfbf43ac9def8bfcc2ff30661";const cu=function(){var n=["rootSpans"],a={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},t={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"spanKind",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"startTime",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"latencyMs",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"parentId",storageKey:null},d=[{alias:"value",args:null,kind:"ScalarField",name:"truncatedValue",storageKey:null}],c={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"input",plural:!1,selections:d,storageKey:null},p={alias:null,args:null,concreteType:"SpanIOValue",kind:"LinkedField",name:"output",plural:!1,selections:d,storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"spanId",storageKey:null},m={alias:null,args:null,kind:"ScalarField",name:"traceId",storageKey:null},g={alias:null,args:null,concreteType:"SpanAnnotation",kind:"LinkedField",name:"spanAnnotations",plural:!0,selections:[t,a,{alias:null,args:null,kind:"ScalarField",name:"label",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"score",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"annotatorKind",storageKey:null}],storageKey:null},y={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};return{argumentDefinitions:[{defaultValue:null,kind:"LocalArgument",name:"after"},{defaultValue:null,kind:"LocalArgument",name:"filterCondition"},{defaultValue:30,kind:"LocalArgument",name:"first"},{defaultValue:{col:"startTime",dir:"desc"},kind:"LocalArgument",name:"sort"},{kind:"RootArgument",name:"timeRange"}],kind:"Fragment",metadata:{connection:[{count:"first",cursor:"after",direction:"forward",path:n}],refetch:{connection:{forward:{count:"first",cursor:"after"},backward:null,path:n},fragmentPathInResult:["node"],operation:du,identifierInfo:{identifierField:"id",identifierQueryVariableName:"id"}}},name:"TracesTable_spans",selections:[a,{args:null,kind:"FragmentSpread",name:"SpanColumnSelector_annotations"},{alias:"rootSpans",args:[{kind:"Variable",name:"filterCondition",variableName:"filterCondition"},{kind:"Literal",name:"rootSpansOnly",value:!0},{kind:"Variable",name:"sort",variableName:"sort"},{kind:"Variable",name:"timeRange",variableName:"timeRange"}],concreteType:"SpanConnection",kind:"LinkedField",name:"__TracesTable_rootSpans_connection",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:"rootSpan",args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,l,a,{alias:null,args:null,kind:"ScalarField",name:"metadata",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"statusCode",storageKey:null},i,r,{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountTotal",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountPrompt",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cumulativeTokenCountCompletion",storageKey:null},o,c,p,f,{alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[t,m,{alias:null,args:null,kind:"ScalarField",name:"numSpans",storageKey:null}],storageKey:null},g,y,{alias:null,args:[{kind:"Literal",name:"first",value:50}],concreteType:"SpanConnection",kind:"LinkedField",name:"descendants",plural:!1,selections:[{alias:null,args:null,concreteType:"SpanEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[t,l,a,{alias:"statusCode",args:null,kind:"ScalarField",name:"propagatedStatusCode",storageKey:null},i,r,o,{alias:"cumulativeTokenCountTotal",args:null,kind:"ScalarField",name:"tokenCountTotal",storageKey:null},{alias:"cumulativeTokenCountPrompt",args:null,kind:"ScalarField",name:"tokenCountPrompt",storageKey:null},{alias:"cumulativeTokenCountCompletion",args:null,kind:"ScalarField",name:"tokenCountCompletion",storageKey:null},c,p,f,{alias:null,args:null,concreteType:"Trace",kind:"LinkedField",name:"trace",plural:!1,selections:[t,m],storageKey:null},g,y],storageKey:null}],storageKey:null}],storageKey:"descendants(first:50)"}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Span",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"PageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},t],type:"Project",abstractKey:null}}();cu.hash="946e6d9bfbf43ac9def8bfcc2ff30661";const dr=ii,ZS=50,uu=({table:n})=>{const a=ue();return e("tbody",{children:n.getRowModel().rows.map(t=>e("tr",{onClick:()=>a(`${t.original.trace.traceId}`),"data-is-additional-row":t.original.__additionalRow,css:ev,children:t.getVisibleCells().map(l=>e("td",{style:{width:`calc(var(--col-${l.column.id}-size) * 1px)`,maxWidth:`calc(var(--col-${l.column.id}-size) * 1px)`,textWrap:"nowrap",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J(l.column.columnDef.cell,l.getContext())},l.id))},t.id))})},XS=he.memo(uu,(n,a)=>n.table.options.data===a.table.options.data),YS=({row:n})=>n.original.__additionalRow?null:e(Bc,{metadata:n.original.metadata}),ev=F`
4274
4273
  &[data-is-additional-row="true"] {
4275
4274
  box-shadow: inset 0 -10px 20px var(--ac-global-color-grey-100);
4276
4275
  }
@@ -5095,7 +5094,7 @@ fragment ExperimentsTableFragment_2HEEH6 on Dataset {
5095
5094
  align-items: center;
5096
5095
  color: var(--ac-global-color-primary);
5097
5096
  gap: var(--ac-global-dimension-size-50);
5098
- `;function uC(n){const{datasetId:a,experimentIds:t,displayFullText:l}=n,[i,r]=u.useState(""),o=I.useLazyLoadQuery(Qu,{experimentIds:t,datasetId:a,filterCondition:i}),d=u.useMemo(()=>{var T,x;return((x=(T=o.dataset)==null?void 0:T.experiments)==null?void 0:x.edges.reduce((L,P)=>{var D,$;return L[P.experiment.id]={...P.experiment,projectId:(($=(D=P.experiment)==null?void 0:D.project)==null?void 0:$.id)||null},L},{}))||{}},[o]),c=u.useMemo(()=>o.comparisons.map(T=>{const x=T.runComparisonItems.reduce((L,P)=>(L[P.experimentId]=P,L),{});return{...T,id:T.example.id,input:T.example.revision.input,referenceOutput:T.example.revision.referenceOutput,runComparisonMap:x}}),[o]),[p,f]=u.useState(null),m=u.useMemo(()=>[{header:"input",accessorKey:"input",minWidth:500,cell:({row:T})=>e(Ai,{controls:s(ve,{children:[e(V,{size:"S","aria-label":"View example details",leadingVisual:e(_,{svg:e(ot,{})}),onPress:()=>{u.startTransition(()=>{f(e(u.Suspense,{children:e(gi,{exampleId:T.original.example.id,onDismiss:()=>{f(null)}})}))})}}),e($e,{children:"View Example"})]}),children:e(Kt,{children:e(Ci,{children:e($a,{json:T.original.input,disableTitle:!0,space:l?2:0})})})})},{header:"reference output",accessorKey:"referenceOutput",minWidth:500,cell:T=>e(Kt,{children:l?yC(T):wa(T)})}],[l]),g=u.useMemo(()=>t.map(T=>({header:()=>{var $,R,Q,z;const x=($=d[T])==null?void 0:$.name,L=(R=d[T])==null?void 0:R.metadata,P=(Q=d[T])==null?void 0:Q.projectId,D=((z=d[T])==null?void 0:z.sequenceNumber)||0;return s(h,{direction:"row",gap:"size-100",wrap:!0,alignItems:"center",justifyContent:"space-between",children:[s(h,{direction:"row",gap:"size-100",wrap:!0,alignItems:"center",children:[e(Yt,{sequenceNumber:D}),e(v,{children:x})]}),e(rs,{experimentId:T,metadata:L,isQuiet:!0,projectId:P,canDeleteExperiment:!1})]})},accessorKey:T,minSize:500,cell:({row:x})=>{var A,j;const L=x.original.runComparisonMap[T],P=(L==null?void 0:L.runs.length)||0;if(P===0)return e(ur,{});if(P>1)return e(v,{color:"warning",children:`${P} runs`});const D=L==null?void 0:L.runs[0];let $=null;const R=(A=D==null?void 0:D.trace)==null?void 0:A.traceId,Q=(j=D==null?void 0:D.trace)==null?void 0:j.projectId;return R&&Q&&($=s(ve,{children:[e(V,{variant:"default",className:"trace-button",size:"S","aria-label":"View run trace",leadingVisual:e(_,{svg:e(jt,{})}),onPress:()=>{u.startTransition(()=>{f(e(Ju,{traceId:R,projectId:Q,title:"Experiment Run Trace"}))})}}),e($e,{children:"View Trace"})]})),D?e(Ai,{controls:s(U,{children:[s(ve,{children:[e(V,{variant:"default",className:"expand-button",size:"S","aria-label":"View example run details",leadingVisual:e(_,{svg:e(ot,{})}),onPress:()=>{u.startTransition(()=>{f(e(fC,{selectedExample:x.original,datasetId:a,experimentInfoById:d}))})}}),e($e,{children:"View run details"})]}),$]}),children:e(Kt,{children:e(gC,{...D,displayFullText:l,setDialog:f})})}):e(Kt,{children:e(ur,{})})}})),[t,d,a,l]),y=u.useMemo(()=>[...m,...g],[m,g]),k=Le({columns:y,data:c,getCoreRowModel:we(),columnResizeMode:"onChange"}),b=he.useMemo(()=>{const T=k.getFlatHeaders(),x={};for(let L=0;L<T.length;L++){const P=T[L];x[`--header-${P.id}-size`]=P.getSize(),x[`--col-${P.column.id}-size`]=P.column.getSize()}return x},[k.getState().columnSizingInfo,k.getState().columnSizing]),K=k.getRowModel().rows.length===0;return e(C,{overflow:"auto",children:s(h,{direction:"column",height:"100%",children:[e(C,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:e(sC,{onValidCondition:r})}),s("div",{css:dC,children:[s("table",{css:F(dn,Vr),style:{...b,width:k.getTotalSize(),minWidth:"100%"},children:[e("thead",{children:k.getHeaderGroups().map(T=>e("tr",{children:T.headers.map(x=>s("th",{style:{width:`calc(var(--header-${x==null?void 0:x.id}-size) * 1px)`},children:[e("div",{children:J(x.column.columnDef.header,x.getContext())}),e("div",{onMouseDown:x.getResizeHandler(),onTouchStart:x.getResizeHandler(),className:`resizer ${x.column.getIsResizing()?"isResizing":""}`})]},x.id))},T.id))}),K?e(mn,{}):k.getState().columnSizingInfo.isResizingColumn?e(mC,{table:k}):e(Hu,{table:k})]}),e(ae,{isDismissable:!0,type:"slideOver",onDismiss:()=>{f(null)},children:p})]})]})})}function Hu({table:n}){return e("tbody",{children:n.getRowModel().rows.map(a=>e("tr",{children:a.getVisibleCells().map(t=>e("td",{style:{height:1,width:`calc(var(--col-${t.column.id}-size) * 1px)`,padding:0},children:J(t.column.columnDef.cell,t.getContext())},t.id))},a.id))})}const mC=he.memo(Hu,(n,a)=>n.table.options.data===a.table.options.data);function pC(n){const{datasetId:a,exampleId:t}=n,l=ue();return e("div",{onClick:i=>{i.preventDefault(),i.stopPropagation()},children:e(Dn,{buttonSize:"compact",align:"end",onAction:i=>{switch(i){case"gotoExample":return l(`/datasets/${a}/examples/${t}`);default:Ce()}},children:e(ie,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(_,{svg:e(ay,{})}),e(v,{children:"Go to example"})]})},"gotoExample")})})}function gC(n){const{output:a,error:t,startTime:l,endTime:i,annotations:r,displayFullText:o,setDialog:d}=n;if(t)return e(Gu,{error:t});const c=r!=null&&r.edges.length?r.edges.map(p=>p.annotation):[];return s(h,{direction:"column",gap:"size-100",height:"100%",justifyContent:"space-between",children:[e(Ci,{children:e($a,{json:a,disableTitle:!0,space:o?2:0})}),s("ul",{css:F`
5097
+ `;function uC(n){const{datasetId:a,experimentIds:t,displayFullText:l}=n,[i,r]=u.useState(""),o=I.useLazyLoadQuery(Qu,{experimentIds:t,datasetId:a,filterCondition:i}),d=u.useMemo(()=>{var T,x;return((x=(T=o.dataset)==null?void 0:T.experiments)==null?void 0:x.edges.reduce((L,P)=>{var D,$;return L[P.experiment.id]={...P.experiment,projectId:(($=(D=P.experiment)==null?void 0:D.project)==null?void 0:$.id)||null},L},{}))||{}},[o]),c=u.useMemo(()=>o.comparisons.map(T=>{const x=T.runComparisonItems.reduce((L,P)=>(L[P.experimentId]=P,L),{});return{...T,id:T.example.id,input:T.example.revision.input,referenceOutput:T.example.revision.referenceOutput,runComparisonMap:x}}),[o]),[p,f]=u.useState(null),m=u.useMemo(()=>[{header:"input",accessorKey:"input",minWidth:500,cell:({row:T})=>e(Ai,{controls:s(ve,{children:[e(V,{size:"S","aria-label":"View example details",leadingVisual:e(_,{svg:e(ot,{})}),onPress:()=>{u.startTransition(()=>{f(e(u.Suspense,{children:e(gi,{exampleId:T.original.example.id,onDismiss:()=>{f(null)}})}))})}}),e($e,{children:"View Example"})]}),children:e(Kt,{children:e(Ci,{children:e($a,{json:T.original.input,disableTitle:!0,space:l?2:0})})})})},{header:"reference output",accessorKey:"referenceOutput",minWidth:500,cell:T=>e(Kt,{children:l?yC(T):wa(T)})}],[l]),g=u.useMemo(()=>t.map(T=>({header:()=>{var $,R,Q,z;const x=($=d[T])==null?void 0:$.name,L=(R=d[T])==null?void 0:R.metadata,P=(Q=d[T])==null?void 0:Q.projectId,D=((z=d[T])==null?void 0:z.sequenceNumber)||0;return s(h,{direction:"row",gap:"size-100",wrap:!0,alignItems:"center",justifyContent:"space-between",children:[s(h,{direction:"row",gap:"size-100",wrap:!0,alignItems:"center",children:[e(Yt,{sequenceNumber:D}),e(v,{children:x})]}),e(rs,{experimentId:T,metadata:L,isQuiet:!0,projectId:P,canDeleteExperiment:!1})]})},accessorKey:T,minSize:500,cell:({row:x})=>{var A,j;const L=x.original.runComparisonMap[T],P=(L==null?void 0:L.runs.length)||0;if(P===0)return e(ur,{});if(P>1)return e(v,{color:"warning",children:`${P} runs`});const D=L==null?void 0:L.runs[0];let $=null;const R=(A=D==null?void 0:D.trace)==null?void 0:A.traceId,Q=(j=D==null?void 0:D.trace)==null?void 0:j.projectId;return R&&Q&&($=s(ve,{children:[e(V,{variant:"default",className:"trace-button",size:"S","aria-label":"View run trace",leadingVisual:e(_,{svg:e(jt,{})}),onPress:()=>{u.startTransition(()=>{f(e(Ju,{traceId:R,projectId:Q,title:"Experiment Run Trace"}))})}}),e($e,{children:"View Trace"})]})),D?e(Ai,{controls:s(U,{children:[s(ve,{children:[e(V,{variant:"default",className:"expand-button",size:"S","aria-label":"View example run details",leadingVisual:e(_,{svg:e(ot,{})}),onPress:()=>{u.startTransition(()=>{f(e(fC,{selectedExample:x.original,datasetId:a,experimentInfoById:d}))})}}),e($e,{children:"View run details"})]}),$]}),children:e(Kt,{children:e(gC,{...D,displayFullText:l,setDialog:f})})}):e(Kt,{children:e(ur,{})})}})),[t,d,a,l]),y=u.useMemo(()=>[...m,...g],[m,g]),k=Le({columns:y,data:c,getCoreRowModel:we(),columnResizeMode:"onChange"}),b=he.useMemo(()=>{const T=k.getFlatHeaders(),x={};for(let L=0;L<T.length;L++){const P=T[L];x[`--header-${P.id}-size`]=P.getSize(),x[`--col-${P.column.id}-size`]=P.column.getSize()}return x},[k.getState().columnSizingInfo,k.getState().columnSizing]),K=k.getRowModel().rows.length===0;return e(C,{overflow:"auto",children:s(h,{direction:"column",height:"100%",children:[e(C,{paddingTop:"size-100",paddingBottom:"size-100",paddingStart:"size-200",paddingEnd:"size-200",borderBottomColor:"grey-300",borderBottomWidth:"thin",flex:"none",children:e(sC,{onValidCondition:r})}),s("div",{css:dC,children:[s("table",{css:F(dn,Vr),style:{...b,width:k.getTotalSize(),minWidth:"100%"},children:[e("thead",{children:k.getHeaderGroups().map(T=>e("tr",{children:T.headers.map(x=>s("th",{style:{width:`calc(var(--header-${x==null?void 0:x.id}-size) * 1px)`},children:[e("div",{children:J(x.column.columnDef.header,x.getContext())}),e("div",{onMouseDown:x.getResizeHandler(),onTouchStart:x.getResizeHandler(),className:`resizer ${x.column.getIsResizing()?"isResizing":""}`})]},x.id))},T.id))}),K?e(mn,{}):k.getState().columnSizingInfo.isResizingColumn?e(mC,{table:k}):e(Hu,{table:k})]}),e(ae,{isDismissable:!0,type:"slideOver",onDismiss:()=>{f(null)},children:p})]})]})})}function Hu({table:n}){return e("tbody",{children:n.getRowModel().rows.map(a=>e("tr",{children:a.getVisibleCells().map(t=>e("td",{style:{width:`calc(var(--col-${t.column.id}-size) * 1px)`,padding:0},children:J(t.column.columnDef.cell,t.getContext())},t.id))},a.id))})}const mC=he.memo(Hu,(n,a)=>n.table.options.data===a.table.options.data);function pC(n){const{datasetId:a,exampleId:t}=n,l=ue();return e("div",{onClick:i=>{i.preventDefault(),i.stopPropagation()},children:e(Dn,{buttonSize:"compact",align:"end",onAction:i=>{switch(i){case"gotoExample":return l(`/datasets/${a}/examples/${t}`);default:Ce()}},children:e(ie,{children:s(h,{direction:"row",gap:"size-75",justifyContent:"start",alignItems:"center",children:[e(_,{svg:e(ay,{})}),e(v,{children:"Go to example"})]})},"gotoExample")})})}function gC(n){const{output:a,error:t,startTime:l,endTime:i,annotations:r,displayFullText:o,setDialog:d}=n;if(t)return e(Gu,{error:t});const c=r!=null&&r.edges.length?r.edges.map(p=>p.annotation):[];return s(h,{direction:"column",gap:"size-100",height:"100%",justifyContent:"space-between",children:[e(Ci,{children:e($a,{json:a,disableTitle:!0,space:o?2:0})}),s("ul",{css:F`
5099
5098
  display: flex;
5100
5099
  flex-direction: row;
5101
5100
  gap: var(--ac-global-dimension-static-size-100);
phoenix/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "8.28.0"
1
+ __version__ = "8.28.1"