Blame view

scripts/evaluation/eval_framework/api_models.py 555 Bytes
c81b0fc1   tangwang   scripts/evaluatio...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  """Pydantic request bodies for the evaluation FastAPI app."""
  
  from __future__ import annotations
  
  from typing import List, Optional
  
  from pydantic import BaseModel, Field
  
  
  class SearchEvalRequest(BaseModel):
      query: str
      top_k: int = Field(default=100, ge=1, le=500)
      auto_annotate: bool = False
      language: str = "en"
  
  
  class BatchEvalRequest(BaseModel):
      queries: Optional[List[str]] = None
      top_k: int = Field(default=100, ge=1, le=500)
      auto_annotate: bool = False
      language: str = "en"
      force_refresh_labels: bool = False