Arize Phoenix TS
    Preparing search index...
    • Experimental

      Get the turns (root span I/O) for a session.

      Returns input/output extracted from root spans for each trace, along with the full root span. Turns are ordered by trace start_time.

      Note: A "turn" is derived from a trace's root span. For input/output to appear, the root span must have input.value and output.value attributes set (per OpenInference semantic conventions). This typically requires instrumentation that records these attributes on the top-level span.

      this function is experimental and may change in the future

      Parameters

      Returns Promise<SessionTurn[]>

      import { getSessionTurns } from "@arizeai/phoenix-client/sessions";

      const turns = await getSessionTurns({ sessionId: "my-session" });
      for (const turn of turns) {
      console.log(`[${turn.startTime}] Input: ${turn.input?.value}`);
      console.log(`[${turn.startTime}] Output: ${turn.output?.value}`);
      }