UNPKG

ai-utils.js

Version:

Build AI applications, chatbots, and agents with JavaScript and TypeScript.

28 lines (27 loc) 1.03 kB
import { ErrorHandler } from "../util/ErrorHandler.js"; import { ModelCallObserver } from "../model-function/ModelCallObserver.js"; export interface Run { /** * Unique identifier for a specific run. Primarily utilized for efficient referencing * and tracking within logs. */ runId?: string; /** * Unique identifier for a session. A session can contain multiple runs. For example, in * a chatbot where each message is processed as a separate run, all those runs could be * part of a single session. Useful for tracking and logging. */ sessionId?: string; /** * The user ID of the individual who initiates the call. Useful for logging and can be * configured to be forwarded to the model provider (like OpenAI). */ userId?: string; /** * An AbortSignal that can be used to cancel any ongoing asynchronous operations tied * to the run. */ abortSignal?: AbortSignal; observers?: ModelCallObserver[]; errorHandler?: ErrorHandler; }