alexkueck commited on
Commit
1b7141c
1 Parent(s): 555c5b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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=message))
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