manifest/web_app/schemas.py
Laurel Orr defc63bf36 feat: web app for manifest (#46)
Also fixed typing issues in tests
2022-12-30 20:29:29 -07:00

33 lines
721 B
Python

"""Pydantic models."""
from typing import List, Optional, Union
from pydantic import BaseModel
class ManifestCreate(BaseModel):
"""Create manifest Pydantic."""
# Prompt params
prompt: str
n: int = 1
max_tokens: int = 132
temperature: Optional[float] = None
top_k: Optional[int] = None
top_p: Optional[float] = None
# Manifest client params
client_name: str = "openai"
client_connection: Optional[str] = None
engine: str = "text-davinci-003"
cache_name: str = "noop"
cache_connection: Optional[str] = None
class ManifestResponse(BaseModel):
"""Manifest response Pydantic."""
response: Union[str, List[str]]
cached: bool
request_params: dict