Rerank Feedback Status Handler (plugs/rerankSaveFeedback.ts)

synaplan · frontend/src/components/admin/plugs/rerankSaveFeedback.ts · typescript · Apache-2.0
search, ui, analytics, lang:typescript

A utility to determine the active status of document reranking adapters. Use this to provide UI feedback on search reranking health and fallback states.

// Source: https://github.com/metadist/synaplan | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
export type RerankSaveFeedback = 'off' | 'inactive' | 'active'

const HTTP_ADAPTER = 'http'
const LLM_ADAPTER = 'llm'

/**
 * Toast kind after a successful rerank save.
 * Must match RerankRegistry::active(): a bound model uses only the HTTP
 * adapter and does not fall back to LLM, even when that adapter is healthy.
 * Rerank is consumed by document search, not chat.
 */
export function rerankSaveFeedback(status: {
  enabled: boolean
  modelKey?: string | null
  llmFallback?: boolean
  adapters: Array<{ key?: string; health: { available: boolean } }>
}): RerankSaveFeedback {
  if (!sta

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key