Skip to content

Commit

Permalink
Removed examples from tools llm docs
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninoLorenzo committed Jun 29, 2024
1 parent bae09e7 commit 7afb2b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
5 changes: 1 addition & 4 deletions src/agent/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class Tool:
name: str
tool_description: str
args_description: str
examples: str

@staticmethod
def load_tool(path: str):
Expand All @@ -20,7 +19,6 @@ def load_tool(path: str):
tool.name = tool_data['name']
tool.tool_description = ''.join(tool_data['tool_description'])
tool.args_description = ''.join(tool_data['args_description'])
tool.examples = ''.join(tool_data['examples'])

return tool

Expand Down Expand Up @@ -49,6 +47,5 @@ def get_documentation(self):
{self.tool_description}
Arguments:
{self.args_description}
Usage Examples:
{self.examples}"""
"""

18 changes: 11 additions & 7 deletions src/agent/tools/terminal.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Terminal Tool"""
import platform
import textwrap

from src.agent.tools.base import Tool

Expand All @@ -14,11 +15,14 @@ def __init__(self):
self.tool_description = \
f"""Used to interact with {CUR_OS} OS or run programs from command line."""

self.args_description = """Takes as input the command to execute."""
self.args_description = textwrap.dedent("""
Takes as input the command to execute.
Usage: terminal <command>
""")

self.examples = """<THOUGHT>I need to know the current folder content</THOUGHT>
<TOOL>terminal ls -la</TOOL> /STOP
<THOUGHT>I need to create a directory example_directory</THOUGHT>
<TOOL>terminal mkdir example_directory</TOOL> /STOP
"""
# self.examples = """<THOUGHT>I need to know the current folder content</THOUGHT>
# <TOOL>terminal ls -la</TOOL> /STOP
#
# <THOUGHT>I need to create a directory example_directory</THOUGHT>
# <TOOL>terminal mkdir example_directory</TOOL> /STOP
# """
9 changes: 2 additions & 7 deletions tools_settings/nmap.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
{
"name": "nmap",
"tool_description": "Nmap (“Network Mapper”) is an open source tool for network exploration and security auditing.",
"tool_description": "Nmap is a tool for network exploration used during Reconnaissance in Penetration Testing.",
"args_description": [
"The most important nmap command argument is the iPv4 address of the target machine.\n",
"Ensure that the IP address is in the format xxx.xxx.xxx.xxx with points separating the octets,",
" otherwise the command will fail running"
],
"examples": [
"<THOUGHT>I need to know what services are exposed on the current device</THOUGHT>\n",
"<TOOL>nmap -sV 127.0.0.1</TOOL>\n"
"Ensure that the IP address is in the format xxx.xxx.xxx.xxx with points separating the octets.",
]
}

0 comments on commit 7afb2b6

Please sign in to comment.