8cebb4f4e9
- unified_search: Hybride Suche (PostgreSQL FTS + pgvector + RRF Fusion) - 5 Search Providers (Contact, Company, Mail, File, Event) - KI Query Understanding (Fuzzy, Facetten via LiteLLM) - DMS Text-Extraction (PDF, DOCX, XLSX, PPTX) - Embedding Pipeline (ollama/nomic-embed-text, 768 Dim) - Background Jobs für Indexierung - Plugin-basierte Provider Registry - ai_proactive: Proaktiver KI-Agent - Context-Tracking (Frontend → Backend → Event Bus) - Proactive Engine mit LLM Suggestion-Generierung - SSE Real-time Push an Frontend - 6 AI Tools für Tool Registry - Rate-Limiting + User Settings - Deep Analysis Background Jobs - Frontend Integration: - useAIContext Hook, SuggestionSidebar, SuggestionBadge - ProactiveAISettings Page, Search API Client - Globale Suche auf neue API umgestellt - Tests: test_unified_search.py + test_ai_proactive.py (alle bestanden) - Config: Ollama Cloud DeepSeek V4 als Default, konfigurierbar - Dependencies: PyMuPDF, python-docx, python-pptx, pgvector - Bugfixes: notification type_key length, migration IF NOT EXISTS
72 lines
1.4 KiB
Python
72 lines
1.4 KiB
Python
"""Pydantic schemas for the Unified Search plugin."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
# ─── Search ───
|
|
|
|
class SearchRequest(BaseModel):
|
|
query: str = Field(..., min_length=1, max_length=500)
|
|
entity_types: list[str] | None = None
|
|
limit: int = Field(default=20, ge=1, le=100)
|
|
offset: int = Field(default=0, ge=0)
|
|
|
|
|
|
class SearchResult(BaseModel):
|
|
entity_type: str
|
|
entity_id: str
|
|
title: str
|
|
snippet: str
|
|
score: float
|
|
data: dict[str, Any] = Field(default_factory=dict)
|
|
|
|
|
|
class SearchResponse(BaseModel):
|
|
query: str
|
|
normalized_query: str
|
|
results: list[SearchResult]
|
|
facets: dict[str, Any]
|
|
summary: str
|
|
suggestions: list[str]
|
|
|
|
|
|
# ─── Similar ───
|
|
|
|
class SimilarRequest(BaseModel):
|
|
entity_type: str
|
|
entity_id: str
|
|
limit: int = Field(default=5, ge=1, le=50)
|
|
|
|
|
|
class SimilarResponse(BaseModel):
|
|
similar: dict[str, list[SearchResult]]
|
|
|
|
|
|
# ─── Suggest ───
|
|
|
|
class SuggestRequest(BaseModel):
|
|
q: str = Field(..., min_length=1, max_length=200)
|
|
limit: int = Field(default=10, ge=1, le=50)
|
|
|
|
|
|
class SuggestResponse(BaseModel):
|
|
suggestions: list[str]
|
|
|
|
|
|
# ─── Reindex ───
|
|
|
|
class ReindexRequest(BaseModel):
|
|
entity_types: list[str] = Field(default_factory=list)
|
|
|
|
|
|
# ─── Provider ───
|
|
|
|
class ProviderResponse(BaseModel):
|
|
entity_type: str
|
|
plugin_name: str
|
|
is_active: bool
|