Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -29,17 +29,17 @@ Previous Conversations:
|
|
29 |
Document Content Provided:
|
30 |
{provided_docs}
|
31 |
|
32 |
-
|
33 |
{extracted_text}
|
34 |
|
35 |
-
NOTE: If the human asks Question about the url or Given url ,
|
36 |
|
37 |
Human: {human_input}
|
38 |
Chatbot: """
|
39 |
|
40 |
|
41 |
prompt = PromptTemplate(
|
42 |
-
input_variables=["chat_history", "
|
43 |
template=template
|
44 |
)
|
45 |
|
@@ -54,7 +54,7 @@ llm_chain = LLMChain(
|
|
54 |
previous_response = ""
|
55 |
provided_docs = ""
|
56 |
def conversational_chat(query):
|
57 |
-
global previous_response, provided_docs
|
58 |
previous_response = "".join([f"Human: {i[0]}\nChatbot: {i[1]}" for i in st.session_state['history'] if i is not None])
|
59 |
provided_docs = "".join([doc for doc in st.session_state["docs"] if doc is not None])
|
60 |
extracted_text = "".join([text for text in st.session_state["extracted_text"] if text is not None])
|
|
|
29 |
Document Content Provided:
|
30 |
{provided_docs}
|
31 |
|
32 |
+
URL Text:
|
33 |
{extracted_text}
|
34 |
|
35 |
+
NOTE: If the human asks Question about the url or Given url related question,please use the information from the 'URL Text' to provide detailed answers.
|
36 |
|
37 |
Human: {human_input}
|
38 |
Chatbot: """
|
39 |
|
40 |
|
41 |
prompt = PromptTemplate(
|
42 |
+
input_variables=["chat_history", "provided_docs", "extracted_text", "human_input"],
|
43 |
template=template
|
44 |
)
|
45 |
|
|
|
54 |
previous_response = ""
|
55 |
provided_docs = ""
|
56 |
def conversational_chat(query):
|
57 |
+
global previous_response, provided_docs
|
58 |
previous_response = "".join([f"Human: {i[0]}\nChatbot: {i[1]}" for i in st.session_state['history'] if i is not None])
|
59 |
provided_docs = "".join([doc for doc in st.session_state["docs"] if doc is not None])
|
60 |
extracted_text = "".join([text for text in st.session_state["extracted_text"] if text is not None])
|