ui: add Rerank tab to playground (#536)

Add a new Rerank tab to the playground that lets users test /v1/rerank
endpoints. Supports a visual table editor and a JSON editor mode that
stay in sync when toggling between them.

- add rerankApi.ts with typed wrapper for /v1/rerank
- add RerankInterface.svelte with query input, sortable document table,
color-coded scores, auto-add row, cancel/clear, and token usage
- add rerankLoading store to playgroundActivity derived store
- register Rerank tab in Playground.svelte

Updates #481
This commit is contained in:
Benson Wong
2026-02-21 21:59:14 -08:00
committed by GitHub
parent 19fb5f35e9
commit 64e4c79fc3
4 changed files with 443 additions and 3 deletions
+4 -2
View File
@@ -4,10 +4,11 @@ const chatStreaming = writable(false);
const imageGenerating = writable(false);
const speechGenerating = writable(false);
const audioTranscribing = writable(false);
const rerankLoading = writable(false);
export const playgroundActivity = derived(
[chatStreaming, imageGenerating, speechGenerating, audioTranscribing],
([$chat, $image, $speech, $audio]) => $chat || $image || $speech || $audio
[chatStreaming, imageGenerating, speechGenerating, audioTranscribing, rerankLoading],
([$chat, $image, $speech, $audio, $rerank]) => $chat || $image || $speech || $audio || $rerank
);
export const playgroundStores = {
@@ -15,4 +16,5 @@ export const playgroundStores = {
imageGenerating,
speechGenerating,
audioTranscribing,
rerankLoading,
};