feat: remove search rerank

This commit is contained in:
Zoe
2026-09-27 09:45:19 -05:00
parent bb5795e00d
commit d48d8163a7
17 changed files with 243 additions and 336 deletions
-20
View File
@@ -450,31 +450,11 @@ export const useChat = async (topicId: MaybeRef<string>, connect = true) => {
return Err(ChatErrorType.NoAgent);
}
const { settings } = await useUserSettings();
let rerank = undefined;
if (agent.config?.search?.rerank && settings.value.systemAssistants.rerank.enabled) {
const rerankModel = await useModels().then(m => m.allModels.value.find(m => m.id === settings.value.systemAssistants.rerank.modelId));
if (rerankModel) {
const rerankProviderApiKeyRes = await getProviderAPIKey(rerankModel.provider);
if (rerankProviderApiKeyRes.ok === false) {
return rerankProviderApiKeyRes;
}
const rerankProviderApiKey = rerankProviderApiKeyRes.data;
rerank = {
modelId: rerankModel.id,
providerApiKey: rerankProviderApiKey,
};
}
}
await $fetch(`/api/topic/${unref(topicId)}/chat`, {
method: 'POST',
body: {
modelId: model.id,
providerApiKey,
rerank,
parentMessageId,
},
});
+5 -1
View File
@@ -3,12 +3,13 @@ const persistTimeout = 150;
export const useTooltip = () => {
const activeElement = useState<HTMLElement | null>('tooltip:activeElement', () => null);
const activeText = useState<string | null>('tooltip:activeText', () => null);
const activeHotkey = useState<string[] | null>('tooltip:activeHotkey', () => null);
const isVisible = useState<boolean>('tooltip:isVisible', () => false);
const dwellTimeoutId = useState<NodeJS.Timeout | null>('tooltip:dwellTimeoutId', () => null);
const closeTimeoutId = useState<NodeJS.Timeout | null>('tooltip:closeTimeout', () => null);
const show = (el: HTMLElement, hotkey?: string[]) => {
const show = (el: HTMLElement, hotkey?: string[], text?: string) => {
if (closeTimeoutId.value) {
clearTimeout(closeTimeoutId.value);
}
@@ -16,10 +17,12 @@ export const useTooltip = () => {
if (isVisible.value) {
activeElement.value = el;
activeHotkey.value = hotkey || null;
activeText.value = text || null;
} else {
dwellTimeoutId.value = setTimeout(() => {
activeElement.value = el;
activeHotkey.value = hotkey || null;
activeText.value = text || null;
isVisible.value = true;
}, dwellTimeout);
}
@@ -44,6 +47,7 @@ export const useTooltip = () => {
return {
activeElement: readonly(activeElement),
activeHotkey: readonly(activeHotkey),
activeText: readonly(activeText),
isVisible: readonly(isVisible),
show,
hide,