Spaces:
Sleeping
Sleeping
Update chat.py
Browse files
chat.py
CHANGED
@@ -146,14 +146,23 @@ def populate_prompt(game_id, splits):
|
|
146 |
|
147 |
|
148 |
def initialize_game(game_id, user_id, user_input):
|
149 |
-
game_details = get_game_details(game_id)
|
150 |
-
whole_prompt = populate_prompt(game_id, game_details["splits"])
|
151 |
-
if debug:
|
152 |
-
|
153 |
-
whole_prompt = whole_prompt.replace("<<USER_INPUT_MSG>>", user_input)
|
154 |
-
if debug:
|
155 |
-
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
llm_prompt_op = call_gpt(whole_prompt)
|
158 |
#print(llm_prompt_op.choices[0]["message"]["content"])
|
159 |
fname="prompt_" + game_id + "_" + user_id + ".txt"
|
|
|
146 |
|
147 |
|
148 |
def initialize_game(game_id, user_id, user_input):
|
149 |
+
# game_details = get_game_details(game_id)
|
150 |
+
# whole_prompt = populate_prompt(game_id, game_details["splits"])
|
151 |
+
# if debug:
|
152 |
+
# print(whole_prompt[:1000])
|
153 |
+
# whole_prompt = whole_prompt.replace("<<USER_INPUT_MSG>>", user_input)
|
154 |
+
# if debug:
|
155 |
+
# print(whole_prompt[:1000])
|
156 |
|
157 |
+
# llm_prompt_op = call_gpt(whole_prompt)
|
158 |
+
# #print(llm_prompt_op.choices[0]["message"]["content"])
|
159 |
+
# fname="prompt_" + game_id + "_" + user_id + ".txt"
|
160 |
+
# save_file(fname, llm_prompt_op.choices[0]["message"]["content"])
|
161 |
+
# return llm_prompt_op.choices[0]["message"]["content"]
|
162 |
+
|
163 |
+
word_doc_contents = read_word_document(file_path + "/" + file_name)
|
164 |
+
whole_prompt = word_doc_contents[0].replace("<<USER_INPUT_MSG>>", user_input)
|
165 |
+
|
166 |
llm_prompt_op = call_gpt(whole_prompt)
|
167 |
#print(llm_prompt_op.choices[0]["message"]["content"])
|
168 |
fname="prompt_" + game_id + "_" + user_id + ".txt"
|