-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconfig.py
More file actions
44 lines (37 loc) · 1.07 KB
/
config.py
File metadata and controls
44 lines (37 loc) · 1.07 KB
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
34
35
36
37
38
39
40
41
42
43
44
from typing import Any, Dict
class API:
url: str
key: str
model: str
temperature: float
top_p: float
max_tokens: int
frequency_penalty: float
presence_penalty: float
n: int
stream: bool
def __init__(self, api: Dict[str, Any]):
self.url = api['url']
self.key = api['key']
self.model = api['model']
self.temperature = api['temperature']
self.top_p = api['top_p']
self.max_tokens = api['max_tokens']
self.frequency_penalty = api['frequency_penalty']
self.presence_penalty = api['presence_penalty']
self.n = api['n']
self.stream = api['stream']
class Paths:
projects: str
logs: str
def __init__(self, paths: Dict[str, Any]):
self.projects = paths['projects']
self.logs = paths['logs']
class Config:
api: API
paths: Paths
system_prompt: str
def __init__(self, config: Dict[str, Any]):
self.api = API(config['api'])
self.paths = Paths(config['paths'])
self.system_prompt = config['system_prompt']