mirror of https://github.com/HazyResearch/manifest
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
721 B
Python
33 lines
721 B
Python
2 years ago
|
"""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
|