mou3az commited on
Commit
c737e57
1 Parent(s): 7908576

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -45,8 +45,8 @@ def handle_message(message: str, mode: str):
45
  return "Select a valid mode."
46
 
47
  def chat_message(message: str):
48
-
49
  global messages
 
50
  prompt = HumanMessage(content=message)
51
  messages.append(prompt)
52
 
@@ -59,8 +59,8 @@ def chat_message(message: str):
59
  return f"IT-Assistant: {response.content}"
60
 
61
  def web_search(message: str):
62
-
63
  global messages
 
64
  similar_docs = db.similarity_search(message, k=3)
65
 
66
  if similar_docs:
@@ -89,6 +89,7 @@ def web_search(message: str):
89
  return f"IT-Assistant: {response.content}"
90
 
91
  def chart_generator(message: str):
 
92
 
93
  chart_url = f"https://quickchart.io/natural/{message}"
94
  response = requests.get(chart_url)
 
45
  return "Select a valid mode."
46
 
47
  def chat_message(message: str):
 
48
  global messages
49
+
50
  prompt = HumanMessage(content=message)
51
  messages.append(prompt)
52
 
 
59
  return f"IT-Assistant: {response.content}"
60
 
61
  def web_search(message: str):
 
62
  global messages
63
+
64
  similar_docs = db.similarity_search(message, k=3)
65
 
66
  if similar_docs:
 
89
  return f"IT-Assistant: {response.content}"
90
 
91
  def chart_generator(message: str):
92
+ global messages
93
 
94
  chart_url = f"https://quickchart.io/natural/{message}"
95
  response = requests.get(chart_url)