You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
865 B
32 lines
865 B
"""
|
|
models/requests.py — Pydantic request schemas for the RAG API.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class SearchRequest(BaseModel):
|
|
query: str = Field(..., min_length=1, max_length=2000)
|
|
limit: int = Field(default=10, ge=1, le=50)
|
|
threshold: float = Field(default=0.65, ge=0.0, le=1.0)
|
|
tags: Optional[list[str]] = None
|
|
hybrid: bool = True
|
|
|
|
|
|
class ChatRequest(BaseModel):
|
|
message: str = Field(..., min_length=1, max_length=4000)
|
|
conversation_id: Optional[str] = None
|
|
context_limit: int = Field(default=5, ge=1, le=20)
|
|
stream: bool = True
|
|
|
|
|
|
class IndexRequest(BaseModel):
|
|
path: str = Field(..., description='Relative path of file within the vault')
|
|
|
|
|
|
class ReindexRequest(BaseModel):
|
|
force: bool = False # If True, reindex even unchanged files
|