Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -37,13 +37,15 @@ link_dict = {
|
|
37 |
message_history = [{"text":"Let's find out the best task for your use case! Tell me about your use case :)", "is_user":False}]
|
38 |
|
39 |
input = st.text_input("Ask me π€")
|
|
|
|
|
40 |
for msg in message_history:
|
41 |
message(msg["text"], is_user = msg["is_user"]) # display all the previous message
|
42 |
|
43 |
-
message_history.append({"text":input, "is_user" : True})
|
44 |
|
45 |
|
46 |
-
|
|
|
47 |
|
48 |
data, resp = query(
|
49 |
{
|
@@ -63,7 +65,6 @@ if resp.status_code == 200:
|
|
63 |
url = link_dict[key]
|
64 |
response_templates = [f"I think that {model_answer} is the best task for this π€© Check out the page ππΌ {url}", f"I think you should use {model_answer} πͺ Check it out here ππΌ {url}", f"I think {model_answer} should work for you π€ Check out the page ππΌ {url}"]
|
65 |
|
66 |
-
|
67 |
bot_answer = random.choice(response_templates)
|
68 |
message_history.append({"text":bot_answer, "is_user" : False})
|
69 |
else:
|
|
|
37 |
message_history = [{"text":"Let's find out the best task for your use case! Tell me about your use case :)", "is_user":False}]
|
38 |
|
39 |
input = st.text_input("Ask me π€")
|
40 |
+
message_history.append({"text":input, "is_user" : True})
|
41 |
+
|
42 |
for msg in message_history:
|
43 |
message(msg["text"], is_user = msg["is_user"]) # display all the previous message
|
44 |
|
|
|
45 |
|
46 |
|
47 |
+
|
48 |
+
#placeholder = st.empty() # placeholder for latest message
|
49 |
|
50 |
data, resp = query(
|
51 |
{
|
|
|
65 |
url = link_dict[key]
|
66 |
response_templates = [f"I think that {model_answer} is the best task for this π€© Check out the page ππΌ {url}", f"I think you should use {model_answer} πͺ Check it out here ππΌ {url}", f"I think {model_answer} should work for you π€ Check out the page ππΌ {url}"]
|
67 |
|
|
|
68 |
bot_answer = random.choice(response_templates)
|
69 |
message_history.append({"text":bot_answer, "is_user" : False})
|
70 |
else:
|