show reasoning in frontend
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import {del, get, post, put, stream} from "./app/api.js?v=20260909-account-controls";
|
||||
import {appendSources, createWebSearchToggle} from "./app/webSearch.js";
|
||||
import {updateReasoning} from "./app/reasoning.js";
|
||||
import {closeChatDrawer, openChatDrawer} from "./app/chatDrawer.js?v=20260909-account-controls";
|
||||
import {onboardingPrompts, requestedChatId} from "./app/constants.js?v=20260909-account-controls";
|
||||
import {getModelProfile} from "./app/modelProfiles.js?v=20260909-account-controls";
|
||||
@@ -741,6 +742,7 @@ function addMessage(contentOrMessage, isUser = false, isLoading = false, options
|
||||
}
|
||||
|
||||
msgDiv.append(header, body);
|
||||
if (!isMessageUser) updateReasoning(msgDiv, message.thinking);
|
||||
if (!isMessageUser) appendSources(msgDiv, message.sources);
|
||||
if (message.deliveryStatus === "failed" && message.errorMessage) {
|
||||
const error = document.createElement("p");
|
||||
@@ -1832,7 +1834,13 @@ async function sendMessage() {
|
||||
loadingLabel.textContent = status === "searching" ? "Searching the web..."
|
||||
: sourceCount === 0 ? "No web results found. Generating response..." : "Generating response...";
|
||||
},
|
||||
onThinking: ({fullThinking}) => {
|
||||
updateReasoning(loadingMsg, fullThinking, true);
|
||||
loadingLabel.textContent = "Thinking…";
|
||||
},
|
||||
onChunk: ({fullReply}) => {
|
||||
const reasoningSummary = loadingMsg.querySelector(".msg-reasoning summary");
|
||||
if (reasoningSummary) reasoningSummary.textContent = "Reasoning";
|
||||
if (loadingBody) {
|
||||
loadingShell?.classList.add("hidden");
|
||||
loadingBody.classList.add("has-content");
|
||||
|
||||
Reference in New Issue
Block a user