File size: 689 Bytes
03037be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from pydantic import BaseModel
from typing import Optional, List

class SearchRequest (BaseModel):
    query: str
    top_k: Optional[int] = 10
    
class PaperResult (BaseModel):
    id:str
    title: str
    authors: str
    abstract: str
    year :int
    field :str
    url: str
    score: float
 
 
class SearchResponse (BaseModel):
    query: str
    results: List[PaperResult]
    total:int
    latency_ms: float
    
class PaperDetail(BaseModel):
    id:str
    title: str
    authors: str
    abstract: str
    year:int
    field :str
    url: str
    
class HealthResponse(BaseModel):
    status: str
    paper_indexed: int
    index_loading:bool
    embedding_loading: bool