UNPKG

@assistant-ui/react

Version:

React components for AI chat.

32 lines 1.6 kB
import { ThreadAssistantContentPart, ThreadUserContentPart, ContentPartStatus, ToolCallContentPartStatus } from "../types/AssistantTypes"; import { ThreadRuntimeCoreBinding } from "./ThreadRuntime"; import { MessageStateBinding } from "./MessageRuntime"; import { SubscribableWithState } from "./subscribable/Subscribable"; import { Unsubscribe } from "../types"; import { ContentPartRuntimePath } from "./RuntimePathTypes"; export type ContentPartState = (ThreadUserContentPart | ThreadAssistantContentPart) & { /** * @deprecated You can directly access content part fields in the state. Replace `.part.type` with `.type` etc. This will be removed in 0.6.0. */ part: ThreadUserContentPart | ThreadAssistantContentPart; status: ContentPartStatus | ToolCallContentPartStatus; }; type ContentPartSnapshotBinding = SubscribableWithState<ContentPartState, ContentPartRuntimePath>; export type ContentPartRuntime = { path: ContentPartRuntimePath; getState(): ContentPartState; addToolResult(result: any): void; subscribe(callback: () => void): Unsubscribe; }; export declare class ContentPartRuntimeImpl implements ContentPartRuntime { private contentBinding; private messageApi; private threadApi; get path(): ContentPartRuntimePath; constructor(contentBinding: ContentPartSnapshotBinding, messageApi: MessageStateBinding, threadApi: ThreadRuntimeCoreBinding); getState(): ContentPartState; addToolResult(result: any): void; subscribe(callback: () => void): Unsubscribe; } export {}; //# sourceMappingURL=ContentPartRuntime.d.ts.map