Add login gate, calculation history, and AI markdown download.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,7 +20,7 @@ function parseApiError(text: string, status: number): string {
|
||||
export async function streamAiCompletion(
|
||||
body: AiRequestBody,
|
||||
onUpdate: (text: string) => void,
|
||||
): Promise<void> {
|
||||
): Promise<string> {
|
||||
const res = await fetch("/api/ai", {
|
||||
method: "POST",
|
||||
cache: "no-store",
|
||||
@@ -55,4 +55,6 @@ export async function streamAiCompletion(
|
||||
if (!text.trim()) {
|
||||
throw new Error("AI 返回内容为空,请检查模型配置或稍后重试");
|
||||
}
|
||||
|
||||
return decodeHexByteEscapes(text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user