MCPcopy
hub / github.com/stanford-oval/storm / load_api_key

Function load_api_key

knowledge_storm/utils.py:41–53  ·  view source on GitHub ↗
(toml_file_path)

Source from the content-addressed store, hash-verified

39
40
41def 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
56def makeStringRed(message):

Callers 11

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected