refactor: use Twilight AI SDK for model and provider connectivity tes… (#273)

* refactor: use Twilight AI SDK for model and provider connectivity testing

Replace hand-rolled HTTP probing with the Twilight AI SDK's built-in
Provider.Test() and TestModel() methods.

- Model test now runs Provider.Test() (connectivity + auth) followed by
  TestModel() (model availability) via the SDK
- Provider test auto-detects client_type from associated models and
  creates the correct SDK provider for accurate auth header handling
- Embedding models use a dedicated /embeddings endpoint probe since
  the SDK's chat Provider doesn't cover embedding APIs
- Latency measurement now covers the full test lifecycle
- Add TestStatusModelNotSupported for models not found by the provider
- Upgrade twilight-ai to v0.3.3-0.20260321100646-43c789b701dd which
  includes fallback probing for providers without GET /models/{id}

* fix: lint
This commit is contained in:
Acbox Liu
2026-03-21 19:14:50 +08:00
committed by GitHub
parent 80b36f79f3
commit a7a36df705
8 changed files with 186 additions and 137 deletions
@@ -63,11 +63,11 @@
class="mt-2"
:show-group-headers="false"
>
<template #trigger="{ open, displayLabel }">
<template #trigger="{ open: isOpen, displayLabel }">
<Button
variant="outline"
role="combobox"
:aria-expanded="open"
:aria-expanded="isOpen"
class="w-full justify-between font-normal mt-2"
>
<span class="truncate">
+1 -1
View File
@@ -9,7 +9,7 @@
import { computed } from 'vue'
const props = withDefaults(defineProps<{
status: 'success' | 'error' | 'warning' | 'idle'
status?: 'success' | 'error' | 'warning' | 'idle'
}>(), {
status: 'idle',
})