Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ class AdvancedPdfChatbot:
|
|
19 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
20 |
self.embeddings = OpenAIEmbeddings()
|
21 |
self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
|
22 |
-
self.llm = ChatOpenAI(temperature=0.5,model_name='gpt-4o')
|
23 |
|
24 |
self.memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
|
25 |
self.qa_chain = None
|
@@ -61,6 +61,8 @@ User: "Where can I find the definition of 'symbolic interactionism' in the docum
|
|
61 |
Response: "The definition of 'symbolic interactionism' appears on page 12 under the subheading 'Key Theoretical Concepts'."
|
62 |
User: "Explain the concept of 'cognitive dissonance' as it is presented in the document."
|
63 |
Response: "In the document, 'cognitive dissonance' is defined as [definition from the file]. It appears in the context of [brief explanation] and can be found on page 15 under the section 'Theoretical Foundations'."
|
|
|
|
|
64 |
**End of Prompt**
|
65 |
Context: {context}
|
66 |
Question: {question}
|
|
|
19 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
20 |
self.embeddings = OpenAIEmbeddings()
|
21 |
self.text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
|
22 |
+
self.llm = ChatOpenAI(temperature=0.5,model_name='gpt-4o',top_p=0.9)
|
23 |
|
24 |
self.memory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)
|
25 |
self.qa_chain = None
|
|
|
61 |
Response: "The definition of 'symbolic interactionism' appears on page 12 under the subheading 'Key Theoretical Concepts'."
|
62 |
User: "Explain the concept of 'cognitive dissonance' as it is presented in the document."
|
63 |
Response: "In the document, 'cognitive dissonance' is defined as [definition from the file]. It appears in the context of [brief explanation] and can be found on page 15 under the section 'Theoretical Foundations'."
|
64 |
+
|
65 |
+
NOTE : DESCRIBE/SUMMARY should always return the overall summary of the documents in well documented and descriptions of the topic in great details.
|
66 |
**End of Prompt**
|
67 |
Context: {context}
|
68 |
Question: {question}
|