import Writer from 'writer-sdk'; import { Chat } from '@hashbrownai/core'; /** * The options for the Writer text stream. */ type BaseWriterTextStreamOptions = { /** * The API Key for the Writer API. */ apiKey: string; /** * The request for the stream. */ request: Chat.Api.CompletionCreateParams; /** * A function to transform the request options. */ transformRequestOptions?: (options: Writer.Chat.ChatChatParams) => Writer.Chat.ChatChatParams | Promise; }; type ThreadPersistenceOptions = { loadThread: (threadId: string) => Promise; saveThread: (thread: Chat.Api.Message[], threadId?: string) => Promise; }; type ThreadlessOptions = BaseWriterTextStreamOptions & { loadThread?: undefined; saveThread?: undefined; }; type ThreadfulOptions = BaseWriterTextStreamOptions & ThreadPersistenceOptions; export type WriterTextStreamOptions = ThreadlessOptions | ThreadfulOptions; /** * Streams text from the Writer API. * * @param options - The options for the stream. * @returns An async iterable of Uint8Arrays. */ export declare function text(options: ThreadfulOptions): AsyncIterable; export declare function text(options: ThreadlessOptions): AsyncIterable; export {};