Update env & test code

This commit is contained in:
didi 2024-02-28 17:00:51 +08:00
parent 07c360b9c7
commit cfc0cc1fa5
12 changed files with 248 additions and 140 deletions

View file

@ -122,8 +122,12 @@ class Config(CLIParams, YamlModel):
def set_other(self, other: dict):
self.other = other
def get_other(self, key: str):
return self.other.get(key)
def get_other(self, key: str, default_value: str = None):
if default_value is None:
return self.other.get(key)
else:
return self.other.get(key, default_value)
def get_openai_llm(self) -> Optional[LLMConfig]:
"""Get OpenAI LLMConfig by name. If no OpenAI, raise Exception"""