Initialize Monorepo
This commit is contained in:
commit
f80792d739
106 files changed
+17076
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,38 @@
|
||||
|
||||
"""Pydantic models for vector search requests and responses."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any, Dict, List, Optional
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class VectorSearchRequest(BaseModel):
|
||||
"""Input payload for a vector search."""
|
||||
|
||||
interface_name: str = Field(..., description="Name of the embedding interface")
|
||||
model_name: str = Field(..., description="Name of the embedding model")
|
||||
search_string: str = Field(..., description="The natural language query to embed and search for")
|
||||
filters: Optional[Dict[str, Any]] = Field(
|
||||
default=None,
|
||||
description="Optional key/value filters applied server‑side",
|
||||
)
|
||||
top_k: int = Field(10, ge=1, le=100, description="Number of matches to return")
|
||||
embedding_column: str = Field(
|
||||
"embedding",
|
||||
description="Name of the embedding column in the database table",
|
||||
)
|
||||
|
||||
|
||||
class Chunklet(BaseModel):
|
||||
"""Single result row returned by the database RPC."""
|
||||
|
||||
chunk: Optional[str] = None
|
||||
file_id: Optional[str | int] = None
|
||||
|
||||
|
||||
class VectorSearchResponse(BaseModel):
|
||||
"""Output payload wrapping vector‑search results."""
|
||||
|
||||
total: int
|
||||
results: List[Chunklet]
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
"""Data models for t‑SNE exports.
|
||||
|
||||
These models are used by *vecview* and any endpoint that needs to return or
|
||||
validate t‑SNE projection data.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import List, Optional
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class TSNEPoint(BaseModel):
|
||||
"""A single point in a 3‑D t‑SNE projection."""
|
||||
|
||||
x: float
|
||||
y: float
|
||||
z: float
|
||||
file_id: str
|
||||
chunk: str
|
||||
cluster: Optional[str] = None
|
||||
hover_text: Optional[str] = None
|
||||
|
||||
|
||||
class TSNEData(BaseModel):
|
||||
"""Container returned to callers requesting a t‑SNE view."""
|
||||
|
||||
course_id: Optional[int] = None
|
||||
total: int
|
||||
points: List[TSNEPoint]
|
||||
Reference in new issue
Block a user