Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,9 @@ from llama_index.llms import OpenAI
|
|
4 |
import openai
|
5 |
from llama_index import SimpleDirectoryReader
|
6 |
|
7 |
-
st.set_page_config(page_title="
|
8 |
-
openai.api_key = "
|
9 |
-
st.title("
|
10 |
st.info("Check out the full tutorial to build this app in our [blog post](https://blog.streamlit.io/build-a-chatbot-with-custom-data-sources-powered-by-llamaindex/)", icon="π")
|
11 |
|
12 |
if "messages" not in st.session_state.keys(): # Initialize the chat messages history
|
@@ -24,7 +24,7 @@ def load_data():
|
|
24 |
return index
|
25 |
|
26 |
index = load_data()
|
27 |
-
#
|
28 |
chat_engine = index.as_chat_engine(chat_mode="condense_question", verbose=True)
|
29 |
|
30 |
if prompt := st.chat_input("Your question"): # Prompt for user input and save to chat history
|
|
|
4 |
import openai
|
5 |
from llama_index import SimpleDirectoryReader
|
6 |
|
7 |
+
st.set_page_config(page_title="You & AI - Parks", page_icon="π", layout="centered", initial_sidebar_state="auto", menu_items=None)
|
8 |
+
openai.api_key = "1234"
|
9 |
+
st.title("Personalize Your Parks Experience π¬ππ€")
|
10 |
st.info("Check out the full tutorial to build this app in our [blog post](https://blog.streamlit.io/build-a-chatbot-with-custom-data-sources-powered-by-llamaindex/)", icon="π")
|
11 |
|
12 |
if "messages" not in st.session_state.keys(): # Initialize the chat messages history
|
|
|
24 |
return index
|
25 |
|
26 |
index = load_data()
|
27 |
+
#chat_engine = index.as_chat_engine(chat_mode="condense_question", verbose=True, system_prompt="You are an expert on the Streamlit Python library and your job is to answer technical questions. Assume that all questions are related to the Streamlit Python library. Keep your answers technical and based on facts β do not hallucinate features.")
|
28 |
chat_engine = index.as_chat_engine(chat_mode="condense_question", verbose=True)
|
29 |
|
30 |
if prompt := st.chat_input("Your question"): # Prompt for user input and save to chat history
|