@tanstack/ai
Version:
Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.
23 lines (22 loc) • 975 B
TypeScript
/**
* One record of a session log. `type` names the kind of record. The other
* fields are JSON.
*/
export interface LogRecord {
type: string;
[key: string]: unknown;
}
/**
* Appends records to the session log that a host keeps. A host is a
* middleware that provides this capability. `chat()` does not provide it.
*/
export interface LogRecordsWriter {
/**
* Resolves when the host has written all the records. Rejects when the
* host refuses a record or the write fails. Then the host writes none of
* the records. The host decides which record types it accepts.
*/
append: (records: ReadonlyArray<LogRecord>) => Promise<void>;
}
export declare const LogRecordsCapability: import('./capabilities.js').Capability<LogRecordsWriter, "log-records">;
export declare const getLogRecords: import('./capabilities.js').CapabilityGetter<LogRecordsWriter>, provideLogRecords: import('./capabilities.js').CapabilityProvider<LogRecordsWriter>;