Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -276,7 +276,7 @@ def query_teapot(prompt, context, user_input, teapot_ai):
|
|
276 |
return response
|
277 |
|
278 |
@log_time
|
279 |
-
def handle_chat(
|
280 |
with st.chat_message("user"):
|
281 |
st.markdown(user_input)
|
282 |
st.session_state.messages.append({"role": "user", "content": user_input})
|
@@ -295,7 +295,7 @@ def handle_chat(prompt, user_input, teapot_ai):
|
|
295 |
|
296 |
context = "\n".join(documents)
|
297 |
prompt = "You are Teapot, an open-source AI assistant optimized for low-end devices, providing short, accurate responses without hallucinating while excelling at information extraction and text summarization."
|
298 |
-
response = query_teapot(prompt, context, user_input, teapot_ai)
|
299 |
|
300 |
with st.chat_message("assistant"):
|
301 |
st.markdown(response)
|
@@ -312,7 +312,7 @@ def main():
|
|
312 |
st.set_page_config(page_title="TeapotAI Chat", page_icon=":robot_face:", layout="wide")
|
313 |
|
314 |
st.sidebar.header("Retrieval Augmented Generation")
|
315 |
-
user_prompt = st.sidebar.text_area("Enter prompt, leave empty for search"
|
316 |
|
317 |
teapot_ai = TeapotAI(documents=[], settings=TeapotAISettings(rag_num_results=3, log_level="debug"))
|
318 |
|
|
|
276 |
return response
|
277 |
|
278 |
@log_time
|
279 |
+
def handle_chat(user_prompt, user_input, teapot_ai):
|
280 |
with st.chat_message("user"):
|
281 |
st.markdown(user_input)
|
282 |
st.session_state.messages.append({"role": "user", "content": user_input})
|
|
|
295 |
|
296 |
context = "\n".join(documents)
|
297 |
prompt = "You are Teapot, an open-source AI assistant optimized for low-end devices, providing short, accurate responses without hallucinating while excelling at information extraction and text summarization."
|
298 |
+
response = query_teapot(prompt, context+user_prompt, user_input, teapot_ai)
|
299 |
|
300 |
with st.chat_message("assistant"):
|
301 |
st.markdown(response)
|
|
|
312 |
st.set_page_config(page_title="TeapotAI Chat", page_icon=":robot_face:", layout="wide")
|
313 |
|
314 |
st.sidebar.header("Retrieval Augmented Generation")
|
315 |
+
user_prompt = st.sidebar.text_area("Enter prompt, leave empty for search")
|
316 |
|
317 |
teapot_ai = TeapotAI(documents=[], settings=TeapotAISettings(rag_num_results=3, log_level="debug"))
|
318 |
|