File size: 726 Bytes
1b7e88c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import os
from distutils.util import strtobool


class EnvVar(object):
    APP_NAME = "OmAgent"

    IS_DEBUG = strtobool(os.environ.get("IS_DEBUG", "false"))

    STOP_AFTER_DELAY = int(
        os.environ.get("STOP_AFTER_DELAY", 20)
    )  # LLM will stop when the time from the first attempt >= limit
    STOP_AFTER_ATTEMPT = int(os.environ.get("STOP_AFTER_ATTEMPT", 5))  # LLM retry times
    LLM_CACHE_NUM = int(os.environ.get("LLM_CACHE_NUM", 500))  # LLM result cache number

    MAX_NODE_RETRY = int(os.environ.get("MAX_NODE_RETRY", 3))

    @classmethod
    def update(cls, key, value):
        setattr(cls, key, value)

    @classmethod
    def get(cls, key, default=None):
        return getattr(cls, key, default)