Skip to content

Commit

Permalink
Removed obsolete code that checks for cfg_path in config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiannis128 committed Feb 3, 2024
1 parent 092e9cc commit 1be8e39
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions esbmc_ai/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
loading_hints: bool = False
allow_successful: bool = False

cfg_path: str = "./config.json"
cfg_path: str


class AIAgentConversation(NamedTuple):
Expand Down Expand Up @@ -238,30 +238,17 @@ def get_env_vars() -> None:
# Check if all the values are set, else error.
for key in keys:
if key not in values:
print(f"Error: ${key} not in environment.")
print(f"Error: No ${key} in environment.")
sys.exit(1)

global api_keys

api_keys = APIKeyCollection(
openai=str(os.getenv("OPENAI_API_KEY")),
huggingface=str(os.getenv("HUGGINGFACE_API_KEY")),
)

global cfg_path
_cfg_path = os.getenv("ESBMC_AI_CFG_PATH")
if _cfg_path != None:
_cfg_path = os.path.expanduser(_cfg_path)
_cfg_path = os.path.expandvars(_cfg_path)
if os.path.exists(_cfg_path):
cfg_path = str(_cfg_path)
else:
print(f"Error: Invalid ESBMC_AI_CFG_PATH value: {_cfg_path}")
sys.exit(4)
else:
print(
f"Warning: ESBMC_AI_CFG_PATH not found in system environment variables... Defaulting to {cfg_path}"
)
cfg_path = str(os.getenv("ESBMC_AI_CFG_PATH"))


def _load_ai_data(config: dict) -> None:
Expand Down

0 comments on commit 1be8e39

Please sign in to comment.