@arizeai/phoenix-client 6.1.0 → 6.3.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 (62) hide show
  1. package/dist/esm/__generated__/api/v1.d.ts +321 -3
  2. package/dist/esm/__generated__/api/v1.d.ts.map +1 -1
  3. package/dist/esm/prompts/constants.d.ts.map +1 -1
  4. package/dist/esm/prompts/constants.js +5 -0
  5. package/dist/esm/prompts/constants.js.map +1 -1
  6. package/dist/esm/sessions/deleteSession.d.ts +41 -0
  7. package/dist/esm/sessions/deleteSession.d.ts.map +1 -0
  8. package/dist/esm/sessions/deleteSession.js +52 -0
  9. package/dist/esm/sessions/deleteSession.js.map +1 -0
  10. package/dist/esm/sessions/deleteSessions.d.ts +44 -0
  11. package/dist/esm/sessions/deleteSessions.d.ts.map +1 -0
  12. package/dist/esm/sessions/deleteSessions.js +44 -0
  13. package/dist/esm/sessions/deleteSessions.js.map +1 -0
  14. package/dist/esm/sessions/index.d.ts +2 -0
  15. package/dist/esm/sessions/index.d.ts.map +1 -1
  16. package/dist/esm/sessions/index.js +2 -0
  17. package/dist/esm/sessions/index.js.map +1 -1
  18. package/dist/esm/spans/getSpans.d.ts +12 -1
  19. package/dist/esm/spans/getSpans.d.ts.map +1 -1
  20. package/dist/esm/spans/getSpans.js +14 -1
  21. package/dist/esm/spans/getSpans.js.map +1 -1
  22. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  23. package/dist/esm/types/prompts.d.ts +1 -1
  24. package/dist/esm/types/prompts.d.ts.map +1 -1
  25. package/dist/esm/utils/formatPromptMessages.d.ts.map +1 -1
  26. package/dist/esm/utils/getPromptBySelector.d.ts +1 -1
  27. package/dist/esm/utils/getPromptBySelector.d.ts.map +1 -1
  28. package/dist/src/__generated__/api/v1.d.ts +321 -3
  29. package/dist/src/__generated__/api/v1.d.ts.map +1 -1
  30. package/dist/src/prompts/constants.d.ts.map +1 -1
  31. package/dist/src/prompts/constants.js +5 -0
  32. package/dist/src/prompts/constants.js.map +1 -1
  33. package/dist/src/sessions/deleteSession.d.ts +41 -0
  34. package/dist/src/sessions/deleteSession.d.ts.map +1 -0
  35. package/dist/src/sessions/deleteSession.js +55 -0
  36. package/dist/src/sessions/deleteSession.js.map +1 -0
  37. package/dist/src/sessions/deleteSessions.d.ts +44 -0
  38. package/dist/src/sessions/deleteSessions.d.ts.map +1 -0
  39. package/dist/src/sessions/deleteSessions.js +47 -0
  40. package/dist/src/sessions/deleteSessions.js.map +1 -0
  41. package/dist/src/sessions/index.d.ts +2 -0
  42. package/dist/src/sessions/index.d.ts.map +1 -1
  43. package/dist/src/sessions/index.js +2 -0
  44. package/dist/src/sessions/index.js.map +1 -1
  45. package/dist/src/spans/getSpans.d.ts +12 -1
  46. package/dist/src/spans/getSpans.d.ts.map +1 -1
  47. package/dist/src/spans/getSpans.js +14 -1
  48. package/dist/src/spans/getSpans.js.map +1 -1
  49. package/dist/src/types/prompts.d.ts +1 -1
  50. package/dist/src/types/prompts.d.ts.map +1 -1
  51. package/dist/src/utils/formatPromptMessages.d.ts.map +1 -1
  52. package/dist/src/utils/getPromptBySelector.d.ts +1 -1
  53. package/dist/src/utils/getPromptBySelector.d.ts.map +1 -1
  54. package/dist/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +1 -1
  56. package/src/__generated__/api/v1.ts +321 -3
  57. package/src/prompts/constants.ts +5 -0
  58. package/src/sessions/deleteSession.ts +73 -0
  59. package/src/sessions/deleteSessions.ts +65 -0
  60. package/src/sessions/index.ts +2 -0
  61. package/src/spans/getSpans.ts +21 -0
  62. package/src/types/prompts.ts +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arizeai/phoenix-client",
3
- "version": "6.1.0",
3
+ "version": "6.3.0",
4
4
  "description": "A client for the Phoenix API",
5
5
  "keywords": [
6
6
  "arize",
@@ -787,6 +787,34 @@ export interface paths {
787
787
  get: operations["getSession"];
788
788
  put?: never;
789
789
  post?: never;
790
+ /**
791
+ * Delete a session by identifier
792
+ * @description Delete a session by its identifier. The identifier can be either:
793
+ * 1. A global ID (base64-encoded)
794
+ * 2. A user-provided session_id string
795
+ *
796
+ * This will permanently remove the session and all associated traces, spans, and annotations via cascade delete.
797
+ */
798
+ delete: operations["deleteSession"];
799
+ options?: never;
800
+ head?: never;
801
+ patch?: never;
802
+ trace?: never;
803
+ };
804
+ "/v1/sessions/delete": {
805
+ parameters: {
806
+ query?: never;
807
+ header?: never;
808
+ path?: never;
809
+ cookie?: never;
810
+ };
811
+ get?: never;
812
+ put?: never;
813
+ /**
814
+ * Bulk delete sessions
815
+ * @description Delete multiple sessions by their identifiers (GlobalIDs or session_id strings). All identifiers in a single request must be the same type. Non-existent IDs are silently skipped. All associated traces, spans, and annotations are cascade deleted.
816
+ */
817
+ post: operations["deleteSessions"];
790
818
  delete?: never;
791
819
  options?: never;
792
820
  head?: never;
@@ -1284,6 +1312,14 @@ export interface components {
1284
1312
  /** Data */
1285
1313
  data: components["schemas"]["CategoricalAnnotationConfig"] | components["schemas"]["ContinuousAnnotationConfig"] | components["schemas"]["FreeformAnnotationConfig"];
1286
1314
  };
1315
+ /** DeleteSessionsRequestBody */
1316
+ DeleteSessionsRequestBody: {
1317
+ /**
1318
+ * Session Identifiers
1319
+ * @description List of session identifiers to delete. All identifiers must be the same type: either all GlobalIDs or all user-provided session_id strings.
1320
+ */
1321
+ session_identifiers: string[];
1322
+ };
1287
1323
  /** Experiment */
1288
1324
  Experiment: {
1289
1325
  /**
@@ -1745,7 +1781,7 @@ export interface components {
1745
1781
  * ModelProvider
1746
1782
  * @enum {string}
1747
1783
  */
1748
- ModelProvider: "OPENAI" | "AZURE_OPENAI" | "ANTHROPIC" | "GOOGLE" | "DEEPSEEK" | "XAI" | "OLLAMA" | "AWS";
1784
+ ModelProvider: "OPENAI" | "AZURE_OPENAI" | "ANTHROPIC" | "GOOGLE" | "DEEPSEEK" | "XAI" | "OLLAMA" | "AWS" | "CEREBRAS" | "FIREWORKS" | "GROQ" | "MOONSHOT" | "PERPLEXITY" | "TOGETHER";
1749
1785
  /** OAuth2User */
1750
1786
  OAuth2User: {
1751
1787
  /** Id */
@@ -2122,6 +2158,37 @@ export interface components {
2122
2158
  */
2123
2159
  reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2124
2160
  };
2161
+ /** PromptCerebrasInvocationParameters */
2162
+ PromptCerebrasInvocationParameters: {
2163
+ /**
2164
+ * @description discriminator enum property added by openapi-typescript
2165
+ * @enum {string}
2166
+ */
2167
+ type: "cerebras";
2168
+ cerebras: components["schemas"]["PromptCerebrasInvocationParametersContent"];
2169
+ };
2170
+ /** PromptCerebrasInvocationParametersContent */
2171
+ PromptCerebrasInvocationParametersContent: {
2172
+ /** Temperature */
2173
+ temperature?: number;
2174
+ /** Max Tokens */
2175
+ max_tokens?: number;
2176
+ /** Max Completion Tokens */
2177
+ max_completion_tokens?: number;
2178
+ /** Frequency Penalty */
2179
+ frequency_penalty?: number;
2180
+ /** Presence Penalty */
2181
+ presence_penalty?: number;
2182
+ /** Top P */
2183
+ top_p?: number;
2184
+ /** Seed */
2185
+ seed?: number;
2186
+ /**
2187
+ * Reasoning Effort
2188
+ * @enum {string}
2189
+ */
2190
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2191
+ };
2125
2192
  /** PromptChatTemplate */
2126
2193
  PromptChatTemplate: {
2127
2194
  /**
@@ -2175,6 +2242,37 @@ export interface components {
2175
2242
  */
2176
2243
  reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2177
2244
  };
2245
+ /** PromptFireworksInvocationParameters */
2246
+ PromptFireworksInvocationParameters: {
2247
+ /**
2248
+ * @description discriminator enum property added by openapi-typescript
2249
+ * @enum {string}
2250
+ */
2251
+ type: "fireworks";
2252
+ fireworks: components["schemas"]["PromptFireworksInvocationParametersContent"];
2253
+ };
2254
+ /** PromptFireworksInvocationParametersContent */
2255
+ PromptFireworksInvocationParametersContent: {
2256
+ /** Temperature */
2257
+ temperature?: number;
2258
+ /** Max Tokens */
2259
+ max_tokens?: number;
2260
+ /** Max Completion Tokens */
2261
+ max_completion_tokens?: number;
2262
+ /** Frequency Penalty */
2263
+ frequency_penalty?: number;
2264
+ /** Presence Penalty */
2265
+ presence_penalty?: number;
2266
+ /** Top P */
2267
+ top_p?: number;
2268
+ /** Seed */
2269
+ seed?: number;
2270
+ /**
2271
+ * Reasoning Effort
2272
+ * @enum {string}
2273
+ */
2274
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2275
+ };
2178
2276
  /** PromptGoogleInvocationParameters */
2179
2277
  PromptGoogleInvocationParameters: {
2180
2278
  /**
@@ -2201,6 +2299,37 @@ export interface components {
2201
2299
  /** Top K */
2202
2300
  top_k?: number;
2203
2301
  };
2302
+ /** PromptGroqInvocationParameters */
2303
+ PromptGroqInvocationParameters: {
2304
+ /**
2305
+ * @description discriminator enum property added by openapi-typescript
2306
+ * @enum {string}
2307
+ */
2308
+ type: "groq";
2309
+ groq: components["schemas"]["PromptGroqInvocationParametersContent"];
2310
+ };
2311
+ /** PromptGroqInvocationParametersContent */
2312
+ PromptGroqInvocationParametersContent: {
2313
+ /** Temperature */
2314
+ temperature?: number;
2315
+ /** Max Tokens */
2316
+ max_tokens?: number;
2317
+ /** Max Completion Tokens */
2318
+ max_completion_tokens?: number;
2319
+ /** Frequency Penalty */
2320
+ frequency_penalty?: number;
2321
+ /** Presence Penalty */
2322
+ presence_penalty?: number;
2323
+ /** Top P */
2324
+ top_p?: number;
2325
+ /** Seed */
2326
+ seed?: number;
2327
+ /**
2328
+ * Reasoning Effort
2329
+ * @enum {string}
2330
+ */
2331
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2332
+ };
2204
2333
  /** PromptMessage */
2205
2334
  PromptMessage: {
2206
2335
  /**
@@ -2211,6 +2340,37 @@ export interface components {
2211
2340
  /** Content */
2212
2341
  content: string | (components["schemas"]["TextContentPart"] | components["schemas"]["ToolCallContentPart"] | components["schemas"]["ToolResultContentPart"])[];
2213
2342
  };
2343
+ /** PromptMoonshotInvocationParameters */
2344
+ PromptMoonshotInvocationParameters: {
2345
+ /**
2346
+ * @description discriminator enum property added by openapi-typescript
2347
+ * @enum {string}
2348
+ */
2349
+ type: "moonshot";
2350
+ moonshot: components["schemas"]["PromptMoonshotInvocationParametersContent"];
2351
+ };
2352
+ /** PromptMoonshotInvocationParametersContent */
2353
+ PromptMoonshotInvocationParametersContent: {
2354
+ /** Temperature */
2355
+ temperature?: number;
2356
+ /** Max Tokens */
2357
+ max_tokens?: number;
2358
+ /** Max Completion Tokens */
2359
+ max_completion_tokens?: number;
2360
+ /** Frequency Penalty */
2361
+ frequency_penalty?: number;
2362
+ /** Presence Penalty */
2363
+ presence_penalty?: number;
2364
+ /** Top P */
2365
+ top_p?: number;
2366
+ /** Seed */
2367
+ seed?: number;
2368
+ /**
2369
+ * Reasoning Effort
2370
+ * @enum {string}
2371
+ */
2372
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2373
+ };
2214
2374
  /** PromptOllamaInvocationParameters */
2215
2375
  PromptOllamaInvocationParameters: {
2216
2376
  /**
@@ -2273,6 +2433,37 @@ export interface components {
2273
2433
  */
2274
2434
  reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2275
2435
  };
2436
+ /** PromptPerplexityInvocationParameters */
2437
+ PromptPerplexityInvocationParameters: {
2438
+ /**
2439
+ * @description discriminator enum property added by openapi-typescript
2440
+ * @enum {string}
2441
+ */
2442
+ type: "perplexity";
2443
+ perplexity: components["schemas"]["PromptPerplexityInvocationParametersContent"];
2444
+ };
2445
+ /** PromptPerplexityInvocationParametersContent */
2446
+ PromptPerplexityInvocationParametersContent: {
2447
+ /** Temperature */
2448
+ temperature?: number;
2449
+ /** Max Tokens */
2450
+ max_tokens?: number;
2451
+ /** Max Completion Tokens */
2452
+ max_completion_tokens?: number;
2453
+ /** Frequency Penalty */
2454
+ frequency_penalty?: number;
2455
+ /** Presence Penalty */
2456
+ presence_penalty?: number;
2457
+ /** Top P */
2458
+ top_p?: number;
2459
+ /** Seed */
2460
+ seed?: number;
2461
+ /**
2462
+ * Reasoning Effort
2463
+ * @enum {string}
2464
+ */
2465
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2466
+ };
2276
2467
  /** PromptResponseFormatJSONSchema */
2277
2468
  PromptResponseFormatJSONSchema: {
2278
2469
  /**
@@ -2315,6 +2506,37 @@ export interface components {
2315
2506
  * @enum {string}
2316
2507
  */
2317
2508
  PromptTemplateType: "STR" | "CHAT";
2509
+ /** PromptTogetherInvocationParameters */
2510
+ PromptTogetherInvocationParameters: {
2511
+ /**
2512
+ * @description discriminator enum property added by openapi-typescript
2513
+ * @enum {string}
2514
+ */
2515
+ type: "together";
2516
+ together: components["schemas"]["PromptTogetherInvocationParametersContent"];
2517
+ };
2518
+ /** PromptTogetherInvocationParametersContent */
2519
+ PromptTogetherInvocationParametersContent: {
2520
+ /** Temperature */
2521
+ temperature?: number;
2522
+ /** Max Tokens */
2523
+ max_tokens?: number;
2524
+ /** Max Completion Tokens */
2525
+ max_completion_tokens?: number;
2526
+ /** Frequency Penalty */
2527
+ frequency_penalty?: number;
2528
+ /** Presence Penalty */
2529
+ presence_penalty?: number;
2530
+ /** Top P */
2531
+ top_p?: number;
2532
+ /** Seed */
2533
+ seed?: number;
2534
+ /**
2535
+ * Reasoning Effort
2536
+ * @enum {string}
2537
+ */
2538
+ reasoning_effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
2539
+ };
2318
2540
  /** PromptToolChoiceNone */
2319
2541
  PromptToolChoiceNone: {
2320
2542
  /**
@@ -2397,7 +2619,7 @@ export interface components {
2397
2619
  template_type: components["schemas"]["PromptTemplateType"];
2398
2620
  template_format: components["schemas"]["PromptTemplateFormat"];
2399
2621
  /** Invocation Parameters */
2400
- invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"] | components["schemas"]["PromptXAIInvocationParameters"] | components["schemas"]["PromptOllamaInvocationParameters"] | components["schemas"]["PromptAwsInvocationParameters"];
2622
+ invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"] | components["schemas"]["PromptXAIInvocationParameters"] | components["schemas"]["PromptOllamaInvocationParameters"] | components["schemas"]["PromptAwsInvocationParameters"] | components["schemas"]["PromptCerebrasInvocationParameters"] | components["schemas"]["PromptFireworksInvocationParameters"] | components["schemas"]["PromptGroqInvocationParameters"] | components["schemas"]["PromptMoonshotInvocationParameters"] | components["schemas"]["PromptPerplexityInvocationParameters"] | components["schemas"]["PromptTogetherInvocationParameters"];
2401
2623
  tools?: components["schemas"]["PromptTools"] | null;
2402
2624
  /** Response Format */
2403
2625
  response_format?: components["schemas"]["PromptResponseFormatJSONSchema"] | null;
@@ -2416,7 +2638,7 @@ export interface components {
2416
2638
  template_type: components["schemas"]["PromptTemplateType"];
2417
2639
  template_format: components["schemas"]["PromptTemplateFormat"];
2418
2640
  /** Invocation Parameters */
2419
- invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"] | components["schemas"]["PromptXAIInvocationParameters"] | components["schemas"]["PromptOllamaInvocationParameters"] | components["schemas"]["PromptAwsInvocationParameters"];
2641
+ invocation_parameters: components["schemas"]["PromptOpenAIInvocationParameters"] | components["schemas"]["PromptAzureOpenAIInvocationParameters"] | components["schemas"]["PromptAnthropicInvocationParameters"] | components["schemas"]["PromptGoogleInvocationParameters"] | components["schemas"]["PromptDeepSeekInvocationParameters"] | components["schemas"]["PromptXAIInvocationParameters"] | components["schemas"]["PromptOllamaInvocationParameters"] | components["schemas"]["PromptAwsInvocationParameters"] | components["schemas"]["PromptCerebrasInvocationParameters"] | components["schemas"]["PromptFireworksInvocationParameters"] | components["schemas"]["PromptGroqInvocationParameters"] | components["schemas"]["PromptMoonshotInvocationParameters"] | components["schemas"]["PromptPerplexityInvocationParameters"] | components["schemas"]["PromptTogetherInvocationParameters"];
2420
2642
  tools?: components["schemas"]["PromptTools"] | null;
2421
2643
  /** Response Format */
2422
2644
  response_format?: components["schemas"]["PromptResponseFormatJSONSchema"] | null;
@@ -4635,6 +4857,10 @@ export interface operations {
4635
4857
  start_time?: string | null;
4636
4858
  /** @description Exclusive upper bound time */
4637
4859
  end_time?: string | null;
4860
+ /** @description Filter by one or more trace IDs */
4861
+ trace_id?: string[] | null;
4862
+ /** @description Filter by parent span ID. Use "null" to get root spans only. */
4863
+ parent_id?: string | null;
4638
4864
  };
4639
4865
  header?: never;
4640
4866
  path: {
@@ -4694,6 +4920,10 @@ export interface operations {
4694
4920
  start_time?: string | null;
4695
4921
  /** @description Exclusive upper bound time */
4696
4922
  end_time?: string | null;
4923
+ /** @description Filter by one or more trace IDs */
4924
+ trace_id?: string[] | null;
4925
+ /** @description Filter by parent span ID. Use "null" to get root spans only. */
4926
+ parent_id?: string | null;
4697
4927
  };
4698
4928
  header?: never;
4699
4929
  path: {
@@ -5751,6 +5981,94 @@ export interface operations {
5751
5981
  };
5752
5982
  };
5753
5983
  };
5984
+ deleteSession: {
5985
+ parameters: {
5986
+ query?: never;
5987
+ header?: never;
5988
+ path: {
5989
+ /** @description The session identifier: either a GlobalID or user-provided session_id string. */
5990
+ session_identifier: string;
5991
+ };
5992
+ cookie?: never;
5993
+ };
5994
+ requestBody?: never;
5995
+ responses: {
5996
+ /** @description Successful Response */
5997
+ 204: {
5998
+ headers: {
5999
+ [name: string]: unknown;
6000
+ };
6001
+ content?: never;
6002
+ };
6003
+ /** @description Forbidden */
6004
+ 403: {
6005
+ headers: {
6006
+ [name: string]: unknown;
6007
+ };
6008
+ content: {
6009
+ "text/plain": string;
6010
+ };
6011
+ };
6012
+ /** @description Not Found */
6013
+ 404: {
6014
+ headers: {
6015
+ [name: string]: unknown;
6016
+ };
6017
+ content: {
6018
+ "text/plain": string;
6019
+ };
6020
+ };
6021
+ /** @description Validation Error */
6022
+ 422: {
6023
+ headers: {
6024
+ [name: string]: unknown;
6025
+ };
6026
+ content: {
6027
+ "application/json": components["schemas"]["HTTPValidationError"];
6028
+ };
6029
+ };
6030
+ };
6031
+ };
6032
+ deleteSessions: {
6033
+ parameters: {
6034
+ query?: never;
6035
+ header?: never;
6036
+ path?: never;
6037
+ cookie?: never;
6038
+ };
6039
+ requestBody: {
6040
+ content: {
6041
+ "application/json": components["schemas"]["DeleteSessionsRequestBody"];
6042
+ };
6043
+ };
6044
+ responses: {
6045
+ /** @description Successful Response */
6046
+ 204: {
6047
+ headers: {
6048
+ [name: string]: unknown;
6049
+ };
6050
+ content?: never;
6051
+ };
6052
+ /** @description Forbidden */
6053
+ 403: {
6054
+ headers: {
6055
+ [name: string]: unknown;
6056
+ };
6057
+ content: {
6058
+ "text/plain": string;
6059
+ };
6060
+ };
6061
+ /** @description Unprocessable Entity */
6062
+ 422: {
6063
+ headers: {
6064
+ [name: string]: unknown;
6065
+ };
6066
+ content: {
6067
+ "text/plain": string;
6068
+ };
6069
+ };
6070
+ };
6071
+ };
5754
6072
  listProjectSessions: {
5755
6073
  parameters: {
5756
6074
  query?: {
@@ -12,4 +12,9 @@ export const PromptModelProviders: Record<PromptModelProvider, string> = {
12
12
  XAI: "xAI",
13
13
  OLLAMA: "Ollama",
14
14
  AWS: "AWS Bedrock",
15
+ CEREBRAS: "Cerebras",
16
+ FIREWORKS: "Fireworks",
17
+ GROQ: "Groq",
18
+ MOONSHOT: "Moonshot",
19
+ PERPLEXITY: "Perplexity",
15
20
  };
@@ -0,0 +1,73 @@
1
+ import { createClient } from "../client";
2
+ import type { ClientFn } from "../types/core";
3
+
4
+ /**
5
+ * Parameters to delete a session
6
+ */
7
+ export interface DeleteSessionParams extends ClientFn {
8
+ /**
9
+ * The session ID. Can be either:
10
+ * - A user-provided session ID string
11
+ * - A Phoenix Global ID (base64-encoded)
12
+ */
13
+ sessionId: string;
14
+ }
15
+
16
+ /**
17
+ * Delete a single session by ID.
18
+ *
19
+ * This will permanently remove the session and all associated traces, spans,
20
+ * and annotations via cascade delete.
21
+ *
22
+ * @experimental this function is experimental and may change in the future
23
+ *
24
+ * @param params - The parameters to delete a session
25
+ * @returns Promise that resolves when the session is successfully deleted
26
+ * @throws Error if the session is not found or deletion fails
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * // Delete by user-provided session ID
31
+ * await deleteSession({
32
+ * client,
33
+ * sessionId: "my-session-id"
34
+ * });
35
+ *
36
+ * // Delete by Phoenix Global ID
37
+ * await deleteSession({
38
+ * client,
39
+ * sessionId: "UHJvamVjdFNlc3Npb246MTIz"
40
+ * });
41
+ * ```
42
+ */
43
+ export async function deleteSession({
44
+ client: _client,
45
+ sessionId,
46
+ }: DeleteSessionParams): Promise<void> {
47
+ const client = _client ?? createClient();
48
+
49
+ const { error } = await client.DELETE("/v1/sessions/{session_identifier}", {
50
+ params: {
51
+ path: {
52
+ session_identifier: sessionId,
53
+ },
54
+ },
55
+ });
56
+
57
+ if (error) {
58
+ const isNotFound =
59
+ typeof error === "object" &&
60
+ error !== null &&
61
+ "status" in error &&
62
+ error.status === 404;
63
+ if (isNotFound) {
64
+ throw new Error(`Session not found: ${sessionId}`);
65
+ }
66
+
67
+ const errorMessage =
68
+ typeof error === "object" && error !== null
69
+ ? JSON.stringify(error, null, 2)
70
+ : String(error);
71
+ throw new Error(`Failed to delete session: ${errorMessage}`);
72
+ }
73
+ }
@@ -0,0 +1,65 @@
1
+ import { createClient } from "../client";
2
+ import type { ClientFn } from "../types/core";
3
+
4
+ /**
5
+ * Parameters to bulk delete sessions
6
+ */
7
+ export interface DeleteSessionsParams extends ClientFn {
8
+ /**
9
+ * List of session identifiers to delete. Each can be either:
10
+ * - A user-provided session ID string
11
+ * - A Phoenix Global ID (base64-encoded)
12
+ *
13
+ * All identifiers must be the same type (no mixing).
14
+ */
15
+ sessionIds: string[];
16
+ }
17
+
18
+ /**
19
+ * Delete multiple sessions by their identifiers.
20
+ *
21
+ * All identifiers must be the same type: either all GlobalIDs or all
22
+ * user-provided session_id strings. Non-existent IDs are silently skipped.
23
+ * All associated traces, spans, and annotations are cascade deleted.
24
+ *
25
+ * @experimental this function is experimental and may change in the future
26
+ *
27
+ * @param params - The parameters to bulk delete sessions
28
+ * @returns Promise that resolves when the sessions are successfully deleted
29
+ * @throws Error if identifiers are mixed types or deletion fails
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * // Delete by user-provided session IDs
34
+ * await deleteSessions({
35
+ * client,
36
+ * sessionIds: ["session-1", "session-2", "session-3"]
37
+ * });
38
+ *
39
+ * // Delete by Phoenix Global IDs
40
+ * await deleteSessions({
41
+ * client,
42
+ * sessionIds: ["UHJvamVjdFNlc3Npb246MQ==", "UHJvamVjdFNlc3Npb246Mg=="]
43
+ * });
44
+ * ```
45
+ */
46
+ export async function deleteSessions({
47
+ client: _client,
48
+ sessionIds,
49
+ }: DeleteSessionsParams): Promise<void> {
50
+ const client = _client ?? createClient();
51
+
52
+ const { error } = await client.POST("/v1/sessions/delete", {
53
+ body: {
54
+ session_identifiers: sessionIds,
55
+ },
56
+ });
57
+
58
+ if (error) {
59
+ const errorMessage =
60
+ typeof error === "object" && error !== null
61
+ ? JSON.stringify(error, null, 2)
62
+ : String(error);
63
+ throw new Error(`Failed to delete sessions: ${errorMessage}`);
64
+ }
65
+ }
@@ -1,4 +1,6 @@
1
1
  export * from "./addSessionAnnotation";
2
+ export * from "./deleteSession";
3
+ export * from "./deleteSessions";
2
4
  export * from "./getSession";
3
5
  export * from "./listSessions";
4
6
  export * from "./logSessionAnnotations";
@@ -18,6 +18,10 @@ export interface GetSpansParams extends ClientFn {
18
18
  cursor?: string | null;
19
19
  /** Maximum number of spans to return */
20
20
  limit?: number;
21
+ /** Filter spans by one or more trace IDs */
22
+ traceIds?: string[] | null;
23
+ /** Filter by parent span ID. Use `null` or the string `"null"` to get root spans only. */
24
+ parentId?: string | null;
21
25
  }
22
26
 
23
27
  export type GetSpansResponse = operations["getSpans"]["responses"]["200"];
@@ -59,6 +63,13 @@ export type GetSpansResult = {
59
63
  * limit: 100
60
64
  * });
61
65
 
66
+ *
67
+ * // Get all spans for specific traces (requires Phoenix server >= 13.9.0)
68
+ * const result = await getSpans({
69
+ * client,
70
+ * project: { projectName: "my-project" },
71
+ * traceIds: ["trace-abc-123", "trace-def-456"],
72
+ * });
62
73
  *
63
74
  * // Paginate through results
64
75
  * let cursor: string | undefined;
@@ -86,6 +97,8 @@ export async function getSpans({
86
97
  limit = 100,
87
98
  startTime,
88
99
  endTime,
100
+ traceIds,
101
+ parentId,
89
102
  }: GetSpansParams): Promise<GetSpansResult> {
90
103
  const client = _client ?? createClient();
91
104
  const projectIdentifier = resolveProjectIdentifier(project);
@@ -107,6 +120,14 @@ export async function getSpans({
107
120
  params.end_time = endTime instanceof Date ? endTime.toISOString() : endTime;
108
121
  }
109
122
 
123
+ if (traceIds) {
124
+ params.trace_id = traceIds;
125
+ }
126
+
127
+ if (parentId !== undefined) {
128
+ params.parent_id = parentId === null ? "null" : parentId;
129
+ }
130
+
110
131
  const { data, error } = await client.GET(
111
132
  "/v1/projects/{project_identifier}/spans",
112
133
  {
@@ -11,7 +11,12 @@ export type PromptModelProvider =
11
11
  | "DEEPSEEK"
12
12
  | "XAI"
13
13
  | "OLLAMA"
14
- | "AWS";
14
+ | "AWS"
15
+ | "CEREBRAS"
16
+ | "FIREWORKS"
17
+ | "GROQ"
18
+ | "MOONSHOT"
19
+ | "PERPLEXITY";
15
20
 
16
21
  /**
17
22
  * Supported prompt provider SDKs