mirror of
https://github.com/james-m-jordan/morphik-core.git
synced 2025-05-09 19:32:38 +00:00

* debug mps not supported * further debug (i think i lost some braincells) * fix mps bug and resolve dependency issues * remove libmagic dependence * add colpali embedding model * multi-vector store works - verified with testing * add integration testing * support text embedding in colpali * complete colplai integration and testing * formatting + some PR comments * remove experimental files * resolve PR comments
30 lines
883 B
Python
30 lines
883 B
Python
from typing import Dict, Any, Optional, List
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class RetrieveRequest(BaseModel):
|
|
"""Base retrieve request model"""
|
|
|
|
query: str = Field(..., min_length=1)
|
|
filters: Optional[Dict[str, Any]] = None
|
|
k: int = Field(default=4, gt=0)
|
|
min_score: float = Field(default=0.0)
|
|
use_reranking: Optional[bool] = None # If None, use default from config
|
|
use_colpali: Optional[bool] = None
|
|
|
|
|
|
class CompletionQueryRequest(RetrieveRequest):
|
|
"""Request model for completion generation"""
|
|
|
|
max_tokens: Optional[int] = None
|
|
temperature: Optional[float] = None
|
|
|
|
|
|
class IngestTextRequest(BaseModel):
|
|
"""Request model for ingesting text content"""
|
|
|
|
content: str
|
|
metadata: Dict[str, Any] = Field(default_factory=dict)
|
|
rules: List[Dict[str, Any]] = Field(default_factory=list)
|
|
use_colpali: Optional[bool] = None
|