add optional web search functionality with UI updates and backend integration
This commit is contained in:
@@ -58,6 +58,7 @@ export async function stream(url, data, handlers = {}) {
|
||||
const event = eventLine.slice(6).trim();
|
||||
const payload = JSON.parse(dataLine.slice(5).trim());
|
||||
if (event === "chunk" && handlers.onChunk) handlers.onChunk(payload);
|
||||
if (event === "status" && handlers.onStatus) handlers.onStatus(payload);
|
||||
if (event === "done" && handlers.onDone) handlers.onDone(payload);
|
||||
if (event === "error" && handlers.onError) handlers.onError(payload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user