feat: remove search rerank
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
getFaviconUrl,
|
||||
parseToolValue,
|
||||
readSearchSources,
|
||||
readSearchWarnings,
|
||||
} from "~/utils/tool-rendering";
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -19,7 +20,10 @@ const emit = defineEmits<{
|
||||
retry: [];
|
||||
}>();
|
||||
|
||||
const sources = computed(() => readSearchSources(parseToolValue(props.toolCall.output)));
|
||||
const output = computed(() => parseToolValue(props.toolCall.output));
|
||||
const sources = computed(() => readSearchSources(output.value));
|
||||
const warnings = computed(() => readSearchWarnings(output.value));
|
||||
const warningSummary = computed(() => warnings.value.map(warning => `${warning.engine}: ${warning.reason}`).join("; "));
|
||||
|
||||
const query = computed(() => {
|
||||
const input = parseToolValue(props.toolCall.input);
|
||||
@@ -103,6 +107,17 @@ const customTab = computed(() => {
|
||||
@retry="emit('retry')"
|
||||
>
|
||||
<template #summary>
|
||||
<Tooltip
|
||||
v-if="warnings.length"
|
||||
class="flex items-center text-amber-500 mr-2"
|
||||
:text="`Some search engines failed: ${warningSummary}`"
|
||||
>
|
||||
<span
|
||||
class="i-mynaui-danger-triangle w-4 h-4"
|
||||
role="img"
|
||||
:aria-label="`Some search engines failed: ${warningSummary}`"
|
||||
></span>
|
||||
</Tooltip>
|
||||
<div v-if="topDomains.length && toolCall.status !== 'pending'" class="flex items-center mr-1" aria-hidden="true">
|
||||
<span
|
||||
v-for="(domain, idx) in topDomains"
|
||||
@@ -132,7 +147,11 @@ const customTab = computed(() => {
|
||||
</template>
|
||||
|
||||
<template #sources>
|
||||
<div v-if="sources?.length" class="flex flex-col gap-2 max-h-80 overflow-y-auto scrollbar-thin p-3">
|
||||
<div class="flex flex-col gap-2 max-h-80 overflow-y-auto scrollbar-thin p-3">
|
||||
<p v-if="warnings.length" class="flex items-start gap-2 text-xs text-amber-500 m-0">
|
||||
<span class="i-mynaui-danger-triangle w-4 h-4 shrink-0" aria-hidden="true"></span>
|
||||
<span>Some search engines failed: {{ warningSummary }}</span>
|
||||
</p>
|
||||
<a
|
||||
v-for="source in sources"
|
||||
:key="source.url"
|
||||
@@ -172,10 +191,10 @@ const customTab = computed(() => {
|
||||
{{ source.snippet }}
|
||||
</p>
|
||||
</a>
|
||||
<p v-if="!sources?.length" class="text-xs text-[var(--text-tertiary)] m-0">
|
||||
{{ toolCall.status === "pending" ? "Waiting for results…" : "No usable sources returned." }}
|
||||
</p>
|
||||
</div>
|
||||
<p v-else class="text-xs text-[var(--text-tertiary)] p-3 m-0">
|
||||
{{ toolCall.status === "pending" ? "Waiting for results…" : "No usable sources returned." }}
|
||||
</p>
|
||||
</template>
|
||||
</Disclosure>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user