26 lines
490 B
Python
26 lines
490 B
Python
# Add your utilities or helper functions to this file.
|
|
|
|
import os
|
|
import json
|
|
from dotenv import load_dotenv, find_dotenv
|
|
|
|
|
|
def load_env():
|
|
_ = load_dotenv(find_dotenv())
|
|
|
|
|
|
def save_world(world, filename):
|
|
with open(filename, "w") as f:
|
|
json.dump(world, f)
|
|
|
|
|
|
def load_world(filename):
|
|
with open(filename, "r") as f:
|
|
return json.load(f)
|
|
|
|
|
|
def get_together_api_key():
|
|
load_env()
|
|
together_api_key = os.getenv("TOGETHER_API_KEY")
|
|
return together_api_key
|