feat: 默认选择首个聊天智能体
- 拉取智能体列表后在无会话上下文时复用现有切换逻辑选择第一个智能体 - 保留历史会话和已选智能体的优先级
This commit is contained in:
@@ -380,9 +380,22 @@ async function fetchAssistants() {
|
|||||||
raw: item,
|
raw: item,
|
||||||
value: String(item.id),
|
value: String(item.id),
|
||||||
}));
|
}));
|
||||||
|
await selectDefaultAssistantIfNeeded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function selectDefaultAssistantIfNeeded() {
|
||||||
|
if (
|
||||||
|
currentSessionId.value ||
|
||||||
|
currentSession.value?.sessionId ||
|
||||||
|
currentAssistantId.value ||
|
||||||
|
assistants.value.length === 0
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await handleAssistantChange(assistants.value[0]?.value);
|
||||||
|
}
|
||||||
|
|
||||||
async function fetchKnowledgeOptions() {
|
async function fetchKnowledgeOptions() {
|
||||||
loadingKnowledgeOptions.value = true;
|
loadingKnowledgeOptions.value = true;
|
||||||
const [, res] = await tryit(api.get)('/api/v1/documentCollection/list', {
|
const [, res] = await tryit(api.get)('/api/v1/documentCollection/list', {
|
||||||
|
|||||||
Reference in New Issue
Block a user