llama-index tools code_interpreter integration
Project description
Code Interpreter Tool
This tool can be used to run python scripts and capture the results of stdout and stderr
WARNING: This tool provides the Agent access to the subprocess.run
command.
Arbitrary code execution is possible on the machine running this tool.
This tool is not recommended to be used in a production setting, and would require heavy sandboxing or virtual machines
Usage
Here's an example usage of the CodeInterpreterToolSpec.
from llama_index.tools.code_interpreter import CodeInterpreterToolSpec
from llama_index.agent.openai import OpenAIAgent
code_spec = CodeInterpreterToolSpec()
agent = OpenAIAgent.from_tools(code_spec.to_tool_list())
# Prime the agent to use the tool
agent.chat(
"Can you help me write some python code to pass to the code_interpreter tool"
)
agent.chat(
"write a python function to calculate volume of a sphere with radius 4.3cm"
)
The tools available are:
code_interpreter
: A tool to evaluate a python script
This loader is designed to be used as a way to load data as a Tool in a Agent.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for llama_index_tools_code_interpreter-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d3bd84b2bd3248ed5a2bbab89066cd84f287de1e76c2fef1c46f8f11c22b09c |
|
MD5 | f206d048da40881d007f6af6b4177082 |
|
BLAKE2b-256 | 9ca74e4b5dec04e29b6255cfc83ce6206e58b643cc03e54fcc7fb8cb47b08642 |
Close
Hashes for llama_index_tools_code_interpreter-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6eb3a862090aecc043f935eb6b2d57b1755da5b2e668c99cffab69179ef5aee |
|
MD5 | 82823e1ace9c7f56ab6fe6f929ea75fc |
|
BLAKE2b-256 | d822b69301646a293f2ec30e28c68b21f58687c08d69a5db13cfe1ff058051db |