cha0smagick
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,8 @@ MODELS = {
|
|
10 |
"GPT-3 (chat9.yqcloud.top)": "gpt3",
|
11 |
"GPT-4 (you.com)": "gpt4",
|
12 |
"GPT-3.5 (vitalentum.net)": "gpt3_5",
|
|
|
|
|
13 |
}
|
14 |
|
15 |
# Selecci贸n del modelo
|
@@ -32,11 +34,16 @@ if st.button("Enviar") and user_input:
|
|
32 |
response = Client.create_completion(selected_model, user_input)
|
33 |
st.session_state.chat_history.append(("馃", response))
|
34 |
except Exception as e:
|
35 |
-
|
|
|
|
|
|
|
36 |
|
37 |
# Mostrar el historial del chat
|
38 |
for sender, message in st.session_state.chat_history:
|
39 |
if sender == "馃懄":
|
40 |
st.markdown(f"**{sender}**: {message}")
|
|
|
|
|
41 |
else:
|
42 |
-
st.markdown(f"**{sender}**: {message}")
|
|
|
10 |
"GPT-3 (chat9.yqcloud.top)": "gpt3",
|
11 |
"GPT-4 (you.com)": "gpt4",
|
12 |
"GPT-3.5 (vitalentum.net)": "gpt3_5",
|
13 |
+
"Prodia (prodia.com)": "prodia",
|
14 |
+
"Pollinations (pollinations.ai)": "pollinations"
|
15 |
}
|
16 |
|
17 |
# Selecci贸n del modelo
|
|
|
34 |
response = Client.create_completion(selected_model, user_input)
|
35 |
st.session_state.chat_history.append(("馃", response))
|
36 |
except Exception as e:
|
37 |
+
error_message = f"Error: No se pudo obtener respuesta del modelo seleccionado ({selected_model_name})."
|
38 |
+
st.session_state.chat_history.append(("馃", error_message))
|
39 |
+
st.session_state.chat_history.append(("鈿狅笍", f"Detalles del error: {e}"))
|
40 |
+
st.error("Hubo un problema al obtener la respuesta. Por favor, intenta con otro modelo o verifica la conexi贸n.")
|
41 |
|
42 |
# Mostrar el historial del chat
|
43 |
for sender, message in st.session_state.chat_history:
|
44 |
if sender == "馃懄":
|
45 |
st.markdown(f"**{sender}**: {message}")
|
46 |
+
elif sender == "馃":
|
47 |
+
st.markdown(f"**{sender}**: {message}")
|
48 |
else:
|
49 |
+
st.markdown(f":warning: **{sender}**: {message}")
|