@arizeai/phoenix-client 6.5.2 → 6.5.4

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.
package/README.md CHANGED
@@ -492,6 +492,51 @@ console.log(result.data); // array of span annotation objects
492
492
  | `cursor` | `string \| null` | Pagination cursor |
493
493
  | `limit` | `number` | Maximum annotations to return |
494
494
 
495
+ ## Sessions
496
+
497
+ The `@arizeai/phoenix-client` package provides a `sessions` export for managing conversation sessions and their annotations.
498
+
499
+ ### Fetching Sessions
500
+
501
+ Use `listSessions` to list all sessions for a project, or `getSession` to retrieve a single session by ID.
502
+
503
+ ```ts
504
+ import {
505
+ listSessions,
506
+ getSession,
507
+ addSessionAnnotation,
508
+ } from "@arizeai/phoenix-client/sessions";
509
+
510
+ // List all sessions for a project
511
+ const sessions = await listSessions({
512
+ project: "my-project",
513
+ });
514
+
515
+ for (const session of sessions) {
516
+ console.log(
517
+ `Session: ${session.sessionId}, Traces: ${session.traces.length}`
518
+ );
519
+ }
520
+
521
+ // Get a single session by its ID
522
+ const session = await getSession({ sessionId: "my-session-id" });
523
+ console.log(session.traces); // array of trace summaries in the session
524
+ ```
525
+
526
+ ### Adding Session Annotations
527
+
528
+ ```ts
529
+ await addSessionAnnotation({
530
+ sessionAnnotation: {
531
+ sessionId: "my-session-id",
532
+ name: "user-satisfaction",
533
+ label: "satisfied",
534
+ score: 0.9,
535
+ annotatorKind: "HUMAN",
536
+ },
537
+ });
538
+ ```
539
+
495
540
  ## Examples
496
541
 
497
542
  To run examples, install dependencies using `pnpm` and run:
@@ -888,6 +888,26 @@ export interface paths {
888
888
  patch?: never;
889
889
  trace?: never;
890
890
  };
891
+ "/v1/user": {
892
+ parameters: {
893
+ query?: never;
894
+ header?: never;
895
+ path?: never;
896
+ cookie?: never;
897
+ };
898
+ /**
899
+ * Get the authenticated user
900
+ * @description Returns the profile of the currently authenticated user. When authentication is disabled, returns an anonymous user representation.
901
+ */
902
+ get: operations["getViewer"];
903
+ put?: never;
904
+ post?: never;
905
+ delete?: never;
906
+ options?: never;
907
+ head?: never;
908
+ patch?: never;
909
+ trace?: never;
910
+ };
891
911
  "/v1/users": {
892
912
  parameters: {
893
913
  query?: never;
@@ -997,6 +1017,14 @@ export interface components {
997
1017
  */
998
1018
  explanation?: string | null;
999
1019
  };
1020
+ /** AnonymousUser */
1021
+ AnonymousUser: {
1022
+ /**
1023
+ * @description discriminator enum property added by openapi-typescript
1024
+ * @enum {string}
1025
+ */
1026
+ auth_method: "ANONYMOUS";
1027
+ };
1000
1028
  /** CategoricalAnnotationConfig */
1001
1029
  CategoricalAnnotationConfig: {
1002
1030
  /** Name */
@@ -1592,6 +1620,11 @@ export interface components {
1592
1620
  /** Next Cursor */
1593
1621
  next_cursor: string | null;
1594
1622
  };
1623
+ /** GetViewerResponseBody */
1624
+ GetViewerResponseBody: {
1625
+ /** Data */
1626
+ data: components["schemas"]["LocalUser"] | components["schemas"]["OAuth2User"] | components["schemas"]["LDAPUser"] | components["schemas"]["AnonymousUser"];
1627
+ };
1595
1628
  /** HTTPValidationError */
1596
1629
  HTTPValidationError: {
1597
1630
  /** Detail */
@@ -6382,6 +6415,44 @@ export interface operations {
6382
6415
  };
6383
6416
  };
6384
6417
  };
6418
+ getViewer: {
6419
+ parameters: {
6420
+ query?: never;
6421
+ header?: never;
6422
+ path?: never;
6423
+ cookie?: never;
6424
+ };
6425
+ requestBody?: never;
6426
+ responses: {
6427
+ /** @description The authenticated user's profile. */
6428
+ 200: {
6429
+ headers: {
6430
+ [name: string]: unknown;
6431
+ };
6432
+ content: {
6433
+ "application/json": components["schemas"]["GetViewerResponseBody"];
6434
+ };
6435
+ };
6436
+ /** @description User not found. */
6437
+ 401: {
6438
+ headers: {
6439
+ [name: string]: unknown;
6440
+ };
6441
+ content: {
6442
+ "text/plain": string;
6443
+ };
6444
+ };
6445
+ /** @description Forbidden */
6446
+ 403: {
6447
+ headers: {
6448
+ [name: string]: unknown;
6449
+ };
6450
+ content: {
6451
+ "text/plain": string;
6452
+ };
6453
+ };
6454
+ };
6455
+ };
6385
6456
  getUsers: {
6386
6457
  parameters: {
6387
6458
  query?: {