forked from Leaf/amber-ui
改进 预设 prompt 的对话标题
This commit is contained in:
parent
ba91a48942
commit
3856533f8d
@ -30,7 +30,11 @@
|
|||||||
:title="p.act"
|
:title="p.act"
|
||||||
hoverable
|
hoverable
|
||||||
class="overflow-hidden cursor-pointer"
|
class="overflow-hidden cursor-pointer"
|
||||||
@click="overrideSystemPrompt = true;updateInputContent(p.prompt)"
|
@click="
|
||||||
|
overrideSystemPrompt = true;
|
||||||
|
overrideTitle = p.act;
|
||||||
|
updateInputContent(p.prompt);
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<n-ellipsis style="max-width: 280px" :tooltip="false">
|
<n-ellipsis style="max-width: 280px" :tooltip="false">
|
||||||
{{ p.prompt }}
|
{{ p.prompt }}
|
||||||
@ -270,7 +274,8 @@ const assistantStore = useAssistantStore();
|
|||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
const showUploadModal = ref(false);
|
const showUploadModal = ref(false);
|
||||||
|
|
||||||
const overrideSystemPrompt = ref(false)
|
const overrideSystemPrompt = ref(false);
|
||||||
|
const overrideTitle = ref("");
|
||||||
const prompts: Ref<Prompt[]> = ref([]);
|
const prompts: Ref<Prompt[]> = ref([]);
|
||||||
|
|
||||||
prompts.value = awesomeChatGPTPrompts;
|
prompts.value = awesomeChatGPTPrompts;
|
||||||
@ -453,11 +458,16 @@ async function sendMessage(
|
|||||||
name: text.slice(0, 10),
|
name: text.slice(0, 10),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (overrideTitle.value != "") {
|
||||||
|
postData.name = overrideTitle.value;
|
||||||
|
overrideTitle.value = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (overrideSystemPrompt.value) {
|
if (overrideSystemPrompt.value) {
|
||||||
postData.prompt = " ";
|
postData.prompt = " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
overrideSystemPrompt.value = false
|
overrideSystemPrompt.value = false;
|
||||||
|
|
||||||
// 如果没有指定,则使用目前选择的助理来创建聊天
|
// 如果没有指定,则使用目前选择的助理来创建聊天
|
||||||
if (chatStore.currentAssistantId) {
|
if (chatStore.currentAssistantId) {
|
||||||
|
Loading…
Reference in New Issue
Block a user