File size: 721 Bytes
b247dc4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""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