import type { MujianSdk } from '../../../index.ts'; import { Message } from '../../../react'; /** * LLM生成返回的数据 */ export type ParsedData = { /** 是否已完成生成,最后一块数据时为true */ isFinished: boolean; /** LLM生成的delta content */ deltaContent: string; /** LLM生成的累积内容 */ fullContent: string; /** 出错时非空 */ error?: unknown; /** 用户发送消息的ID */ questionId?: string; /** AI返回消息的ID */ replyId?: string; }; /** * 对话补全配置 */ export type CompleteOption = { /** 给onData传递的数据是否是解析后的,推荐true */ parseContent?: boolean; }; /** * 对话补全 * @returns {Promise} 返回值 */ export declare const complete: ( /** @hidden */ this: MujianSdk, /** * 消息 */ message: string, /** * 数据生成时的回调 */ onData: (data: string | ParsedData) => void, /** * 停止生成的信号 */ signal?: AbortSignal | undefined, /** * 对话补全配置 */ option?: CompleteOption | undefined) => Promise; export declare const applyRegex: (this: MujianSdk, props: { message: Message; index: number; depth: number; }) => Promise; export declare const renderMessage: (this: MujianSdk, props: { message: Message; index: number; depth: number; }) => Promise; /** * 继续 * @param onData 数据 * @param signal 信号 * @returns */ export declare const continueComplete: ( /** @hidden */ this: MujianSdk, onData: (data: string) => void, signal?: AbortSignal) => Promise; /** * 重新生成 * @param onData 数据 * @param signal 信号 * @returns */ export declare const regenerate: ( /** @hidden */ this: MujianSdk, onData: (data: string) => void, signal?: AbortSignal) => Promise;