feat: 不渲染Kexue角色提示词的首句显示。
This commit is contained in:
parent
7922227f46
commit
fb7f72fcb9
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue