Update aiEngine.js
Browse files19 unmodified lines2021222324252614 unmodified lines4142434445464748495051525319 unmodified lines};const handleStreamResponse = async (response, onThink, onOutput) => {if (!response.ok) throw new Error(`Remote Stream Error: ${response.statusText}`);const reader = response.body.getReader();const decoder = new TextDecoder("utf-8");let fullText = "";14 unmodified linesfullText += chunk;}}} catch (e) { console.error("Stream reader crashed:", e.message); }return { text: fullText, usage: { totalTokenCount: 0 } };};export const AIEngine = {callPMStream: async (history, input, onThink, onOutput) => {const systemPrompt = prompts.pm_system_prompt || "You are a pro manager.";const response = await fetch(`${REMOTE_SERVER_URL}/api/stream`, {method: 'POST',headers: { 'Content-Type': 'application/json' },19 unmodified lines2021222324252614 unmodified lines4142434445464748495051525319 unmodified lines};const handleStreamResponse = async (response, onThink, onOutput) => {if (!response.ok) throw new Error(`Stream Error: ${response.statusText}`);const reader = response.body.getReader();const decoder = new TextDecoder("utf-8");let fullText = "";14 unmodified linesfullText += chunk;}}} catch (e) { console.error("Stream reader error:", e.message); }return { text: fullText, usage: { totalTokenCount: 0 } };};export const AIEngine = {callPMStream: async (history, input, onThink, onOutput) => {const systemPrompt = prompts.pm_system_prompt || "You are a lead lead architect.";const response = await fetch(`${REMOTE_SERVER_URL}/api/stream`, {method: 'POST',headers: { 'Content-Type': 'application/json' },
aiEngine.js+3-3