Update app.py
Browse files
app.py
CHANGED
@@ -62,14 +62,12 @@ with generative:
|
|
62 |
|
63 |
with chat:
|
64 |
st.title("AI Chat")
|
|
|
65 |
prompt_gpt = st.chat_input("Ask something")
|
66 |
if prompt_gpt:
|
67 |
-
user_msg =
|
68 |
-
user_msg.write(prompt_gpt)
|
69 |
try:
|
70 |
-
resp = Client.create_completion("
|
71 |
-
message_out =
|
72 |
-
message_out.write(resp)
|
73 |
except Exception as e:
|
74 |
-
message_out =
|
75 |
-
message_out.write(e)
|
|
|
62 |
|
63 |
with chat:
|
64 |
st.title("AI Chat")
|
65 |
+
messages = st.container(height="600")
|
66 |
prompt_gpt = st.chat_input("Ask something")
|
67 |
if prompt_gpt:
|
68 |
+
user_msg = messages.chat_message("user").write(prompt_gpt)
|
|
|
69 |
try:
|
70 |
+
resp = Client.create_completion("gpt3", prompt)
|
71 |
+
message_out = messages.chat_message("assistant").write(resp)
|
|
|
72 |
except Exception as e:
|
73 |
+
message_out = messages.chat_message("assistant").write(e)
|
|