chrisjcc commited on
Commit
e7a5a0d
·
verified ·
1 Parent(s): 8d17793

Define load world function

Browse files
Files changed (1) hide show
  1. helper.py +7 -2
helper.py CHANGED
@@ -1,7 +1,7 @@
1
  # Add your utilities or helper functions to this file.
2
  import os
3
- from dotenv import load_dotenv, find_dotenv
4
  import json
 
5
  from together import Together
6
 
7
  def load_env():
@@ -17,4 +17,9 @@ def save_world(world, filename):
17
 
18
  def get_together_api_key():
19
  load_env()
20
- return os.getenv("TOGETHER_API_KEY")
 
 
 
 
 
 
1
  # Add your utilities or helper functions to this file.
2
  import os
 
3
  import json
4
+ from dotenv import load_dotenv, find_dotenv
5
  from together import Together
6
 
7
  def load_env():
 
17
 
18
  def get_together_api_key():
19
  load_env()
20
+ return os.getenv("TOGETHER_API_KEY")
21
+
22
+
23
+ def load_world(filename):
24
+ with open(filename, 'r') as f:
25
+ return json.load(f)