Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,15 @@
|
|
|
|
1 |
import streamlit as st
|
2 |
-
from
|
3 |
from streamlit_chat import message
|
4 |
|
5 |
|
6 |
def api_calling(question):
|
7 |
-
model = Cohere(cohere_api_key='
|
8 |
response = model.invoke(question)
|
9 |
return response
|
10 |
|
11 |
-
st.title("CHATBOT
|
12 |
if 'user_input' not in st.session_state:
|
13 |
st.session_state['user_input'] = []
|
14 |
|
@@ -36,7 +37,8 @@ if st.session_state['user_input']:
|
|
36 |
# This function displays user input
|
37 |
message(st.session_state["user_input"][i],
|
38 |
key=str(i),avatar_style="icons")
|
39 |
-
|
40 |
-
message(st.session_state['openai_response'][i],
|
41 |
avatar_style="miniavs",is_user=True,
|
42 |
key=str(i) + 'data_by_user')
|
|
|
|
|
|
1 |
+
|
2 |
import streamlit as st
|
3 |
+
from langchain.llms import Cohere
|
4 |
from streamlit_chat import message
|
5 |
|
6 |
|
7 |
def api_calling(question):
|
8 |
+
model = Cohere(cohere_api_key='AwUrUmbrQPC8ROSvqGdSxlYM8TZjgfOYGxNmGaci')
|
9 |
response = model.invoke(question)
|
10 |
return response
|
11 |
|
12 |
+
st.title("COHERE CHATBOT BADR")
|
13 |
if 'user_input' not in st.session_state:
|
14 |
st.session_state['user_input'] = []
|
15 |
|
|
|
37 |
# This function displays user input
|
38 |
message(st.session_state["user_input"][i],
|
39 |
key=str(i),avatar_style="icons")
|
40 |
+
message(st.session_state['cohere_response'][i],
|
|
|
41 |
avatar_style="miniavs",is_user=True,
|
42 |
key=str(i) + 'data_by_user')
|
43 |
+
`
|
44 |
+
`
|