@arizeai/phoenix-client 1.1.0 → 1.2.0

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.
Files changed (67) hide show
  1. package/dist/esm/__generated__/api/v1.d.ts +375 -0
  2. package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
  3. package/dist/esm/experiments/runExperiment.d.ts +48 -13
  4. package/dist/esm/experiments/runExperiment.d.ts.map +1 -1
  5. package/dist/esm/experiments/runExperiment.js +139 -36
  6. package/dist/esm/experiments/runExperiment.js.map +1 -1
  7. package/dist/esm/spans/addSpanAnnotation.d.ts +39 -0
  8. package/dist/esm/spans/addSpanAnnotation.d.ts.map +1 -0
  9. package/dist/esm/spans/addSpanAnnotation.js +44 -0
  10. package/dist/esm/spans/addSpanAnnotation.js.map +1 -0
  11. package/dist/esm/spans/index.d.ts +3 -0
  12. package/dist/esm/spans/index.d.ts.map +1 -0
  13. package/dist/esm/spans/index.js +3 -0
  14. package/dist/esm/spans/index.js.map +1 -0
  15. package/dist/esm/spans/logSpanAnnotations.d.ts +51 -0
  16. package/dist/esm/spans/logSpanAnnotations.d.ts.map +1 -0
  17. package/dist/esm/spans/logSpanAnnotations.js +53 -0
  18. package/dist/esm/spans/logSpanAnnotations.js.map +1 -0
  19. package/dist/esm/spans/types.d.ts +43 -0
  20. package/dist/esm/spans/types.d.ts.map +1 -0
  21. package/dist/esm/spans/types.js +18 -0
  22. package/dist/esm/spans/types.js.map +1 -0
  23. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  24. package/dist/esm/types/annotations.d.ts +2 -1
  25. package/dist/esm/types/annotations.d.ts.map +1 -1
  26. package/dist/esm/types/experiments.d.ts +1 -7
  27. package/dist/esm/types/experiments.d.ts.map +1 -1
  28. package/dist/esm/utils/formatPromptMessages.d.ts.map +1 -1
  29. package/dist/esm/utils/getPromptBySelector.d.ts.map +1 -1
  30. package/dist/src/__generated__/api/v1.d.ts +375 -0
  31. package/dist/src/__generated__/api/v1.d.ts.map +1 -1
  32. package/dist/src/experiments/runExperiment.d.ts +48 -13
  33. package/dist/src/experiments/runExperiment.d.ts.map +1 -1
  34. package/dist/src/experiments/runExperiment.js +138 -36
  35. package/dist/src/experiments/runExperiment.js.map +1 -1
  36. package/dist/src/spans/addSpanAnnotation.d.ts +39 -0
  37. package/dist/src/spans/addSpanAnnotation.d.ts.map +1 -0
  38. package/dist/src/spans/addSpanAnnotation.js +59 -0
  39. package/dist/src/spans/addSpanAnnotation.js.map +1 -0
  40. package/dist/src/spans/index.d.ts +3 -0
  41. package/dist/src/spans/index.d.ts.map +1 -0
  42. package/dist/src/spans/index.js +19 -0
  43. package/dist/src/spans/index.js.map +1 -0
  44. package/dist/src/spans/logSpanAnnotations.d.ts +51 -0
  45. package/dist/src/spans/logSpanAnnotations.d.ts.map +1 -0
  46. package/dist/src/spans/logSpanAnnotations.js +68 -0
  47. package/dist/src/spans/logSpanAnnotations.js.map +1 -0
  48. package/dist/src/spans/types.d.ts +43 -0
  49. package/dist/src/spans/types.d.ts.map +1 -0
  50. package/dist/src/spans/types.js +22 -0
  51. package/dist/src/spans/types.js.map +1 -0
  52. package/dist/src/types/annotations.d.ts +2 -1
  53. package/dist/src/types/annotations.d.ts.map +1 -1
  54. package/dist/src/types/experiments.d.ts +1 -7
  55. package/dist/src/types/experiments.d.ts.map +1 -1
  56. package/dist/src/utils/formatPromptMessages.d.ts.map +1 -1
  57. package/dist/src/utils/getPromptBySelector.d.ts.map +1 -1
  58. package/dist/tsconfig.tsbuildinfo +1 -1
  59. package/package.json +7 -1
  60. package/src/__generated__/api/v1.ts +375 -0
  61. package/src/experiments/runExperiment.ts +211 -74
  62. package/src/spans/addSpanAnnotation.ts +59 -0
  63. package/src/spans/index.ts +2 -0
  64. package/src/spans/logSpanAnnotations.ts +71 -0
  65. package/src/spans/types.ts +60 -0
  66. package/src/types/annotations.ts +4 -1
  67. package/src/types/experiments.ts +1 -7
@@ -282,6 +282,41 @@ export interface paths {
282
282
  patch?: never;
283
283
  trace?: never;
284
284
  };
285
+ "/v1/experiments/{experiment_id}/runs": {
286
+ parameters: {
287
+ query?: never;
288
+ header?: never;
289
+ path?: never;
290
+ cookie?: never;
291
+ };
292
+ /** List runs for an experiment */
293
+ get: operations["listExperimentRuns"];
294
+ put?: never;
295
+ /** Create run for an experiment */
296
+ post: operations["createExperimentRun"];
297
+ delete?: never;
298
+ options?: never;
299
+ head?: never;
300
+ patch?: never;
301
+ trace?: never;
302
+ };
303
+ "/v1/experiment_evaluations": {
304
+ parameters: {
305
+ query?: never;
306
+ header?: never;
307
+ path?: never;
308
+ cookie?: never;
309
+ };
310
+ get?: never;
311
+ put?: never;
312
+ /** Create or update evaluation for an experiment run */
313
+ post: operations["upsertExperimentEvaluation"];
314
+ delete?: never;
315
+ options?: never;
316
+ head?: never;
317
+ patch?: never;
318
+ trace?: never;
319
+ };
285
320
  "/v1/span_annotations": {
286
321
  parameters: {
287
322
  query?: never;
@@ -631,6 +666,58 @@ export interface components {
631
666
  CreateExperimentResponseBody: {
632
667
  data: components["schemas"]["Experiment"];
633
668
  };
669
+ /** CreateExperimentRunRequestBody */
670
+ CreateExperimentRunRequestBody: {
671
+ /**
672
+ * Dataset Example Id
673
+ * @description The ID of the dataset example used in the experiment run
674
+ */
675
+ dataset_example_id: string;
676
+ /**
677
+ * Output
678
+ * @description The output of the experiment task
679
+ */
680
+ output: unknown;
681
+ /**
682
+ * Repetition Number
683
+ * @description The repetition number of the experiment run
684
+ */
685
+ repetition_number: number;
686
+ /**
687
+ * Start Time
688
+ * Format: date-time
689
+ * @description The start time of the experiment run
690
+ */
691
+ start_time: string;
692
+ /**
693
+ * End Time
694
+ * Format: date-time
695
+ * @description The end time of the experiment run
696
+ */
697
+ end_time: string;
698
+ /**
699
+ * Trace Id
700
+ * @description The ID of the corresponding trace (if one exists)
701
+ */
702
+ trace_id?: string | null;
703
+ /**
704
+ * Error
705
+ * @description Optional error message if the experiment run encountered an error
706
+ */
707
+ error?: string | null;
708
+ };
709
+ /** CreateExperimentRunResponseBody */
710
+ CreateExperimentRunResponseBody: {
711
+ data: components["schemas"]["CreateExperimentRunResponseBodyData"];
712
+ };
713
+ /** CreateExperimentRunResponseBodyData */
714
+ CreateExperimentRunResponseBodyData: {
715
+ /**
716
+ * Id
717
+ * @description The ID of the newly created experiment run
718
+ */
719
+ id: string;
720
+ };
634
721
  /** CreateProjectRequestBody */
635
722
  CreateProjectRequestBody: {
636
723
  /** Name */
@@ -789,6 +876,74 @@ export interface components {
789
876
  */
790
877
  updated_at: string;
791
878
  };
879
+ /** ExperimentEvaluationResult */
880
+ ExperimentEvaluationResult: {
881
+ /**
882
+ * Label
883
+ * @description The label assigned by the evaluation
884
+ */
885
+ label?: string | null;
886
+ /**
887
+ * Score
888
+ * @description The score assigned by the evaluation
889
+ */
890
+ score?: number | null;
891
+ /**
892
+ * Explanation
893
+ * @description Explanation of the evaluation result
894
+ */
895
+ explanation?: string | null;
896
+ };
897
+ /** ExperimentRunResponse */
898
+ ExperimentRunResponse: {
899
+ /**
900
+ * Dataset Example Id
901
+ * @description The ID of the dataset example used in the experiment run
902
+ */
903
+ dataset_example_id: string;
904
+ /**
905
+ * Output
906
+ * @description The output of the experiment task
907
+ */
908
+ output: unknown;
909
+ /**
910
+ * Repetition Number
911
+ * @description The repetition number of the experiment run
912
+ */
913
+ repetition_number: number;
914
+ /**
915
+ * Start Time
916
+ * Format: date-time
917
+ * @description The start time of the experiment run
918
+ */
919
+ start_time: string;
920
+ /**
921
+ * End Time
922
+ * Format: date-time
923
+ * @description The end time of the experiment run
924
+ */
925
+ end_time: string;
926
+ /**
927
+ * Trace Id
928
+ * @description The ID of the corresponding trace (if one exists)
929
+ */
930
+ trace_id?: string | null;
931
+ /**
932
+ * Error
933
+ * @description Optional error message if the experiment run encountered an error
934
+ */
935
+ error?: string | null;
936
+ /**
937
+ * Id
938
+ * @description The ID of the experiment run
939
+ */
940
+ id: string;
941
+ /**
942
+ * Experiment Id
943
+ * @description The ID of the experiment
944
+ */
945
+ experiment_id: string;
946
+ };
792
947
  /** FreeformAnnotationConfig */
793
948
  FreeformAnnotationConfig: {
794
949
  /** Name */
@@ -913,6 +1068,11 @@ export interface components {
913
1068
  /** Next Cursor */
914
1069
  next_cursor: string | null;
915
1070
  };
1071
+ /** ListExperimentRunsResponseBody */
1072
+ ListExperimentRunsResponseBody: {
1073
+ /** Data */
1074
+ data: components["schemas"]["ExperimentRunResponse"][];
1075
+ };
916
1076
  /** ListExperimentsResponseBody */
917
1077
  ListExperimentsResponseBody: {
918
1078
  /** Data */
@@ -1448,6 +1608,68 @@ export interface components {
1448
1608
  UploadDatasetResponseBody: {
1449
1609
  data: components["schemas"]["UploadDatasetData"];
1450
1610
  };
1611
+ /** UpsertExperimentEvaluationRequestBody */
1612
+ UpsertExperimentEvaluationRequestBody: {
1613
+ /**
1614
+ * Experiment Run Id
1615
+ * @description The ID of the experiment run being evaluated
1616
+ */
1617
+ experiment_run_id: string;
1618
+ /**
1619
+ * Name
1620
+ * @description The name of the evaluation
1621
+ */
1622
+ name: string;
1623
+ /**
1624
+ * Annotator Kind
1625
+ * @description The kind of annotator used for the evaluation
1626
+ * @enum {string}
1627
+ */
1628
+ annotator_kind: "LLM" | "CODE" | "HUMAN";
1629
+ /**
1630
+ * Start Time
1631
+ * Format: date-time
1632
+ * @description The start time of the evaluation in ISO format
1633
+ */
1634
+ start_time: string;
1635
+ /**
1636
+ * End Time
1637
+ * Format: date-time
1638
+ * @description The end time of the evaluation in ISO format
1639
+ */
1640
+ end_time: string;
1641
+ /** @description The result of the evaluation */
1642
+ result: components["schemas"]["ExperimentEvaluationResult"];
1643
+ /**
1644
+ * Error
1645
+ * @description Optional error message if the evaluation encountered an error
1646
+ */
1647
+ error?: string | null;
1648
+ /**
1649
+ * Metadata
1650
+ * @description Metadata for the evaluation
1651
+ */
1652
+ metadata?: {
1653
+ [key: string]: unknown;
1654
+ } | null;
1655
+ /**
1656
+ * Trace Id
1657
+ * @description Optional trace ID for tracking
1658
+ */
1659
+ trace_id?: string | null;
1660
+ };
1661
+ /** UpsertExperimentEvaluationResponseBody */
1662
+ UpsertExperimentEvaluationResponseBody: {
1663
+ data: components["schemas"]["UpsertExperimentEvaluationResponseBodyData"];
1664
+ };
1665
+ /** UpsertExperimentEvaluationResponseBodyData */
1666
+ UpsertExperimentEvaluationResponseBodyData: {
1667
+ /**
1668
+ * Id
1669
+ * @description The ID of the upserted experiment evaluation
1670
+ */
1671
+ id: string;
1672
+ };
1451
1673
  /** ValidationError */
1452
1674
  ValidationError: {
1453
1675
  /** Location */
@@ -2414,6 +2636,159 @@ export interface operations {
2414
2636
  };
2415
2637
  };
2416
2638
  };
2639
+ listExperimentRuns: {
2640
+ parameters: {
2641
+ query?: never;
2642
+ header?: never;
2643
+ path: {
2644
+ experiment_id: string;
2645
+ };
2646
+ cookie?: never;
2647
+ };
2648
+ requestBody?: never;
2649
+ responses: {
2650
+ /** @description Experiment runs retrieved successfully */
2651
+ 200: {
2652
+ headers: {
2653
+ [name: string]: unknown;
2654
+ };
2655
+ content: {
2656
+ "application/json": components["schemas"]["ListExperimentRunsResponseBody"];
2657
+ };
2658
+ };
2659
+ /** @description Forbidden */
2660
+ 403: {
2661
+ headers: {
2662
+ [name: string]: unknown;
2663
+ };
2664
+ content: {
2665
+ "text/plain": string;
2666
+ };
2667
+ };
2668
+ /** @description Experiment not found */
2669
+ 404: {
2670
+ headers: {
2671
+ [name: string]: unknown;
2672
+ };
2673
+ content: {
2674
+ "text/plain": string;
2675
+ };
2676
+ };
2677
+ /** @description Validation Error */
2678
+ 422: {
2679
+ headers: {
2680
+ [name: string]: unknown;
2681
+ };
2682
+ content: {
2683
+ "application/json": components["schemas"]["HTTPValidationError"];
2684
+ };
2685
+ };
2686
+ };
2687
+ };
2688
+ createExperimentRun: {
2689
+ parameters: {
2690
+ query?: never;
2691
+ header?: never;
2692
+ path: {
2693
+ experiment_id: string;
2694
+ };
2695
+ cookie?: never;
2696
+ };
2697
+ requestBody: {
2698
+ content: {
2699
+ "application/json": components["schemas"]["CreateExperimentRunRequestBody"];
2700
+ };
2701
+ };
2702
+ responses: {
2703
+ /** @description Experiment run created successfully */
2704
+ 200: {
2705
+ headers: {
2706
+ [name: string]: unknown;
2707
+ };
2708
+ content: {
2709
+ "application/json": components["schemas"]["CreateExperimentRunResponseBody"];
2710
+ };
2711
+ };
2712
+ /** @description Forbidden */
2713
+ 403: {
2714
+ headers: {
2715
+ [name: string]: unknown;
2716
+ };
2717
+ content: {
2718
+ "text/plain": string;
2719
+ };
2720
+ };
2721
+ /** @description Experiment or dataset example not found */
2722
+ 404: {
2723
+ headers: {
2724
+ [name: string]: unknown;
2725
+ };
2726
+ content: {
2727
+ "text/plain": string;
2728
+ };
2729
+ };
2730
+ /** @description Validation Error */
2731
+ 422: {
2732
+ headers: {
2733
+ [name: string]: unknown;
2734
+ };
2735
+ content: {
2736
+ "application/json": components["schemas"]["HTTPValidationError"];
2737
+ };
2738
+ };
2739
+ };
2740
+ };
2741
+ upsertExperimentEvaluation: {
2742
+ parameters: {
2743
+ query?: never;
2744
+ header?: never;
2745
+ path?: never;
2746
+ cookie?: never;
2747
+ };
2748
+ requestBody: {
2749
+ content: {
2750
+ "application/json": components["schemas"]["UpsertExperimentEvaluationRequestBody"];
2751
+ };
2752
+ };
2753
+ responses: {
2754
+ /** @description Successful Response */
2755
+ 200: {
2756
+ headers: {
2757
+ [name: string]: unknown;
2758
+ };
2759
+ content: {
2760
+ "application/json": components["schemas"]["UpsertExperimentEvaluationResponseBody"];
2761
+ };
2762
+ };
2763
+ /** @description Forbidden */
2764
+ 403: {
2765
+ headers: {
2766
+ [name: string]: unknown;
2767
+ };
2768
+ content: {
2769
+ "text/plain": string;
2770
+ };
2771
+ };
2772
+ /** @description Experiment run not found */
2773
+ 404: {
2774
+ headers: {
2775
+ [name: string]: unknown;
2776
+ };
2777
+ content: {
2778
+ "text/plain": string;
2779
+ };
2780
+ };
2781
+ /** @description Validation Error */
2782
+ 422: {
2783
+ headers: {
2784
+ [name: string]: unknown;
2785
+ };
2786
+ content: {
2787
+ "application/json": components["schemas"]["HTTPValidationError"];
2788
+ };
2789
+ };
2790
+ };
2791
+ };
2417
2792
  annotateSpans: {
2418
2793
  parameters: {
2419
2794
  query?: {