Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ from langchain.document_loaders import PyPDFLoader, WebBaseLoader
|
|
10 |
from langchain.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoader
|
11 |
from langchain.document_loaders.generic import GenericLoader
|
12 |
from langchain.document_loaders.parsers import OpenAIWhisperParser
|
|
|
13 |
|
14 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
15 |
from langchain.prompts import PromptTemplate
|
@@ -204,7 +205,7 @@ def generate_prompt_with_history_langchain(prompt, history):
|
|
204 |
for human, ai in history:
|
205 |
history_langchain_format.append(HumanMessage(content=human))
|
206 |
history_langchain_format.append(AIMessage(content=ai))
|
207 |
-
history_langchain_format.append(HumanMessage(content=
|
208 |
|
209 |
return history_langchain_format
|
210 |
|
|
|
10 |
from langchain.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoader
|
11 |
from langchain.document_loaders.generic import GenericLoader
|
12 |
from langchain.document_loaders.parsers import OpenAIWhisperParser
|
13 |
+
from langchain.schema import AIMessage, HumanMessage
|
14 |
|
15 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
16 |
from langchain.prompts import PromptTemplate
|
|
|
205 |
for human, ai in history:
|
206 |
history_langchain_format.append(HumanMessage(content=human))
|
207 |
history_langchain_format.append(AIMessage(content=ai))
|
208 |
+
history_langchain_format.append(HumanMessage(content=prompt))
|
209 |
|
210 |
return history_langchain_format
|
211 |
|