Lasdw commited on
Commit
f4b3c44
·
1 Parent(s): 00c7ce4

updated prompt

Browse files
Files changed (2) hide show
  1. agent.py +4 -4
  2. app.py +7 -3
agent.py CHANGED
@@ -64,8 +64,8 @@ Specifically, this json should have an `action` key (with the name of the tool t
64
  The only values that should be in the "action" field are:
65
  python_code: Execute Python code. Use this tool to calculate math problems. make sure to use prints to be able to view the final result. args: {"code": {"type": "string"}}
66
  wikipedia_search: Search Wikipedia for information about a specific topic. Optionally specify the number of results to return, args: {"query": {"type": "string"}, "num_results": {"type": "integer", "optional": true}}
67
- tavily_search: Search the web using Tavily for more comprehensive results. Optionally specify search_depth as 'basic' or 'comprehensive', args: {"query": {"type": "string"}, "search_depth": {"type": "string", "optional": true}}
68
- arxiv_search: Search ArXiv for scientific papers. Optionally specify max_results to control the number of papers returned, args: {"query": {"type": "string"}, "max_results": {"type": "integer", "optional": true}}
69
  webpage_scrape: Scrape a specific webpage, args: {"url": {"type": "string"}}
70
  supabase_operation: Perform database operations, args: {"operation_type": {"type": "string"}, "table": {"type": "string"}, "data": {"type": "object", "optional": true}, "filters": {"type": "object", "optional": true}}
71
  excel_to_text: Convert Excel to Markdown table with attachment, args: {"excel_path": {"type": "string"}, "file_content": {"type": "string"}, "sheet_name": {"type": "string", "optional": true}}
@@ -102,7 +102,7 @@ or
102
 
103
  ALWAYS follow this specific format for your responses. Your entire response will follow this pattern:
104
  Question: [the user's question]
105
- Thought: [your reasoning about what to do next, break it down into smaller steps]
106
  Action:
107
  ```json
108
  {
@@ -139,7 +139,7 @@ Now begin! Reminder to ALWAYS use the exact characters `Final Answer:` when you
139
  # Generate the chat interface, including the tools
140
  llm = ChatOpenAI(
141
  model="gpt-4o-mini",
142
- temperature=0
143
  )
144
 
145
  chat = llm
 
64
  The only values that should be in the "action" field are:
65
  python_code: Execute Python code. Use this tool to calculate math problems. make sure to use prints to be able to view the final result. args: {"code": {"type": "string"}}
66
  wikipedia_search: Search Wikipedia for information about a specific topic. Optionally specify the number of results to return, args: {"query": {"type": "string"}, "num_results": {"type": "integer", "optional": true}}
67
+ tavily_search: Search the web using Tavily. Optionally specify search_depth as 'basic' or 'comprehensive', args: {"query": {"type": "string"}, "search_depth": {"type": "string", "optional": true}}
68
+ arxiv_search: Search ArXiv for publications. Optionally specify max_results to control the number of papers returned, args: {"query": {"type": "string"}, "max_results": {"type": "integer", "optional": true}}
69
  webpage_scrape: Scrape a specific webpage, args: {"url": {"type": "string"}}
70
  supabase_operation: Perform database operations, args: {"operation_type": {"type": "string"}, "table": {"type": "string"}, "data": {"type": "object", "optional": true}, "filters": {"type": "object", "optional": true}}
71
  excel_to_text: Convert Excel to Markdown table with attachment, args: {"excel_path": {"type": "string"}, "file_content": {"type": "string"}, "sheet_name": {"type": "string", "optional": true}}
 
102
 
103
  ALWAYS follow this specific format for your responses. Your entire response will follow this pattern:
104
  Question: [the user's question]
105
+ Thought: [your reasoning about what to do next, break it down into smaller steps and clearly state your thoughts]
106
  Action:
107
  ```json
108
  {
 
139
  # Generate the chat interface, including the tools
140
  llm = ChatOpenAI(
141
  model="gpt-4o-mini",
142
+ temperature=0.1
143
  )
144
 
145
  chat = llm
app.py CHANGED
@@ -149,12 +149,16 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
149
  print(f"Skipping item with missing task_id or question: {item}")
150
  continue
151
  try:
 
 
 
 
152
  if task_id in tasks:
153
  question_text2 = question_text + f"\n\nThis is the file path: {file_path + tasks[task_id]}"
154
- if question_text2 is None:
155
- question_text2 = question_text
156
  submitted_answer = agent(question_text2)
157
- question_text2 = None
158
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
159
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
160
  except Exception as e:
 
149
  print(f"Skipping item with missing task_id or question: {item}")
150
  continue
151
  try:
152
+ # Initialize question_text2 with the original question
153
+ question_text2 = question_text
154
+
155
+ # Add file path information if task_id is in tasks
156
  if task_id in tasks:
157
  question_text2 = question_text + f"\n\nThis is the file path: {file_path + tasks[task_id]}"
158
+
159
+ # Get the answer from the agent
160
  submitted_answer = agent(question_text2)
161
+
162
  answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
163
  results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
164
  except Exception as e: