Lasdw commited on
Commit
818fc79
·
1 Parent(s): 1e037ec

updated gradio response

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -93,15 +93,13 @@ def chat_with_agent(question: str, file_uploads, history: list) -> tuple:
93
  else:
94
  formatted_response = response
95
 
96
- # Add question and response to history in the correct format
97
- history.append({"role": "user", "content": question})
98
- history.append({"role": "assistant", "content": formatted_response})
99
 
100
  return history, ""
101
  except Exception as e:
102
  error_message = f"Error: {str(e)}"
103
- history.append({"role": "user", "content": question})
104
- history.append({"role": "assistant", "content": error_message})
105
  return history, ""
106
 
107
  def clear_chat():
@@ -261,15 +259,15 @@ with gr.Blocks(title="TurboNerd Agent🤓") as demo:
261
 
262
  **Research & Analysis:**
263
  - "Find the first name of the only Malko Competition recipient from the 20th Century (after 1977) whose nationality on record is a country that no longer exists. Cross-reference this information with their Wikipedia page and any recent news articles."
264
- - "Analyze this image of a mathematical equation, explain the concepts involved, and find similar problems from textbooks or academic papers."
265
 
266
  **Multi-Modal Analysis:**
267
- - "I have an interview recording and a transcript. Compare the audio transcription with the provided transcript, identify any discrepancies, and summarize the key points discussed."
268
- - "This image shows a historical document. Extract the text, identify the time period, and find related historical events from that era."
269
 
270
  **Code & Data Processing:**
271
- - "I have a Python script and an Excel file with data. Analyze the code's functionality, identify potential optimizations, and suggest improvements based on the data patterns."
272
- - "This code contains a bug. Debug it, explain the issue, and propose a solution. Then test the solution with the provided test cases."
273
 
274
  The agent can handle multiple file uploads and combine information from various sources to provide comprehensive answers. Try asking complex questions that require multiple tools working together!
275
  """)
 
93
  else:
94
  formatted_response = response
95
 
96
+ # Add question and response to history in the correct format (as tuples)
97
+ history.append((question, formatted_response))
 
98
 
99
  return history, ""
100
  except Exception as e:
101
  error_message = f"Error: {str(e)}"
102
+ history.append((question, error_message))
 
103
  return history, ""
104
 
105
  def clear_chat():
 
259
 
260
  **Research & Analysis:**
261
  - "Find the first name of the only Malko Competition recipient from the 20th Century (after 1977) whose nationality on record is a country that no longer exists. Cross-reference this information with their Wikipedia page and any recent news articles."
262
+ - "Analyze this image of a mathematical equation, and find an academic papers that use this equation."
263
 
264
  **Multi-Modal Analysis:**
265
+ - "I have an interview recording and a transcript. Compare the audio transcription with the provided transcript, identify any discrepancies."
266
+ - "This image shows a historical document. Find me the historical events from that era."
267
 
268
  **Code & Data Processing:**
269
+ - "I have a Python script and an Excel file with data. Analyze the code's functionality and suggest improvements based on the data patterns."
270
+ - "This code contains a bug. Debug it, explain the issue, and propose a solution."
271
 
272
  The agent can handle multiple file uploads and combine information from various sources to provide comprehensive answers. Try asking complex questions that require multiple tools working together!
273
  """)