(toml_file_path)
| 39 | |
| 40 | |
| 41 | def load_api_key(toml_file_path): |
| 42 | try: |
| 43 | with open(toml_file_path, "r") as file: |
| 44 | data = toml.load(file) |
| 45 | except FileNotFoundError: |
| 46 | print(f"File not found: {toml_file_path}", file=sys.stderr) |
| 47 | return |
| 48 | except toml.TomlDecodeError: |
| 49 | print(f"Error decoding TOML file: {toml_file_path}", file=sys.stderr) |
| 50 | return |
| 51 | # Set environment variables |
| 52 | for key, value in data.items(): |
| 53 | os.environ[key] = str(value) |
| 54 | |
| 55 | |
| 56 | def makeStringRed(message): |