@arizeai/phoenix-client 6.9.1 → 6.9.2

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 (72) hide show
  1. package/dist/esm/__generated__/api/v1.d.ts +313 -4
  2. package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
  3. package/dist/esm/client.d.ts +1 -0
  4. package/dist/esm/client.d.ts.map +1 -1
  5. package/dist/esm/prompts/sdks/toAI.d.ts.map +1 -1
  6. package/dist/esm/prompts/sdks/toAI.js +31 -11
  7. package/dist/esm/prompts/sdks/toAI.js.map +1 -1
  8. package/dist/esm/prompts/sdks/toAnthropic.d.ts.map +1 -1
  9. package/dist/esm/prompts/sdks/toAnthropic.js +23 -13
  10. package/dist/esm/prompts/sdks/toAnthropic.js.map +1 -1
  11. package/dist/esm/prompts/sdks/toOpenAI.d.ts.map +1 -1
  12. package/dist/esm/prompts/sdks/toOpenAI.js +23 -13
  13. package/dist/esm/prompts/sdks/toOpenAI.js.map +1 -1
  14. package/dist/esm/schemas/llm/phoenixPrompt/converters.js +2 -2
  15. package/dist/esm/schemas/llm/phoenixPrompt/converters.js.map +1 -1
  16. package/dist/esm/schemas/llm/phoenixPrompt/toolSchemas.d.ts +2 -2
  17. package/dist/esm/schemas/llm/phoenixPrompt/toolSchemas.d.ts.map +1 -1
  18. package/dist/esm/schemas/llm/phoenixPrompt/toolSchemas.js +1 -1
  19. package/dist/esm/schemas/llm/phoenixPrompt/toolSchemas.js.map +1 -1
  20. package/dist/esm/schemas/llm/schemas.js +2 -2
  21. package/dist/esm/schemas/llm/schemas.js.map +1 -1
  22. package/dist/esm/schemas/llm/utils.js +2 -2
  23. package/dist/esm/schemas/llm/utils.js.map +1 -1
  24. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  25. package/dist/esm/types/prompts.d.ts +4 -0
  26. package/dist/esm/types/prompts.d.ts.map +1 -1
  27. package/dist/esm/types/prompts.js +6 -1
  28. package/dist/esm/types/prompts.js.map +1 -1
  29. package/dist/esm/utils/formatPromptMessages.d.ts.map +1 -1
  30. package/dist/esm/utils/getPromptBySelector.d.ts +294 -5
  31. package/dist/esm/utils/getPromptBySelector.d.ts.map +1 -1
  32. package/dist/src/__generated__/api/v1.d.ts +313 -4
  33. package/dist/src/__generated__/api/v1.d.ts.map +1 -1
  34. package/dist/src/client.d.ts +11 -10
  35. package/dist/src/client.d.ts.map +1 -1
  36. package/dist/src/prompts/sdks/toAI.d.ts.map +1 -1
  37. package/dist/src/prompts/sdks/toAI.js +35 -15
  38. package/dist/src/prompts/sdks/toAI.js.map +1 -1
  39. package/dist/src/prompts/sdks/toAnthropic.d.ts.map +1 -1
  40. package/dist/src/prompts/sdks/toAnthropic.js +24 -14
  41. package/dist/src/prompts/sdks/toAnthropic.js.map +1 -1
  42. package/dist/src/prompts/sdks/toOpenAI.d.ts.map +1 -1
  43. package/dist/src/prompts/sdks/toOpenAI.js +24 -14
  44. package/dist/src/prompts/sdks/toOpenAI.js.map +1 -1
  45. package/dist/src/schemas/llm/phoenixPrompt/converters.js +1 -1
  46. package/dist/src/schemas/llm/phoenixPrompt/converters.js.map +1 -1
  47. package/dist/src/schemas/llm/phoenixPrompt/toolSchemas.d.ts +2 -2
  48. package/dist/src/schemas/llm/phoenixPrompt/toolSchemas.d.ts.map +1 -1
  49. package/dist/src/schemas/llm/phoenixPrompt/toolSchemas.js +2 -2
  50. package/dist/src/schemas/llm/phoenixPrompt/toolSchemas.js.map +1 -1
  51. package/dist/src/schemas/llm/schemas.js +1 -1
  52. package/dist/src/schemas/llm/schemas.js.map +1 -1
  53. package/dist/src/schemas/llm/utils.js +1 -1
  54. package/dist/src/schemas/llm/utils.js.map +1 -1
  55. package/dist/src/types/prompts.d.ts +4 -0
  56. package/dist/src/types/prompts.d.ts.map +1 -1
  57. package/dist/src/types/prompts.js +8 -0
  58. package/dist/src/types/prompts.js.map +1 -1
  59. package/dist/src/utils/formatPromptMessages.d.ts.map +1 -1
  60. package/dist/src/utils/getPromptBySelector.d.ts +294 -5
  61. package/dist/src/utils/getPromptBySelector.d.ts.map +1 -1
  62. package/dist/tsconfig.tsbuildinfo +1 -1
  63. package/package.json +2 -2
  64. package/src/__generated__/api/v1.ts +313 -4
  65. package/src/prompts/sdks/toAI.ts +33 -11
  66. package/src/prompts/sdks/toAnthropic.ts +26 -15
  67. package/src/prompts/sdks/toOpenAI.ts +25 -15
  68. package/src/schemas/llm/phoenixPrompt/converters.ts +2 -2
  69. package/src/schemas/llm/phoenixPrompt/toolSchemas.ts +16 -13
  70. package/src/schemas/llm/schemas.ts +2 -2
  71. package/src/schemas/llm/utils.ts +2 -2
  72. package/src/types/prompts.ts +13 -0
@@ -73,7 +73,33 @@ export interface paths {
73
73
  get: operations["listSpanAnnotationsBySpanIds"];
74
74
  put?: never;
75
75
  post?: never;
76
- delete?: never;
76
+ /**
77
+ * Delete span annotations in a project that match the supplied filter.
78
+ * @description Hard-delete span annotations within the named project that match the
79
+ * supplied filter.
80
+ *
81
+ * - The request must either supply both `start_time` AND `end_time`
82
+ * to bound the delete to a `[start_time, end_time)` time window,
83
+ * OR set `delete_all=true` to acknowledge an unbounded sweep. A request
84
+ * that satisfies neither is rejected with 422.
85
+ * - `name`, `identifier`, and `annotator_kind` are optional narrowing
86
+ * filters; on their own they do NOT authorize the request — they only
87
+ * narrow within an already-authorized request (bounded time range or
88
+ * `delete_all=true`).
89
+ * - All supplied filters are combined with AND. `name` and `identifier`,
90
+ * when present, must be non-empty.
91
+ * - `start_time` is inclusive (`>=`); `end_time` is exclusive
92
+ * (`<`). When both are supplied, `start_time` must be strictly earlier
93
+ * than `end_time` (else 422). A half-bounded range (only one of
94
+ * the two) does NOT satisfy the gate and is rejected unless
95
+ * `delete_all=true` is also set. Naive datetimes are interpreted as UTC.
96
+ * - The endpoint is idempotent: a request that matches no rows still
97
+ * returns 204.
98
+ * - When authentication is enabled, non-admin callers can only delete rows
99
+ * they own (`user_id == current_user.id`); admins delete all matching
100
+ * rows.
101
+ */
102
+ delete: operations["deleteSpanAnnotations"];
77
103
  options?: never;
78
104
  head?: never;
79
105
  patch?: never;
@@ -93,7 +119,33 @@ export interface paths {
93
119
  get: operations["listTraceAnnotationsByTraceIds"];
94
120
  put?: never;
95
121
  post?: never;
96
- delete?: never;
122
+ /**
123
+ * Delete trace annotations in a project that match the supplied filter.
124
+ * @description Hard-delete trace annotations within the named project that match the
125
+ * supplied filter.
126
+ *
127
+ * - The request must either supply both `start_time` AND `end_time`
128
+ * to bound the delete to a `[start_time, end_time)` time window,
129
+ * OR set `delete_all=true` to acknowledge an unbounded sweep. A request
130
+ * that satisfies neither is rejected with 422.
131
+ * - `name`, `identifier`, and `annotator_kind` are optional narrowing
132
+ * filters; on their own they do NOT authorize the request — they only
133
+ * narrow within an already-authorized request (bounded time range or
134
+ * `delete_all=true`).
135
+ * - All supplied filters are combined with AND. `name` and `identifier`,
136
+ * when present, must be non-empty.
137
+ * - `start_time` is inclusive (`>=`); `end_time` is exclusive
138
+ * (`<`). When both are supplied, `start_time` must be strictly earlier
139
+ * than `end_time` (else 422). A half-bounded range (only one of
140
+ * the two) does NOT satisfy the gate and is rejected unless
141
+ * `delete_all=true` is also set. Naive datetimes are interpreted as UTC.
142
+ * - The endpoint is idempotent: a request that matches no rows still
143
+ * returns 204.
144
+ * - When authentication is enabled, non-admin callers can only delete rows
145
+ * they own (`user_id == current_user.id`); admins delete all matching
146
+ * rows.
147
+ */
148
+ delete: operations["deleteTraceAnnotations"];
97
149
  options?: never;
98
150
  head?: never;
99
151
  patch?: never;
@@ -113,7 +165,33 @@ export interface paths {
113
165
  get: operations["listSessionAnnotationsBySessionIds"];
114
166
  put?: never;
115
167
  post?: never;
116
- delete?: never;
168
+ /**
169
+ * Delete session annotations in a project that match the supplied filter.
170
+ * @description Hard-delete session annotations within the named project that match the
171
+ * supplied filter.
172
+ *
173
+ * - The request must either supply both `start_time` AND `end_time`
174
+ * to bound the delete to a `[start_time, end_time)` time window,
175
+ * OR set `delete_all=true` to acknowledge an unbounded sweep. A request
176
+ * that satisfies neither is rejected with 422.
177
+ * - `name`, `identifier`, and `annotator_kind` are optional narrowing
178
+ * filters; on their own they do NOT authorize the request — they only
179
+ * narrow within an already-authorized request (bounded time range or
180
+ * `delete_all=true`).
181
+ * - All supplied filters are combined with AND. `name` and `identifier`,
182
+ * when present, must be non-empty.
183
+ * - `start_time` is inclusive (`>=`); `end_time` is exclusive
184
+ * (`<`). When both are supplied, `start_time` must be strictly earlier
185
+ * than `end_time` (else 422). A half-bounded range (only one of
186
+ * the two) does NOT satisfy the gate and is rejected unless
187
+ * `delete_all=true` is also set. Naive datetimes are interpreted as UTC.
188
+ * - The endpoint is idempotent: a request that matches no rows still
189
+ * returns 204.
190
+ * - When authentication is enabled, non-admin callers can only delete rows
191
+ * they own (`user_id == current_user.id`); admins delete all matching
192
+ * rows.
193
+ */
194
+ delete: operations["deleteSessionAnnotations"];
117
195
  options?: never;
118
196
  head?: never;
119
197
  patch?: never;
@@ -2881,6 +2959,18 @@ export interface components {
2881
2959
  /** Strict */
2882
2960
  strict?: boolean;
2883
2961
  };
2962
+ /** PromptToolRaw */
2963
+ PromptToolRaw: {
2964
+ /**
2965
+ * @description discriminator enum property added by openapi-typescript
2966
+ * @enum {string}
2967
+ */
2968
+ type: "raw";
2969
+ /** Raw */
2970
+ raw: {
2971
+ [key: string]: unknown;
2972
+ };
2973
+ };
2884
2974
  /** PromptTools */
2885
2975
  PromptTools: {
2886
2976
  /**
@@ -2889,7 +2979,7 @@ export interface components {
2889
2979
  */
2890
2980
  type: "tools";
2891
2981
  /** Tools */
2892
- tools: components["schemas"]["PromptToolFunction"][];
2982
+ tools: (components["schemas"]["PromptToolFunction"] | components["schemas"]["PromptToolRaw"])[];
2893
2983
  /** Tool Choice */
2894
2984
  tool_choice?: components["schemas"]["PromptToolChoiceNone"] | components["schemas"]["PromptToolChoiceZeroOrMore"] | components["schemas"]["PromptToolChoiceOneOrMore"] | components["schemas"]["PromptToolChoiceSpecificFunctionTool"];
2895
2985
  /** Disable Parallel Tool Calls */
@@ -3113,6 +3203,24 @@ export interface components {
3113
3203
  end_time: string;
3114
3204
  /** Traces */
3115
3205
  traces: components["schemas"]["SessionTraceData"][];
3206
+ /**
3207
+ * Token Count Prompt
3208
+ * @description Cumulative prompt token count across all spans in the session.
3209
+ * @default 0
3210
+ */
3211
+ token_count_prompt?: number;
3212
+ /**
3213
+ * Token Count Completion
3214
+ * @description Cumulative completion token count across all spans in the session.
3215
+ * @default 0
3216
+ */
3217
+ token_count_completion?: number;
3218
+ /**
3219
+ * Token Count Total
3220
+ * @description Cumulative total token count across all spans in the session (prompt + completion).
3221
+ * @default 0
3222
+ */
3223
+ token_count_total?: number;
3116
3224
  };
3117
3225
  /** SessionNoteData */
3118
3226
  SessionNoteData: {
@@ -3587,6 +3695,24 @@ export interface components {
3587
3695
  * Format: date-time
3588
3696
  */
3589
3697
  end_time: string;
3698
+ /**
3699
+ * Token Count Prompt
3700
+ * @description Cumulative prompt token count across all spans in the trace.
3701
+ * @default 0
3702
+ */
3703
+ token_count_prompt?: number;
3704
+ /**
3705
+ * Token Count Completion
3706
+ * @description Cumulative completion token count across all spans in the trace.
3707
+ * @default 0
3708
+ */
3709
+ token_count_completion?: number;
3710
+ /**
3711
+ * Token Count Total
3712
+ * @description Cumulative total token count across all spans in the trace (prompt + completion).
3713
+ * @default 0
3714
+ */
3715
+ token_count_total?: number;
3590
3716
  /** Spans */
3591
3717
  spans?: components["schemas"]["TraceSpanData"][] | null;
3592
3718
  };
@@ -4036,6 +4162,67 @@ export interface operations {
4036
4162
  };
4037
4163
  };
4038
4164
  };
4165
+ deleteSpanAnnotations: {
4166
+ parameters: {
4167
+ query?: {
4168
+ /** @description Optional annotation name. When provided, must be non-empty and narrows the delete to annotations of that name. */
4169
+ name?: string | null;
4170
+ /** @description Optional annotation identifier. When provided, must be non-empty and narrows the delete to annotations with that identifier. */
4171
+ identifier?: string | null;
4172
+ /** @description Optional annotator kind. When provided, narrows the delete to annotations produced by this annotator kind. */
4173
+ annotator_kind?: ("LLM" | "CODE" | "HUMAN") | null;
4174
+ /** @description Optional inclusive lower bound on `created_at` (>=). Naive datetimes are interpreted as UTC. */
4175
+ start_time?: string | null;
4176
+ /** @description Optional exclusive upper bound on `created_at` (<). Naive datetimes are interpreted as UTC. */
4177
+ end_time?: string | null;
4178
+ /** @description Opt-in flag that authorizes the request without a bounded `[start_time, end_time)` time window. When `false` (default) or absent, the request must supply both `start_time` AND `end_time` to bound the delete. When `true`, the time-range bound is waived and any other filters (`name`, `identifier`, `annotator_kind`) still narrow the delete within the project — e.g. `delete_all=true&name=X` deletes all annotations named X regardless of time. */
4179
+ delete_all?: boolean;
4180
+ };
4181
+ header?: never;
4182
+ path: {
4183
+ /** @description The project identifier: either project ID or project name. If using a project name as the identifier, it cannot contain slash (/), question mark (?), or pound sign (#) characters. */
4184
+ project_identifier: string;
4185
+ };
4186
+ cookie?: never;
4187
+ };
4188
+ requestBody?: never;
4189
+ responses: {
4190
+ /** @description Successful Response */
4191
+ 204: {
4192
+ headers: {
4193
+ [name: string]: unknown;
4194
+ };
4195
+ content?: never;
4196
+ };
4197
+ /** @description Forbidden */
4198
+ 403: {
4199
+ headers: {
4200
+ [name: string]: unknown;
4201
+ };
4202
+ content: {
4203
+ "text/plain": string;
4204
+ };
4205
+ };
4206
+ /** @description Project not found */
4207
+ 404: {
4208
+ headers: {
4209
+ [name: string]: unknown;
4210
+ };
4211
+ content: {
4212
+ "text/plain": string;
4213
+ };
4214
+ };
4215
+ /** @description Invalid parameters */
4216
+ 422: {
4217
+ headers: {
4218
+ [name: string]: unknown;
4219
+ };
4220
+ content: {
4221
+ "text/plain": string;
4222
+ };
4223
+ };
4224
+ };
4225
+ };
4039
4226
  listTraceAnnotationsByTraceIds: {
4040
4227
  parameters: {
4041
4228
  query?: {
@@ -4099,6 +4286,67 @@ export interface operations {
4099
4286
  };
4100
4287
  };
4101
4288
  };
4289
+ deleteTraceAnnotations: {
4290
+ parameters: {
4291
+ query?: {
4292
+ /** @description Optional annotation name. When provided, must be non-empty and narrows the delete to annotations of that name. */
4293
+ name?: string | null;
4294
+ /** @description Optional annotation identifier. When provided, must be non-empty and narrows the delete to annotations with that identifier. */
4295
+ identifier?: string | null;
4296
+ /** @description Optional annotator kind. When provided, narrows the delete to annotations produced by this annotator kind. */
4297
+ annotator_kind?: ("LLM" | "CODE" | "HUMAN") | null;
4298
+ /** @description Optional inclusive lower bound on `created_at` (>=). Naive datetimes are interpreted as UTC. */
4299
+ start_time?: string | null;
4300
+ /** @description Optional exclusive upper bound on `created_at` (<). Naive datetimes are interpreted as UTC. */
4301
+ end_time?: string | null;
4302
+ /** @description Opt-in flag that authorizes the request without a bounded `[start_time, end_time)` time window. When `false` (default) or absent, the request must supply both `start_time` AND `end_time` to bound the delete. When `true`, the time-range bound is waived and any other filters (`name`, `identifier`, `annotator_kind`) still narrow the delete within the project — e.g. `delete_all=true&name=X` deletes all annotations named X regardless of time. */
4303
+ delete_all?: boolean;
4304
+ };
4305
+ header?: never;
4306
+ path: {
4307
+ /** @description The project identifier: either project ID or project name. If using a project name as the identifier, it cannot contain slash (/), question mark (?), or pound sign (#) characters. */
4308
+ project_identifier: string;
4309
+ };
4310
+ cookie?: never;
4311
+ };
4312
+ requestBody?: never;
4313
+ responses: {
4314
+ /** @description Successful Response */
4315
+ 204: {
4316
+ headers: {
4317
+ [name: string]: unknown;
4318
+ };
4319
+ content?: never;
4320
+ };
4321
+ /** @description Forbidden */
4322
+ 403: {
4323
+ headers: {
4324
+ [name: string]: unknown;
4325
+ };
4326
+ content: {
4327
+ "text/plain": string;
4328
+ };
4329
+ };
4330
+ /** @description Project not found */
4331
+ 404: {
4332
+ headers: {
4333
+ [name: string]: unknown;
4334
+ };
4335
+ content: {
4336
+ "text/plain": string;
4337
+ };
4338
+ };
4339
+ /** @description Invalid parameters */
4340
+ 422: {
4341
+ headers: {
4342
+ [name: string]: unknown;
4343
+ };
4344
+ content: {
4345
+ "text/plain": string;
4346
+ };
4347
+ };
4348
+ };
4349
+ };
4102
4350
  listSessionAnnotationsBySessionIds: {
4103
4351
  parameters: {
4104
4352
  query?: {
@@ -4162,6 +4410,67 @@ export interface operations {
4162
4410
  };
4163
4411
  };
4164
4412
  };
4413
+ deleteSessionAnnotations: {
4414
+ parameters: {
4415
+ query?: {
4416
+ /** @description Optional annotation name. When provided, must be non-empty and narrows the delete to annotations of that name. */
4417
+ name?: string | null;
4418
+ /** @description Optional annotation identifier. When provided, must be non-empty and narrows the delete to annotations with that identifier. */
4419
+ identifier?: string | null;
4420
+ /** @description Optional annotator kind. When provided, narrows the delete to annotations produced by this annotator kind. */
4421
+ annotator_kind?: ("LLM" | "CODE" | "HUMAN") | null;
4422
+ /** @description Optional inclusive lower bound on `created_at` (>=). Naive datetimes are interpreted as UTC. */
4423
+ start_time?: string | null;
4424
+ /** @description Optional exclusive upper bound on `created_at` (<). Naive datetimes are interpreted as UTC. */
4425
+ end_time?: string | null;
4426
+ /** @description Opt-in flag that authorizes the request without a bounded `[start_time, end_time)` time window. When `false` (default) or absent, the request must supply both `start_time` AND `end_time` to bound the delete. When `true`, the time-range bound is waived and any other filters (`name`, `identifier`, `annotator_kind`) still narrow the delete within the project — e.g. `delete_all=true&name=X` deletes all annotations named X regardless of time. */
4427
+ delete_all?: boolean;
4428
+ };
4429
+ header?: never;
4430
+ path: {
4431
+ /** @description The project identifier: either project ID or project name. If using a project name as the identifier, it cannot contain slash (/), question mark (?), or pound sign (#) characters. */
4432
+ project_identifier: string;
4433
+ };
4434
+ cookie?: never;
4435
+ };
4436
+ requestBody?: never;
4437
+ responses: {
4438
+ /** @description Successful Response */
4439
+ 204: {
4440
+ headers: {
4441
+ [name: string]: unknown;
4442
+ };
4443
+ content?: never;
4444
+ };
4445
+ /** @description Forbidden */
4446
+ 403: {
4447
+ headers: {
4448
+ [name: string]: unknown;
4449
+ };
4450
+ content: {
4451
+ "text/plain": string;
4452
+ };
4453
+ };
4454
+ /** @description Project not found */
4455
+ 404: {
4456
+ headers: {
4457
+ [name: string]: unknown;
4458
+ };
4459
+ content: {
4460
+ "text/plain": string;
4461
+ };
4462
+ };
4463
+ /** @description Invalid parameters */
4464
+ 422: {
4465
+ headers: {
4466
+ [name: string]: unknown;
4467
+ };
4468
+ content: {
4469
+ "text/plain": string;
4470
+ };
4471
+ };
4472
+ };
4473
+ };
4165
4474
  listDatasets: {
4166
4475
  parameters: {
4167
4476
  query?: {