mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-27 07:54:19 +00:00
323481d69b
* feat(provider): add rerank model management as a core model type * feat(provider): add rerank support to existing requesters and new rerank providers * feat(web): add rerank model management UI and pipeline config * fix(provider): correct rerank support_type after verification - Add rerank to OpenRouter (confirmed /api/v1/rerank endpoint) - Remove rerank from Ollama (no native support, PR #7219 unmerged) - Remove rerank from JiekouAI (no rerank docs found, URL path mismatch) * fix(provider): remove alru_cache from model getters and add rerank param hints * fix: resolve lint errors - Remove unused alru_cache import from modelmgr.py - Remove unused error_message variable in invoke_rerank - Fix prettier formatting in frontend files Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: remove unused exception variable - Change `except Exception as e:` to `except Exception:` since e is not used - Fix prettier formatting in ProviderCard.tsx Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix: apply ruff format Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * feat(template): add rerank config fields to default pipeline config Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: remove PR.md Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * fix(ui): remove duplicate rerank model form in AddModelPopover The form was being rendered twice: once in TabsContent manual mode and again in a separate conditional block for rerank tab. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
59 lines
1.6 KiB
TypeScript
59 lines
1.6 KiB
TypeScript
import { I18nObject } from '@/app/infra/entities/common';
|
|
|
|
export interface IShowIfCondition {
|
|
field: string;
|
|
operator: 'eq' | 'neq' | 'in';
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
value: any;
|
|
}
|
|
|
|
export interface IDynamicFormItemSchema {
|
|
id: string;
|
|
default: string | number | boolean | Array<unknown>;
|
|
label: I18nObject;
|
|
name: string;
|
|
required: boolean;
|
|
type: DynamicFormItemType;
|
|
description?: I18nObject;
|
|
options?: IDynamicFormItemOption[];
|
|
show_if?: IShowIfCondition;
|
|
|
|
/** when type is PLUGIN_SELECTOR, the scopes is the scopes of components(plugin contains), the default is all */
|
|
scopes?: string[];
|
|
accept?: string; // For file type: accepted MIME types
|
|
}
|
|
|
|
export enum DynamicFormItemType {
|
|
INT = 'integer',
|
|
FLOAT = 'float',
|
|
BOOLEAN = 'boolean',
|
|
STRING = 'string',
|
|
TEXT = 'text',
|
|
STRING_ARRAY = 'array[string]',
|
|
FILE = 'file',
|
|
FILE_ARRAY = 'array[file]',
|
|
SELECT = 'select',
|
|
LLM_MODEL_SELECTOR = 'llm-model-selector',
|
|
EMBEDDING_MODEL_SELECTOR = 'embedding-model-selector',
|
|
RERANK_MODEL_SELECTOR = 'rerank-model-selector',
|
|
MODEL_FALLBACK_SELECTOR = 'model-fallback-selector',
|
|
PROMPT_EDITOR = 'prompt-editor',
|
|
UNKNOWN = 'unknown',
|
|
KNOWLEDGE_BASE_SELECTOR = 'knowledge-base-selector',
|
|
KNOWLEDGE_BASE_MULTI_SELECTOR = 'knowledge-base-multi-selector',
|
|
PLUGIN_SELECTOR = 'plugin-selector',
|
|
BOT_SELECTOR = 'bot-selector',
|
|
TOOLS_SELECTOR = 'tools-selector',
|
|
WEBHOOK_URL = 'webhook-url',
|
|
}
|
|
|
|
export interface IFileConfig {
|
|
file_key: string;
|
|
mimetype: string;
|
|
}
|
|
|
|
export interface IDynamicFormItemOption {
|
|
name: string;
|
|
label: I18nObject;
|
|
}
|