Spaces:
Sleeping
Sleeping
EtienneB
commited on
Commit
·
f55b551
1
Parent(s):
aaf4112
updated prompt and tool name
Browse files- agent.py +4 -4
- system-prompt-claude-2.txt +1 -1
- tools.py +2 -2
agent.py
CHANGED
@@ -9,7 +9,7 @@ from langgraph.graph import START, MessagesState, StateGraph
|
|
9 |
from langgraph.prebuilt import ToolNode, tools_condition
|
10 |
|
11 |
from tools import (absolute, add, analyze_csv_file, # extract_text_from_image,
|
12 |
-
analyze_excel_file,
|
13 |
compound_interest, convert_temperature, divide,
|
14 |
download_file, exponential, factorial, floor_divide,
|
15 |
get_current_time_in_timezone, greatest_common_divisor,
|
@@ -30,7 +30,7 @@ tools = [
|
|
30 |
get_current_time_in_timezone, compound_interest,
|
31 |
convert_temperature, factorial, greatest_common_divisor,
|
32 |
is_prime, least_common_multiple, percentage_calculator,
|
33 |
-
wikipedia_search, analyze_excel_file,
|
34 |
audio_transcription, python_code_parser, analyze_csv_file,
|
35 |
# extract_text_from_image,
|
36 |
reverse_sentence, web_content_extract,
|
@@ -67,7 +67,7 @@ You are an advanced AI agent equipped with multiple tools to solve complex, mult
|
|
67 |
- String operations or text processing
|
68 |
|
69 |
3. **Tool Selection and Evaluation**: Before using any tool, systematically evaluate all available options:
|
70 |
-
- **Review ALL
|
71 |
- **Match tool capabilities** to the specific requirements of your current step
|
72 |
- **Choose the most appropriate tool** for each task from the complete toolkit
|
73 |
- **Plan multi-tool sequences** - many questions require 2-5 tools in various combinations
|
@@ -123,7 +123,7 @@ You are an advanced AI agent equipped with multiple tools to solve complex, mult
|
|
123 |
- **web_search**: Search the web for information
|
124 |
- **web_content_extract**: Extract content from web pages
|
125 |
- **wikipedia_search**: Search Wikipedia for information
|
126 |
-
- **
|
127 |
|
128 |
### Utilities
|
129 |
- **convert_temperature**: Convert between temperature units
|
|
|
9 |
from langgraph.prebuilt import ToolNode, tools_condition
|
10 |
|
11 |
from tools import (absolute, add, analyze_csv_file, # extract_text_from_image,
|
12 |
+
analyze_excel_file, arxiv_search, audio_transcription,
|
13 |
compound_interest, convert_temperature, divide,
|
14 |
download_file, exponential, factorial, floor_divide,
|
15 |
get_current_time_in_timezone, greatest_common_divisor,
|
|
|
30 |
get_current_time_in_timezone, compound_interest,
|
31 |
convert_temperature, factorial, greatest_common_divisor,
|
32 |
is_prime, least_common_multiple, percentage_calculator,
|
33 |
+
wikipedia_search, analyze_excel_file, arxiv_search,
|
34 |
audio_transcription, python_code_parser, analyze_csv_file,
|
35 |
# extract_text_from_image,
|
36 |
reverse_sentence, web_content_extract,
|
|
|
67 |
- String operations or text processing
|
68 |
|
69 |
3. **Tool Selection and Evaluation**: Before using any tool, systematically evaluate all available options:
|
70 |
+
- **Review ALL available tools** in your toolkit before making selecting the most appropiate ones.
|
71 |
- **Match tool capabilities** to the specific requirements of your current step
|
72 |
- **Choose the most appropriate tool** for each task from the complete toolkit
|
73 |
- **Plan multi-tool sequences** - many questions require 2-5 tools in various combinations
|
|
|
123 |
- **web_search**: Search the web for information
|
124 |
- **web_content_extract**: Extract content from web pages
|
125 |
- **wikipedia_search**: Search Wikipedia for information
|
126 |
+
- **arxiv_search**: Search academic papers on arXiv
|
127 |
|
128 |
### Utilities
|
129 |
- **convert_temperature**: Convert between temperature units
|
system-prompt-claude-2.txt
CHANGED
@@ -26,7 +26,7 @@ You are an advanced AI agent equipped with multiple tools to solve complex, mult
|
|
26 |
- String operations or text processing
|
27 |
|
28 |
3. **Tool Selection and Evaluation**: Before using any tool, systematically evaluate all available options:
|
29 |
-
- **Review ALL
|
30 |
- **Match tool capabilities** to the specific requirements of your current step
|
31 |
- **Choose the most appropriate tool** for each task from the complete toolkit
|
32 |
- **Plan multi-tool sequences** - many questions require 2-5 tools in various combinations
|
|
|
26 |
- String operations or text processing
|
27 |
|
28 |
3. **Tool Selection and Evaluation**: Before using any tool, systematically evaluate all available options:
|
29 |
+
- **Review ALL available tools** in your toolkit before making a selection
|
30 |
- **Match tool capabilities** to the specific requirements of your current step
|
31 |
- **Choose the most appropriate tool** for each task from the complete toolkit
|
32 |
- **Plan multi-tool sequences** - many questions require 2-5 tools in various combinations
|
tools.py
CHANGED
@@ -627,7 +627,7 @@ def wikipedia_search(query: str) -> str:
|
|
627 |
return {"wiki_results": formatted_search_docs}
|
628 |
|
629 |
@tool
|
630 |
-
def
|
631 |
"""
|
632 |
Search Arxiv for a query and return maximum 3 result.
|
633 |
|
@@ -640,7 +640,7 @@ def arvix_search(query: str) -> str:
|
|
640 |
f'<Document source="{doc.metadata["source"]}" page="{doc.metadata.get("page", "")}"/>\n{doc.page_content[:1000]}\n</Document>'
|
641 |
for doc in search_docs
|
642 |
])
|
643 |
-
return {"
|
644 |
|
645 |
|
646 |
@tool
|
|
|
627 |
return {"wiki_results": formatted_search_docs}
|
628 |
|
629 |
@tool
|
630 |
+
def arxiv_search(query: str) -> str:
|
631 |
"""
|
632 |
Search Arxiv for a query and return maximum 3 result.
|
633 |
|
|
|
640 |
f'<Document source="{doc.metadata["source"]}" page="{doc.metadata.get("page", "")}"/>\n{doc.page_content[:1000]}\n</Document>'
|
641 |
for doc in search_docs
|
642 |
])
|
643 |
+
return {"arxiv_results": formatted_search_docs}
|
644 |
|
645 |
|
646 |
@tool
|