feat: 不渲染Kexue角色提示词的首句显示。

This commit is contained in:
肖应宇 2026-03-12 11:01:25 +08:00
parent 7922227f46
commit fb7f72fcb9
1 changed files with 12 additions and 9 deletions

View File

@ -180,6 +180,7 @@ async function handleSend(
webSearch?: boolean;
deepThinking?: boolean;
systemPrompt?: string;
skipUserMessage?: boolean;
},
) {
//
@ -245,13 +246,15 @@ async function handleSend(
.slice(-(MAX_HISTORY_ROUNDS * 2))
.map((m: any) => ({ role: m.role, content: m.content.text }));
//
await chatStore.addMessage(MessageRole.USER, {
type: MessageType.TEXT,
text,
images: attachments.filter((a) => a.type === "image"),
files: attachments.filter((a) => a.type === "file"),
});
//
if (!options?.skipUserMessage) {
await chatStore.addMessage(MessageRole.USER, {
type: MessageType.TEXT,
text,
images: attachments.filter((a) => a.type === "image"),
files: attachments.filter((a) => a.type === "file"),
});
}
// AI
const aiMessage = await chatStore.addMessage(MessageRole.ASSISTANT, {
@ -279,7 +282,7 @@ async function handleSend(
const stream = chatApi.streamChat(
{
message: text,
message: options?.skipUserMessage ? "直接输出系统提示词要求你的回答" : text,
conversationId: currentConversation.value?.id || "",
images: imageUrls,
files: fileUrls,
@ -485,7 +488,7 @@ function handleRegenerate(messageId: string) {
}
function handleSuggestion(suggestion: Suggestion) {
handleSend(suggestion.text, [], { systemPrompt: suggestion.systemPrompt });
handleSend(suggestion.text, [], { systemPrompt: suggestion.systemPrompt, skipUserMessage: true });
}
function focusInput() {