mirror of
https://github.com/HazyResearch/manifest
synced 2024-11-18 09:25:48 +00:00
defc63bf36
Also fixed typing issues in tests
33 lines
721 B
Python
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
|