Update app.py
Browse files
app.py
CHANGED
@@ -193,13 +193,17 @@ def user3(user_message, history, file_path):
|
|
193 |
combined_message = f"{file_path}\n{user_message}"
|
194 |
return "", history + [[combined_message, None]], file_path
|
195 |
|
196 |
-
|
197 |
SystemMessage(content="You are a helpful assistant."),
|
198 |
HumanMessage(content="Hi AI, how are you today?"),
|
199 |
AIMessage(content="I'm great thank you. How can I help you?")]
|
|
|
|
|
|
|
|
|
200 |
|
201 |
def Chat_Message(history):
|
202 |
-
global
|
203 |
|
204 |
message=HumanMessage(content=history[-1][0])
|
205 |
messages.append(message)
|
@@ -216,7 +220,7 @@ def Chat_Message(history):
|
|
216 |
yield history
|
217 |
|
218 |
def Web_Search(history):
|
219 |
-
global
|
220 |
|
221 |
message=history[-1][0]
|
222 |
|
@@ -249,7 +253,7 @@ def Web_Search(history):
|
|
249 |
yield history
|
250 |
|
251 |
def Chart_Generator(history):
|
252 |
-
global
|
253 |
|
254 |
message = history[-1][0]
|
255 |
if '#chart' in message:
|
@@ -293,7 +297,7 @@ def Chart_Generator(history):
|
|
293 |
yield history
|
294 |
|
295 |
def Link_Scratch(history):
|
296 |
-
global
|
297 |
|
298 |
combined_message = history[-1][0]
|
299 |
|
@@ -353,7 +357,7 @@ def display_file_name(file):
|
|
353 |
raise gr.Error("( Supported File Types Only : PDF , CSV , TXT , DOCX , PPTX , XLSX , JSON , HTML , XML )")
|
354 |
|
355 |
def File_Interact(history,filepath):
|
356 |
-
global
|
357 |
|
358 |
combined_message = history[-1][0]
|
359 |
|
|
|
193 |
combined_message = f"{file_path}\n{user_message}"
|
194 |
return "", history + [[combined_message, None]], file_path
|
195 |
|
196 |
+
messages1 = [
|
197 |
SystemMessage(content="You are a helpful assistant."),
|
198 |
HumanMessage(content="Hi AI, how are you today?"),
|
199 |
AIMessage(content="I'm great thank you. How can I help you?")]
|
200 |
+
messages2 = messages.copy()
|
201 |
+
messages3 = messages.copy()
|
202 |
+
messages4 = messages.copy()
|
203 |
+
messages5 = messages.copy()
|
204 |
|
205 |
def Chat_Message(history):
|
206 |
+
global messages1
|
207 |
|
208 |
message=HumanMessage(content=history[-1][0])
|
209 |
messages.append(message)
|
|
|
220 |
yield history
|
221 |
|
222 |
def Web_Search(history):
|
223 |
+
global messages2
|
224 |
|
225 |
message=history[-1][0]
|
226 |
|
|
|
253 |
yield history
|
254 |
|
255 |
def Chart_Generator(history):
|
256 |
+
global messages3
|
257 |
|
258 |
message = history[-1][0]
|
259 |
if '#chart' in message:
|
|
|
297 |
yield history
|
298 |
|
299 |
def Link_Scratch(history):
|
300 |
+
global messages4
|
301 |
|
302 |
combined_message = history[-1][0]
|
303 |
|
|
|
357 |
raise gr.Error("( Supported File Types Only : PDF , CSV , TXT , DOCX , PPTX , XLSX , JSON , HTML , XML )")
|
358 |
|
359 |
def File_Interact(history,filepath):
|
360 |
+
global messages5
|
361 |
|
362 |
combined_message = history[-1][0]
|
363 |
|