@arizeai/phoenix-client 4.0.3 → 4.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 (106) hide show
  1. package/dist/esm/__generated__/api/v1.d.ts +529 -4
  2. package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
  3. package/dist/esm/datasets/createOrGetDataset.d.ts +18 -0
  4. package/dist/esm/datasets/createOrGetDataset.d.ts.map +1 -0
  5. package/dist/esm/datasets/createOrGetDataset.js +29 -0
  6. package/dist/esm/datasets/createOrGetDataset.js.map +1 -0
  7. package/dist/esm/datasets/index.d.ts +1 -0
  8. package/dist/esm/datasets/index.d.ts.map +1 -1
  9. package/dist/esm/datasets/index.js +1 -0
  10. package/dist/esm/datasets/index.js.map +1 -1
  11. package/dist/esm/experiments/getExperimentRuns.d.ts +8 -2
  12. package/dist/esm/experiments/getExperimentRuns.d.ts.map +1 -1
  13. package/dist/esm/experiments/getExperimentRuns.js +34 -23
  14. package/dist/esm/experiments/getExperimentRuns.js.map +1 -1
  15. package/dist/esm/experiments/instrumentation.d.ts +7 -1
  16. package/dist/esm/experiments/instrumentation.d.ts.map +1 -1
  17. package/dist/esm/experiments/instrumentation.js +5 -3
  18. package/dist/esm/experiments/instrumentation.js.map +1 -1
  19. package/dist/esm/experiments/runExperiment.d.ts +13 -2
  20. package/dist/esm/experiments/runExperiment.d.ts.map +1 -1
  21. package/dist/esm/experiments/runExperiment.js +7 -3
  22. package/dist/esm/experiments/runExperiment.js.map +1 -1
  23. package/dist/esm/sessions/addSessionAnnotation.d.ts +44 -0
  24. package/dist/esm/sessions/addSessionAnnotation.d.ts.map +1 -0
  25. package/dist/esm/sessions/addSessionAnnotation.js +44 -0
  26. package/dist/esm/sessions/addSessionAnnotation.js.map +1 -0
  27. package/dist/esm/sessions/index.d.ts +3 -0
  28. package/dist/esm/sessions/index.d.ts.map +1 -0
  29. package/dist/esm/sessions/index.js +3 -0
  30. package/dist/esm/sessions/index.js.map +1 -0
  31. package/dist/esm/sessions/logSessionAnnotations.d.ts +56 -0
  32. package/dist/esm/sessions/logSessionAnnotations.d.ts.map +1 -0
  33. package/dist/esm/sessions/logSessionAnnotations.js +53 -0
  34. package/dist/esm/sessions/logSessionAnnotations.js.map +1 -0
  35. package/dist/esm/sessions/types.d.ts +19 -0
  36. package/dist/esm/sessions/types.d.ts.map +1 -0
  37. package/dist/esm/sessions/types.js +37 -0
  38. package/dist/esm/sessions/types.js.map +1 -0
  39. package/dist/esm/spans/types.d.ts +3 -50
  40. package/dist/esm/spans/types.d.ts.map +1 -1
  41. package/dist/esm/spans/types.js.map +1 -1
  42. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  43. package/dist/esm/types/annotations.d.ts +37 -0
  44. package/dist/esm/types/annotations.d.ts.map +1 -1
  45. package/dist/esm/utils/formatPromptMessages.d.ts.map +1 -1
  46. package/dist/esm/utils/getPromptBySelector.d.ts.map +1 -1
  47. package/dist/src/__generated__/api/v1.d.ts +529 -4
  48. package/dist/src/__generated__/api/v1.d.ts.map +1 -1
  49. package/dist/src/datasets/createOrGetDataset.d.ts +18 -0
  50. package/dist/src/datasets/createOrGetDataset.d.ts.map +1 -0
  51. package/dist/src/datasets/createOrGetDataset.js +32 -0
  52. package/dist/src/datasets/createOrGetDataset.js.map +1 -0
  53. package/dist/src/datasets/index.d.ts +1 -0
  54. package/dist/src/datasets/index.d.ts.map +1 -1
  55. package/dist/src/datasets/index.js +1 -0
  56. package/dist/src/datasets/index.js.map +1 -1
  57. package/dist/src/experiments/getExperimentRuns.d.ts +8 -2
  58. package/dist/src/experiments/getExperimentRuns.d.ts.map +1 -1
  59. package/dist/src/experiments/getExperimentRuns.js +35 -23
  60. package/dist/src/experiments/getExperimentRuns.js.map +1 -1
  61. package/dist/src/experiments/instrumentation.d.ts +7 -1
  62. package/dist/src/experiments/instrumentation.d.ts.map +1 -1
  63. package/dist/src/experiments/instrumentation.js +4 -2
  64. package/dist/src/experiments/instrumentation.js.map +1 -1
  65. package/dist/src/experiments/runExperiment.d.ts +13 -2
  66. package/dist/src/experiments/runExperiment.d.ts.map +1 -1
  67. package/dist/src/experiments/runExperiment.js +6 -2
  68. package/dist/src/experiments/runExperiment.js.map +1 -1
  69. package/dist/src/prompts/sdks/toSDK.d.ts +2 -2
  70. package/dist/src/sessions/addSessionAnnotation.d.ts +44 -0
  71. package/dist/src/sessions/addSessionAnnotation.d.ts.map +1 -0
  72. package/dist/src/sessions/addSessionAnnotation.js +48 -0
  73. package/dist/src/sessions/addSessionAnnotation.js.map +1 -0
  74. package/dist/src/sessions/index.d.ts +3 -0
  75. package/dist/src/sessions/index.d.ts.map +1 -0
  76. package/dist/src/sessions/index.js +19 -0
  77. package/dist/src/sessions/index.js.map +1 -0
  78. package/dist/src/sessions/logSessionAnnotations.d.ts +56 -0
  79. package/dist/src/sessions/logSessionAnnotations.d.ts.map +1 -0
  80. package/dist/src/sessions/logSessionAnnotations.js +56 -0
  81. package/dist/src/sessions/logSessionAnnotations.js.map +1 -0
  82. package/dist/src/sessions/types.d.ts +19 -0
  83. package/dist/src/sessions/types.d.ts.map +1 -0
  84. package/dist/src/sessions/types.js +41 -0
  85. package/dist/src/sessions/types.js.map +1 -0
  86. package/dist/src/spans/types.d.ts +3 -50
  87. package/dist/src/spans/types.d.ts.map +1 -1
  88. package/dist/src/spans/types.js.map +1 -1
  89. package/dist/src/types/annotations.d.ts +37 -0
  90. package/dist/src/types/annotations.d.ts.map +1 -1
  91. package/dist/src/utils/formatPromptMessages.d.ts.map +1 -1
  92. package/dist/src/utils/getPromptBySelector.d.ts.map +1 -1
  93. package/dist/tsconfig.tsbuildinfo +1 -1
  94. package/package.json +8 -3
  95. package/src/__generated__/api/v1.ts +529 -4
  96. package/src/datasets/createOrGetDataset.ts +39 -0
  97. package/src/datasets/index.ts +1 -0
  98. package/src/experiments/getExperimentRuns.ts +44 -15
  99. package/src/experiments/instrumentation.ts +9 -1
  100. package/src/experiments/runExperiment.ts +22 -1
  101. package/src/sessions/addSessionAnnotation.ts +65 -0
  102. package/src/sessions/index.ts +2 -0
  103. package/src/sessions/logSessionAnnotations.ts +77 -0
  104. package/src/sessions/types.ts +67 -0
  105. package/src/spans/types.ts +3 -50
  106. package/src/types/annotations.ts +39 -0
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toSessionAnnotationData = toSessionAnnotationData;
4
+ /**
5
+ * Build and validate annotation result fields
6
+ */
7
+ function buildSessionAnnotationResult(annotation) {
8
+ const result = {};
9
+ // Build result with trimming for string fields
10
+ if (annotation.label !== undefined) {
11
+ result.label = annotation.label.trim() || null;
12
+ }
13
+ if (annotation.score !== undefined) {
14
+ result.score = annotation.score;
15
+ }
16
+ if (annotation.explanation !== undefined) {
17
+ result.explanation = annotation.explanation.trim() || null;
18
+ }
19
+ // Validate that at least one result field is provided
20
+ const hasValidResult = result.label || result.score !== undefined || result.explanation;
21
+ if (!hasValidResult) {
22
+ throw new Error(`At least one of label, score, or explanation must be provided for session annotation`);
23
+ }
24
+ return result;
25
+ }
26
+ /**
27
+ * Convert a SessionAnnotation to the API format
28
+ */
29
+ function toSessionAnnotationData(annotation) {
30
+ var _a, _b, _c, _d;
31
+ const result = buildSessionAnnotationResult(annotation);
32
+ return {
33
+ session_id: annotation.sessionId.trim(),
34
+ name: annotation.name.trim(),
35
+ annotator_kind: (_a = annotation.annotatorKind) !== null && _a !== void 0 ? _a : "HUMAN",
36
+ result,
37
+ metadata: (_b = annotation.metadata) !== null && _b !== void 0 ? _b : null,
38
+ identifier: (_d = (_c = annotation.identifier) === null || _c === void 0 ? void 0 : _c.trim()) !== null && _d !== void 0 ? _d : "",
39
+ };
40
+ }
41
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/sessions/types.ts"],"names":[],"mappings":";;AAqDA,0DAaC;AA9CD;;GAEG;AACH,SAAS,4BAA4B,C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__generated__/api/v1";
2
+ import { Annotation } from "../types/annotations";
2
3
  type SpanAnnotationData = paths["/v1/span_annotations"]["post"]["requestBody"]["content"]["application/json"]["data"][0];
3
4
  type SpanDocumentAnnotationData = paths["/v1/document_annotations"]["post"]["requestBody"]["content"]["application/json"]["data"][0];
4
5
  /**
5
6
  * Parameters for a single span annotation
6
7
  */
7
- export interface SpanAnnotation {
8
+ export interface SpanAnnotation extends Annotation {
8
9
  /**
9
10
  * The OpenTelemetry Span ID (hex format without 0x prefix)
10
11
  */
11
12
  spanId: string;
12
- /**
13
- * The name of the annotation
14
- */
15
- name: string;
16
- /**
17
- * The label assigned by the annotation
18
- */
19
- label?: string;
20
- /**
21
- * The score assigned by the annotation
22
- */
23
- score?: number;
24
- /**
25
- * Explanation of the annotation result
26
- */
27
- explanation?: string;
28
- /**
29
- * The identifier of the annotation. If provided, the annotation will be updated if it already exists.
30
- */
31
- identifier?: string;
32
- /**
33
- * Metadata for the annotation
34
- */
35
- metadata?: Record<string, unknown>;
36
13
  /**
37
14
  * The kind of annotator used for the annotation
38
15
  * Can be "HUMAN", "LLM", or "CODE"
@@ -43,35 +20,11 @@ export interface SpanAnnotation {
43
20
  /**
44
21
  * Parameters for a single document annotation
45
22
  */
46
- export interface DocumentAnnotation {
47
- /**
48
- * The OpenTelemetry Span ID (hex format without 0x prefix)
49
- */
50
- spanId: string;
23
+ export interface DocumentAnnotation extends SpanAnnotation {
51
24
  /**
52
25
  * The 0-based index of the document within the span
53
26
  */
54
27
  documentPosition: number;
55
- /**
56
- * The name of the annotation
57
- */
58
- name: string;
59
- /**
60
- * The label assigned by the annotation
61
- */
62
- label?: string;
63
- /**
64
- * The score assigned by the annotation
65
- */
66
- score?: number;
67
- /**
68
- * Explanation of the annotation result
69
- */
70
- explanation?: string;
71
- /**
72
- * Metadata for the annotation
73
- */
74
- metadata?: Record<string, unknown>;
75
28
  /**
76
29
  * The kind of annotator used for the annotation
77
30
  * Can be "HUMAN", "LLM", or "CODE"
@@ -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AI,IAAI;KACtC,CAAC;AACJ,CAAC"}
@@ -1,3 +1,40 @@
1
1
  import { components } from "../__generated__/api/v1";
2
2
  export type AnnotatorKind = components["schemas"]["SpanAnnotationData"]["annotator_kind"];
3
+ /**
4
+ * The result of an annotation from an author (e.x. an LLM or human)
5
+ */
6
+ export type AnnotationResult = {
7
+ label?: string | null;
8
+ score?: number | null;
9
+ explanation?: string | null;
10
+ };
11
+ /**
12
+ * The base interface for all kinds of annotations (span, trace, session)
13
+ */
14
+ export interface Annotation {
15
+ /**
16
+ * The name of the annotation
17
+ */
18
+ name: string;
19
+ /**
20
+ * The label assigned by the annotation
21
+ */
22
+ label?: string;
23
+ /**
24
+ * The score assigned by the annotation
25
+ */
26
+ score?: number;
27
+ /**
28
+ * Explanation of the annotation result
29
+ */
30
+ explanation?: string;
31
+ /**
32
+ * The identifier of the annotation. If provided, the annotation will be updated if it already exists.
33
+ */
34
+ identifier?: string;
35
+ /**
36
+ * Metadata for the annotation
37
+ */
38
+ metadata?: Record<string, unknown>;
39
+ }
3
40
  //# sourceMappingURL=annotations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../src/types/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,MAAM,aAAa,GACvB,UAAU,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,CAAC,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../../src/types/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,MAAM,aAAa,GACvB,UAAU,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatPromptMessages.d.ts","sourceRoot":"","sources":["../../../src/utils/formatPromptMessages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO3E;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,oBAAoB,EAC5B,cAAc,EAAE,iBAAiB,EAAE,EACnC,SAAS,GAAE,SAAc;;;;;;;mBA4Dmy7E,uDAAsB;;;;;;;;;IAlBn17E"}
1
+ {"version":3,"file":"formatPromptMessages.d.ts","sourceRoot":"","sources":["../../../src/utils/formatPromptMessages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO3E;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,oBAAoB,EAC5B,cAAc,EAAE,iBAAiB,EAAE,EACnC,SAAS,GAAE,SAAc;;;;;;;mBA4Ds0nF,uDAAsB;;;;;;;;;IAlBt3nF"}
@@ -1 +1 @@
1
- {"version":3,"file":"getPromptBySelector.d.ts","sourceRoot":"","sources":["../../../src/utils/getPromptBySelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG;IACjD;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EAAE,OAAO,EACf,MAAM,GACP,EAAE,yBAAyB;;oBAkD86jE,uDAAsB;;cAAkI,uDAAsB,yBAAwB,uDAAsB;mBAAoD,uDAAsB;qBAAoD,uDAAsB;2BAAqG,uDAAsB,uCAAsC,uDAAsB,4CAA2C,uDAAsB,0CAAyC,uDAAsB,uCAAsC,uDAAsB,yCAAwC,uDAAsB,oCAAmC,uDAAsB,uCAAsC,uDAAsB;YAAsD,uDAAsB;sBAAwF,uDAAsB;;UADzhmE"}
1
+ {"version":3,"file":"getPromptBySelector.d.ts","sourceRoot":"","sources":["../../../src/utils/getPromptBySelector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG;IACjD;;OAEG;IACH,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EAAE,OAAO,EACf,MAAM,GACP,EAAE,yBAAyB;;oBAkD2hqE,uDAAsB;;cAAkI,uDAAsB,yBAAwB,uDAAsB;mBAAoD,uDAAsB;qBAAoD,uDAAsB;2BAAqG,uDAAsB,uCAAsC,uDAAsB,4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