MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / onFinish

Function onFinish

app/store/chat.ts:473–481  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

471 });
472 },
473 async onFinish(message) {
474 botMessage.streaming = false;
475 if (message) {
476 botMessage.content = message;
477 botMessage.date = new Date().toLocaleString();
478 get().onNewMessage(botMessage, session);
479 }
480 ChatControllerPool.remove(session.id, botMessage.id);
481 },
482 onBeforeTool(tool: ChatMessageTool) {
483 (botMessage.tools = botMessage?.tools || []).push(tool);
484 get().updateTargetSession(session, (session) => {

Callers

nothing calls this directly

Calls 2

trimTopicFunction · 0.90
getFunction · 0.70

Tested by

no test coverage detected