mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-12 20:19:51 +08:00
feat: add embedding and rerank support
This commit is contained in:
@@ -96,6 +96,23 @@
|
||||
{{ model.config?.image_generation === true ? '支持' : '不支持' }}
|
||||
</Badge>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 p-3 rounded-lg border">
|
||||
<Database class="w-5 h-5 text-muted-foreground" />
|
||||
<div class="flex-1">
|
||||
<p class="text-sm font-medium">
|
||||
Embedding
|
||||
</p>
|
||||
<p class="text-xs text-muted-foreground">
|
||||
向量嵌入
|
||||
</p>
|
||||
</div>
|
||||
<Badge
|
||||
:variant="supportsEmbedding(model) ? 'default' : 'secondary'"
|
||||
class="text-xs"
|
||||
>
|
||||
{{ supportsEmbedding(model) ? '支持' : '不支持' }}
|
||||
</Badge>
|
||||
</div>
|
||||
<div class="flex items-center gap-2 p-3 rounded-lg border">
|
||||
<Eye class="w-5 h-5 text-muted-foreground" />
|
||||
<div class="flex-1">
|
||||
@@ -303,6 +320,7 @@ import {
|
||||
Zap,
|
||||
Copy,
|
||||
Layers,
|
||||
Database,
|
||||
Image as ImageIcon
|
||||
} from 'lucide-vue-next'
|
||||
import { useEscapeKey } from '@/composables/useEscapeKey'
|
||||
@@ -376,6 +394,14 @@ function getFirst1hCachePrice(tieredPricing: TieredPricingConfig | undefined | n
|
||||
return get1hCachePrice(tieredPricing.tiers[0])
|
||||
}
|
||||
|
||||
function supportsEmbedding(model: PublicGlobalModel): boolean {
|
||||
return model.supports_embedding === true
|
||||
|| model.supported_capabilities?.includes('embedding') === true
|
||||
|| model.config?.embedding === true
|
||||
|| model.config?.model_type === 'embedding'
|
||||
|| (Array.isArray(model.config?.api_formats) && model.config.api_formats.some((format) => String(format).endsWith(':embedding')))
|
||||
}
|
||||
|
||||
// 添加 ESC 键监听
|
||||
useEscapeKey(() => {
|
||||
if (props.open) {
|
||||
|
||||
Reference in New Issue
Block a user