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

Function getMessageTextContentWithoutThinking

app/utils.ts:248–268  ·  view source on GitHub ↗
(message: RequestMessage)

Source from the content-addressed store, hash-verified

246}
247
248export function getMessageTextContentWithoutThinking(message: RequestMessage) {
249 let content = "";
250
251 if (typeof message.content === "string") {
252 content = message.content;
253 } else {
254 for (const c of message.content) {
255 if (c.type === "text") {
256 content = c.text ?? "";
257 break;
258 }
259 }
260 }
261
262 // Filter out thinking lines (starting with "> ")
263 return content
264 .split("\n")
265 .filter((line) => !line.startsWith("> ") && line.trim() !== "")
266 .join("\n")
267 .trim();
268}
269
270export function getMessageImages(message: RequestMessage): string[] {
271 if (typeof message.content === "string") {

Callers 5

chatMethod · 0.90
chatMethod · 0.90
chatMethod · 0.90
chatMethod · 0.90
chatMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected