Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,7 @@ st.set_page_config(
|
|
| 17 |
}
|
| 18 |
)
|
| 19 |
PromptPrefix = 'Create a markdown outline and table with appropriate emojis for roleplay rulesets which define the method steps of play for the topics of '
|
|
|
|
| 20 |
|
| 21 |
st.markdown("""### 🗺️🛠️ RolePlayAI
|
| 22 |
- **Embark on an Adventure with RolePlayAI's Game Insights:** Elevate your prowess with an AI companion dedicated to making vocabulary engaging.
|
|
@@ -171,30 +172,25 @@ def search_glossary(query):
|
|
| 171 |
st.markdown(f"#### {category}")
|
| 172 |
st.write(f"- {query}")
|
| 173 |
|
| 174 |
-
query = PromptPrefix + query # Add prompt preface for method step task behavior
|
| 175 |
-
st.write('## ' + query)
|
| 176 |
-
|
| 177 |
all=""
|
|
|
|
|
|
|
|
|
|
| 178 |
st.write('## 🔍 Running with GPT.') # -------------------------------------------------------------------------------------------------
|
| 179 |
-
response = chat_with_model(
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
filename = generate_filename(query + ' --- ' + response, "md")
|
| 183 |
create_file(filename, query, response, should_save)
|
| 184 |
|
| 185 |
-
|
| 186 |
-
#
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
#all = '# Query: ' + query + '# Response: ' + response + '# Response2: ' + response2
|
| 193 |
-
all = '# Query: ' + query + '# Response: ' + response
|
| 194 |
-
|
| 195 |
-
#filename_txt2 = generate_filename(query + ' --- ' + all, "md")
|
| 196 |
-
#create_file(filename_txt2, query, all, should_save)
|
| 197 |
|
|
|
|
|
|
|
|
|
|
| 198 |
SpeechSynthesis(all)
|
| 199 |
return all
|
| 200 |
|
|
|
|
| 17 |
}
|
| 18 |
)
|
| 19 |
PromptPrefix = 'Create a markdown outline and table with appropriate emojis for roleplay rulesets which define the method steps of play for the topics of '
|
| 20 |
+
PromptPrefix2 = 'Create a streamlit python user interface full code listing and app with appropriate emojis for roleplay rulesets which define the method steps of play for the topics of '
|
| 21 |
|
| 22 |
st.markdown("""### 🗺️🛠️ RolePlayAI
|
| 23 |
- **Embark on an Adventure with RolePlayAI's Game Insights:** Elevate your prowess with an AI companion dedicated to making vocabulary engaging.
|
|
|
|
| 172 |
st.markdown(f"#### {category}")
|
| 173 |
st.write(f"- {query}")
|
| 174 |
|
|
|
|
|
|
|
|
|
|
| 175 |
all=""
|
| 176 |
+
|
| 177 |
+
query2 = PromptPrefix + query # Add prompt preface for method step task behavior
|
| 178 |
+
# st.write('## ' + query2)
|
| 179 |
st.write('## 🔍 Running with GPT.') # -------------------------------------------------------------------------------------------------
|
| 180 |
+
response = chat_with_model(query2)
|
| 181 |
+
filename = generate_filename(query2 + ' --- ' + response, "md")
|
|
|
|
|
|
|
| 182 |
create_file(filename, query, response, should_save)
|
| 183 |
|
| 184 |
+
query3 = PromptPrefix2 + query # Add prompt preface for coding task behavior
|
| 185 |
+
# st.write('## ' + query3)
|
| 186 |
+
st.write('## 🔍 Coding with GPT.') # -------------------------------------------------------------------------------------------------
|
| 187 |
+
response2 = chat_with_model(query3)
|
| 188 |
+
filename_txt = generate_filename(query + ' --- ' + response2, "py")
|
| 189 |
+
create_file(filename_txt, query, response2, should_save)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
|
| 191 |
+
all = '# Query: ' + query + '# Response: ' + response + '# Response2: ' + response2
|
| 192 |
+
filename_txt2 = generate_filename(query + ' --- ' + all, "md")
|
| 193 |
+
create_file(filename_txt2, query, all, should_save)
|
| 194 |
SpeechSynthesis(all)
|
| 195 |
return all
|
| 196 |
|