-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.py
More file actions
29 lines (25 loc) · 1.09 KB
/
config.py
File metadata and controls
29 lines (25 loc) · 1.09 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
from typing import Literal, TypedDict
class Config():
"""Configuration for the PFI agent."""
def __init__(
self,
unsafe_dataflow_choice: Literal["UNSAFE_DATAFLOW_YES", "UNSAFE_DATAFLOW_NO", "UNSAFE_DATAFLOW_HUMAN"] = "UNSAFE_DATAFLOW_YES",
log_level: Literal["DEBUG", "NORMAL", "BENCHMARK"] = "BASIC",
policy: str = None,
):
self.unsafe_dataflow_choice = unsafe_dataflow_choice
self.log_level = log_level
self.policy = policy
def set_options(
self,
unsafe_dataflow_choice: Literal["UNSAFE_DATAFLOW_YES", "UNSAFE_DATAFLOW_NO", "UNSAFE_DATAFLOW_HUMAN"] = "UNSAFE_DATAFLOW_YES",
log_level: Literal["DEBUG", "BASIC", "BENCHMARK"] = "BASIC",
policy: str = None,
):
self.unsafe_dataflow_choice = unsafe_dataflow_choice
self.log_level = log_level
self.policy = policy
return self
# Don't instantiate new config object in other files, use this global config object
# You can change the configuration by calling set_options method
config = Config()