Files
Enterprise-Knowledge-Base/migrations/versioned/000005_add_web_search_config.up.sql
T
wizardchen 9f6b903ef2 feat: Integrate LLM-based reranking in KnowledgeSearchTool
- Added optional chat model to KnowledgeSearchTool for enhanced reranking using LLM prompt scoring.
- Updated rerankResults method to prioritize LLM-based reranking over traditional rerank model.
- Implemented new functions for LLM scoring and parsing scores from responses, improving search result relevance.
- Enhanced migration script to handle database versioning and dirty state checks more robustly.
2025-11-13 01:22:08 +08:00

24 lines
640 B
PL/PgSQL

-- 000005_add_web_search_config.up.sql
-- Add web_search_config column to tenants table for web search configuration
BEGIN;
-- Add web_search_config column to tenants table (if not exists)
-- Note: PostgreSQL 9.6+ supports IF NOT EXISTS
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'tenants' AND column_name = 'web_search_config'
) THEN
ALTER TABLE tenants
ADD COLUMN web_search_config JSONB DEFAULT NULL;
END IF;
END $$;
-- Add or update comment
COMMENT ON COLUMN tenants.web_search_config IS 'Web search configuration for the tenant';
COMMIT;