MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / formatResponse

Function formatResponse

outdated/gpt/gpt.ts:545–561  ·  view source on GitHub ↗
(question: string, answer: string)

Source from the content-addressed store, hash-verified

543
544// 格式化回答消息
545function formatResponse(question: string, answer: string): string {
546 let finalText = "";
547
548 if (question.trim()) {
549 // 添加问题部分
550 finalText += "<b>Q:</b>\n";
551 const htmlQuestion = markdownToHtml(question);
552 finalText += `<blockquote>${htmlQuestion}</blockquote>\n\n`;
553 }
554
555 // 添加回答部分
556 finalText += "<b>A:</b>\n";
557 const htmlAnswer = markdownToHtml(answer);
558 finalText += `<blockquote>${htmlAnswer}</blockquote>`;
559
560 return finalText;
561}
562
563// 清理临时文件
564async function cleanupTempFile(filePath?: string): Promise<void> {

Callers 1

handleGptRequestFunction · 0.70

Calls 1

markdownToHtmlFunction · 0.70

Tested by

no test coverage detected