Cereal docs
TypeScript SDKTypeScript signatures

client.sessions

TypeScript client.sessions signature, generated from CerealClient.

This is the TypeScript interface. See client setup and behavior.

interface ClientSurface {
readonly sessions: {
    feedback(input: {
        readonly id: string;
        readonly name: string;
        readonly result: import("./types.js").EvaluationResult;
        readonly rater?: string;
        readonly source?: "human" | "code";
        readonly throughSeq?: number;
        readonly idempotencyKey: string;
    }): Promise<import("./types.js").Evaluation>;
    evaluations(input: {
        readonly id: string;
    }): Promise<ReadonlyArray<import("./types.js").Evaluation>>;
    evaluate(input: {
        readonly id: string;
        readonly evaluator: string;
        readonly throughSeq?: number;
        readonly idempotencyKey?: string;
    }): Promise<import("./types.js").Evaluation>;
    list(input?: {
        readonly agentId?: string;
        readonly filter?: SessionFilter;
    }): Promise<ReadonlyArray<Session>>;
    create(input: {
        readonly experiment?: import("./types.js").ExperimentSelection;
        readonly agentId: string;
        readonly version?: number;
        readonly initialMessage?: string;
        readonly messages?: ReadonlyArray<SeedMessage>;
        readonly overrides?: SessionOverrides;
        readonly metadata?: SessionMetadata;
        readonly identity?: Identity;
        readonly idempotencyKey?: string;
    }): Promise<Session>;
    get(input: {
        readonly id: string;
    }): Promise<Session>;
    children(input: {
        readonly id: string;
        readonly recursive?: boolean;
    }): Promise<ReadonlyArray<Session>>;
    updateMetadata(input: {
        readonly id: string;
        readonly metadata: SessionMetadata;
        readonly mode: MetadataMode;
    }): Promise<Session>;
    send(input: {
        readonly id: string;
        readonly message: string;
        readonly identity?: Identity;
        readonly mode?: MessageMode;
        readonly role?: MessageRole;
        readonly start?: boolean;
        readonly tools?: SessionToolsOverride;
        readonly metadata?: MessageMetadata;
        readonly idempotencyKey?: string;
        readonly attachments?: ReadonlyArray<BlobRef>;
    }): Promise<SessionEvent>;
    annotate(input: {
        readonly id: string;
        readonly seq: number;
        readonly metadata: MessageMetadata;
        readonly mode: MetadataMode;
    }): Promise<SessionEvent>;
    authorizations(input: {
        readonly id: string;
    }): Promise<ReadonlyArray<PendingAuthorization>>;
    decide(input: {
        readonly id: string;
        readonly toolCallId: string;
        readonly decision: "allow" | "deny";
        readonly message?: string;
        readonly input?: unknown;
        readonly actor?: string;
    }): Promise<Session>;
    pending(input: {
        readonly id: string;
    }): Promise<ReadonlyArray<PendingDecision>>;
    interrupt(input: {
        readonly id: string;
    }): Promise<Session>;
    events(input: {
        readonly id: string;
        readonly after?: number;
    }): Promise<ReadonlyArray<SessionEvent>>;
    stream(id: string, options?: StreamOptions): AsyncIterable<StreamedEvent>;
    streamToken(input: {
        readonly id: string;
        readonly format?: StreamFormat;
        readonly ttlSeconds?: number;
        readonly include?: ReadonlyArray<StreamInclude>;
    }): Promise<StreamTokenIssued>;
};
}

For the wire contract, use HTTP reference. Composite helpers are explained in the API/SDK map.

Related SDK types: StreamOptions.