feat(examples): add tool usage examples for bash, edit, ckg and json … #333
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…tools
Description
This pull request introduces a comprehensive set of example scripts for the tools available in the
trae_agent/toolsdirectory. These examples are designed to demonstrate the functionality of each tool and provide a clear guide for developers on how to use them effectively.More Information
The following example scripts have been added to the
examples/tools/directory:bash_example.py: Demonstrates how to use theBashToolto execute shell commands, capture output, and handle errors.ckg_tool_example.py: Provides an example of how to use theCKGToolto query the codebase for functions, classes, and methods.edit_tool_example.py: Shows how to use theTextEditorToolto perform file manipulations such as creating, viewing, and editing text files.json_edit_tool_example.py: Illustrates how to use theJSONEditToolfor structured data manipulation in JSON files, including adding, setting, and removing elements.run_example.py: An example of how to use therunutility function to execute shell commands and handle their output and errors.These examples will serve as a valuable resource for developers, accelerating the learning process and promoting the correct use of the available tools.
Validation
To validate the changes in this pull request, you can run each example script individually to see the tool in action.
For example, to run the
bash_example.pyscript, execute the following command from the project's root directory:Each script is self-contained and will print the results of its operations to the console.
Linked Issues
No linked issues.