UNPKG

@assistant-ui/react

Version:

TypeScript/React library for AI Chat

54 lines 2.5 kB
import type { Attachment } from "../../../types/AttachmentTypes.js"; import type { AppendMessage } from "../../../types/index.js"; import type { AttachmentAdapter } from "../adapters/attachment/index.js"; import type { ComposerRuntimeCore, ComposerRuntimeEventType, DictationState } from "../core/ComposerRuntimeCore.js"; import type { MessageRole, RunConfig } from "../../../types/AssistantTypes.js"; import { BaseSubscribable } from "../remote-thread-list/BaseSubscribable.js"; import type { DictationAdapter } from "../adapters/speech/SpeechAdapterTypes.js"; export declare abstract class BaseComposerRuntimeCore extends BaseSubscribable implements ComposerRuntimeCore { readonly isEditing = true; protected abstract getAttachmentAdapter(): AttachmentAdapter | undefined; protected abstract getDictationAdapter(): DictationAdapter | undefined; get attachmentAccept(): string; private _attachments; get attachments(): readonly Attachment[]; protected setAttachments(value: readonly Attachment[]): void; abstract get canCancel(): boolean; get isEmpty(): boolean; private _text; get text(): string; private _role; get role(): "system" | "user" | "assistant"; private _runConfig; get runConfig(): RunConfig; setText(value: string): void; setRole(role: MessageRole): void; setRunConfig(runConfig: RunConfig): void; private _emptyTextAndAttachments; private _onClearAttachments; reset(): Promise<void>; clearAttachments(): Promise<void>; send(): Promise<void>; cancel(): void; protected abstract handleSend(message: Omit<AppendMessage, "parentId" | "sourceId">): void; protected abstract handleCancel(): void; addAttachment(file: File): Promise<void>; removeAttachment(attachmentId: string): Promise<void>; private _dictation; private _dictationSession; private _dictationUnsubscribes; private _dictationBaseText; private _currentInterimText; private _dictationSessionIdCounter; private _activeDictationSessionId; private _isCleaningDictation; get dictation(): DictationState | undefined; private _isActiveSession; startDictation(): void; stopDictation(): void; private _cleanupDictation; private _eventSubscribers; protected _notifyEventSubscribers(event: ComposerRuntimeEventType): void; unstable_on(event: ComposerRuntimeEventType, callback: () => void): () => void; } //# sourceMappingURL=BaseComposerRuntimeCore.d.ts.map