aakash0563 commited on
Commit
c68ae28
·
1 Parent(s): 33adf11

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -38,7 +38,7 @@ prompt = ZeroShotAgent.create_prompt(
38
  suffix=suffix,
39
  input_variables=["input", "chat_history", "agent_scratchpad"],
40
  )
41
- memory = ConversationBufferMemory(memory_key="chat_history")
42
 
43
  llm_chain = LLMChain(llm=llm, prompt=prompt)
44
  agent = ZeroShotAgent(llm_chain=llm_chain, tools=tools, verbose=True)
@@ -54,7 +54,7 @@ agent_chain = AgentExecutor.from_agent_and_tools(
54
  # )
55
  def chat(prompt):
56
  res = agent_chain.run(input=prompt)
57
- return res,agent_chain.memory.chat_memory.messages
58
 
59
  iface = gr.Interface(
60
  fn=chat,
 
38
  suffix=suffix,
39
  input_variables=["input", "chat_history", "agent_scratchpad"],
40
  )
41
+ memory = ConversationBufferMemory(memory_key="chat_history",return_messages=True)
42
 
43
  llm_chain = LLMChain(llm=llm, prompt=prompt)
44
  agent = ZeroShotAgent(llm_chain=llm_chain, tools=tools, verbose=True)
 
54
  # )
55
  def chat(prompt):
56
  res = agent_chain.run(input=prompt)
57
+ return res,memory.load_memory_variables({})
58
 
59
  iface = gr.Interface(
60
  fn=chat,