Skip to content

Commit

Permalink
Merge branch 'Readme-File' into 'main'
Browse files Browse the repository at this point in the history
Finish: Finish document for agent tools

See merge request nsysu_mis_projects/misb114/course_mis324!34
  • Loading branch information
whats2000 committed Nov 27, 2024
2 parents a3b9e95 + 6fa65df commit 9ca19ce
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Agent Tools Introduction

## Overview
The agent tools provide a comprehensive set of functionalities to interact with files, execute commands, search content, and perform web-related tasks. These tools are designed to help accomplish various computational and information-gathering tasks efficiently.

## Available Tools

### 1. Web and URL Tools
#### webSearch
- **Purpose**: Fetch the latest information from the web
- **Key Parameters**:
- `query`: Search query (required)
- `maxCharsPerPage`: Limit characters per page (optional, default: 6000)
- `numResults`: Number of search results (optional, default: 4)

#### urlFetcher
- **Purpose**: Extract content from a specific URL
- **Key Parameters**:
- `url`: URL to fetch content from (required)
- `maxCharsPerPage`: Limit characters extracted (optional, default: 6000)

### 2. File Management Tools
#### readFile
- **Purpose**: Read contents of a file
- **Key Parameters**:
- `relativeFilePath`: Path to the file to read (required)
- **Special Features**:
- Automatically extracts text from PDF and DOCX files
- Returns raw content as a string

#### writeToFile
- **Purpose**: Write content to a file
- **Key Parameters**:
- `relativePath`: Path where file will be written (required)
- `content`: Full content to write (required)
- **Special Features**:
- Creates directories if they don't exist
- Overwrites existing files

#### searchFiles
- **Purpose**: Perform regex search across multiple files
- **Key Parameters**:
- `relativePath`: Directory to search (required)
- `regex`: Regular expression pattern (required)
- `filePattern`: Optional file type filter (e.g., '*.ts')

#### listFiles
- **Purpose**: List files and directories in a specified path
- **Key Parameters**:
- `relativePath`: Path to list contents (required)
- `recursive`: Whether to list files recursively (optional)

### 3. Code and Development Tools
#### listCodeDefinitionNames
- **Purpose**: List top-level code definitions in a directory
- **Key Parameters**:
- `relativePath`: Directory to analyze (required)
- **Insights**:
- Reveals classes, functions, methods at the top level
- Helps understand code structure and architecture

### 4. System and Command Tools
#### executeCommand
- **Purpose**: Run CLI commands on the system
- **Key Parameters**:
- `command`: CLI command to execute (required)
- `relativePath`: Optional directory to run the command
- `timeoutDuration`: Command execution timeout (default: 10 seconds)

### 5. Web Interaction Tools
#### inspectSite
- **Purpose**: Capture initial state of a website
- **Key Parameters**:
- `url`: Website URL to inspect (required)
- **Features**:
- Takes full-page screenshot
- Captures initial console logs
- Does not interact with page after initial load

### 6. Interactive Tools
#### askFollowUpQuestion
- **Purpose**: Gather additional information from the user
- **Key Parameters**:
- `question`: Specific question to ask (required)
- **Use Case**: Clarify ambiguities or request more details

#### attemptCompletion
- **Purpose**: Present task results
- **Key Parameters**:
- `result`: Final task outcome (required)
- `command`: Optional CLI command to demonstrate result

## Usage Guidelines
1. Choose the appropriate tool based on your specific task
2. Provide required parameters carefully
3. Use tools in a sequential, logical manner
4. Be mindful of file paths and system limitations

## Best Practices
- Use `relativePath` to maintain context
- Validate inputs before executing commands
- Handle potential errors gracefully
- Leverage combination of tools for complex tasks

## Limitations
- Some tools have character or result limits
- Network-dependent tools may have connectivity issues
- System-specific commands might not work across all environments

## Security Note
Always verify commands and URLs to prevent unintended actions or security risks.
33 changes: 33 additions & 0 deletions Documents/docs/docs/features/automated-tasks/configuration.md
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
# Configuration

You can configure the active tools which can be used in the automated tasks feature.
Below is a guide on how to configure the tools.

## Configuration

To toggle on or off the tools, click the magic wand icon on the bottom right of the code editor.

![ToggleTools](/img/automatedTasks/ToggleTools.png)

## Tools

After clicking the magic wand icon, a list of tools will appear. You can toggle on or off the tools you want to use.

![ToggleToolsList](/img/automatedTasks/ToggleToolsList.png)

The three icons on the right side of the tool name are as follows:

- Web Search: Search the web for information. The feature is further extended the capability of the LLM to able to use
latest information from the web.

![WebSearch](/img/automatedTasks/WebSearch.png)

- Url Fetcher: Fetch information from a URL. The feature is able to let LLM fetch information from a URL, this mainly
used for fetching documentation or GitHub issues. Which can be used to fix bugs or implement new features.

![UrlFetcher](/img/automatedTasks/UrlFetcher.png)

- Agent Tools: As the name is "Agent Tools", there is a bunch of tools that can be used to interact with the VSCode
editor. This is mainly used for automating tasks in the editor. We will discuss this in detail in the following
sections.

![AgentTools](/img/automatedTasks/AgentTools.png)
1 change: 1 addition & 0 deletions Documents/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const sidebars: SidebarsConfig = {
items: [
"docs/features/automated-tasks/configuration",
"docs/features/automated-tasks/agent-tools",
"docs/features/automated-tasks/agent-tools-introduction",
],
},
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documents/static/img/automatedTasks/WebSearch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9ca19ce

Please sign in to comment.