Fix admin authorization and harden chat requests
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/** Translate model callbacks to small wire events, including corrective-pass resets. */
|
||||
export function createTextStreamEvents(sendEvent) {
|
||||
const emit = (event, target) => (chunk, fullText) => {
|
||||
if (chunk === "" && fullText === "") sendEvent("replace", {target, text: ""});
|
||||
else if (chunk) sendEvent(event, {chunk});
|
||||
};
|
||||
return {onChunk: emit("chunk", "reply"), onThinking: emit("thinking", "thinking")};
|
||||
}
|
||||
Reference in New Issue
Block a user