llama-index-tools-code-interpreter


Namellama-index-tools-code-interpreter JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
Summaryllama-index tools code_interpreter integration
upload_time2024-11-17 23:06:39
maintainerajhofmann
docs_urlNone
authorYour Name
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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.

```python
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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-tools-code-interpreter",
    "maintainer": "ajhofmann",
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/24/32/7fa57ab18b736cca96729d28d227a8ccb82cd6be95660d3d7dd476df7a10/llama_index_tools_code_interpreter-0.3.0.tar.gz",
    "platform": null,
    "description": "# Code Interpreter Tool\n\nThis tool can be used to run python scripts and capture the results of stdout and stderr\n\nWARNING: This tool provides the Agent access to the `subprocess.run` command.\nArbitrary code execution is possible on the machine running this tool.\nThis tool is not recommended to be used in a production setting, and would require heavy sandboxing or virtual machines\n\n## Usage\n\nHere's an example usage of the CodeInterpreterToolSpec.\n\n```python\nfrom llama_index.tools.code_interpreter import CodeInterpreterToolSpec\nfrom llama_index.agent.openai import OpenAIAgent\n\ncode_spec = CodeInterpreterToolSpec()\n\nagent = OpenAIAgent.from_tools(code_spec.to_tool_list())\n\n# Prime the agent to use the tool\nagent.chat(\n    \"Can you help me write some python code to pass to the code_interpreter tool\"\n)\nagent.chat(\n    \"write a python function to calculate volume of a sphere with radius 4.3cm\"\n)\n```\n\nThe tools available are:\n\n`code_interpreter`: A tool to evaluate a python script\n\nThis loader is designed to be used as a way to load data as a Tool in a Agent.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index tools code_interpreter integration",
    "version": "0.3.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb00652db9f35b63c31aceb16ac80cc3d0283c3df3eee9ad3c531bde72d7d15e",
                "md5": "cd6292061ec896994df08380943f8a14",
                "sha256": "1750f37a7552271c4ddb81bc3feb775117e8d552431b4e6326af6abbc5e5466b"
            },
            "downloads": -1,
            "filename": "llama_index_tools_code_interpreter-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cd6292061ec896994df08380943f8a14",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 2869,
            "upload_time": "2024-11-17T23:06:38",
            "upload_time_iso_8601": "2024-11-17T23:06:38.364717Z",
            "url": "https://files.pythonhosted.org/packages/cb/00/652db9f35b63c31aceb16ac80cc3d0283c3df3eee9ad3c531bde72d7d15e/llama_index_tools_code_interpreter-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "24327fa57ab18b736cca96729d28d227a8ccb82cd6be95660d3d7dd476df7a10",
                "md5": "49952a4ed66355bac6b494759de516d6",
                "sha256": "3c373e285e86ccf529a4630688ab55ea1a026e74666cfa911762fa4eb85b5ee6"
            },
            "downloads": -1,
            "filename": "llama_index_tools_code_interpreter-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "49952a4ed66355bac6b494759de516d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 2402,
            "upload_time": "2024-11-17T23:06:39",
            "upload_time_iso_8601": "2024-11-17T23:06:39.306775Z",
            "url": "https://files.pythonhosted.org/packages/24/32/7fa57ab18b736cca96729d28d227a8ccb82cd6be95660d3d7dd476df7a10/llama_index_tools_code_interpreter-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-17 23:06:39",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-tools-code-interpreter"
}
        
Elapsed time: 0.70680s