Wajahat698 commited on
Commit
6ec2c87
·
verified ·
1 Parent(s): 80a2e90

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1845,13 +1845,12 @@ def chatbot_response(message, history):
1845
  # Save the interaction context
1846
  chat_history.extend(
1847
  [
1848
- {"role": "user", "content": message},
1849
- {"role": "assistant", "content": response},
1850
  ]
1851
  )
1852
 
1853
  return response
1854
- return response
1855
  except Exception as e:
1856
  logger.error(f"Error generating chatbot response: {e}")
1857
  return "Error occurred during response generation"
 
1845
  # Save the interaction context
1846
  chat_history.extend(
1847
  [
1848
+ HumanMessage(content=message),
1849
+ AIMessage(content=response),
1850
  ]
1851
  )
1852
 
1853
  return response
 
1854
  except Exception as e:
1855
  logger.error(f"Error generating chatbot response: {e}")
1856
  return "Error occurred during response generation"