🛠️ Tools
Overview
GEM provides a comprehensive set of tools to enhance agent capabilities and enable sophisticated problem-solving approaches. GEM currently supports python
and search
tools to enhance agent capabilities and enable more sophisticated problem-solving approaches.
Python Tool
Allows agents to write and execute Python code, enabling computational problem-solving and data manipulation capabilities.
GEM’s python code tool allows the agent to learn to write code. The python tool parses code blocks, runs them, and returns the result.
API Reference
gem.tools.python_code_tool.PythonCodeTool
Parameters
- action (str)The response from the LLM agent.
Returns
- is_valid (bool)Whether a valid code block is found.
- has_error (bool)Whether the code gave an error.
- observation (str)The output of running the code if a valid code block is found, otherwise an empty string.
- parsed_action (str)The action truncated at the end of the first valid code block. If no code block is found then parsed_action is set to the input action.
Returns
- strInstruction string for the agent
Search Tool
GEM includes a search tool, enabling the agent to learn to call search engines for information retrieval and knowledge enhancement.
API Reference
gem.tools.search_tool.SearchTool
<search>
content. Returns the result of the search if a valid search call is found.Parameters
- action (str)The response from the LLM agent.
Returns
- is_valid (bool)Whether a valid
<search></search>
call is found. - has_error (bool)Whether the search engine gave an error.
- observation (str)The output of running the search if a valid search call is found, otherwise an empty string.
- parsed_action (str)The action truncated at the end of the first valid search call. If no search call is found then parsed_action is set to the input action.
Returns
- strInstruction string for the agent
Usage
Agents can use the search tool by including search queries in their responses using the <search></search>
tags. The tool will:
- Parse the search query from the agent’s response
- Execute the search using the configured search engine
- Return the search results to the agent
- Allow the agent to use this information for better responses