llama-index-tools-code-interpreter


Namellama-index-tools-code-interpreter JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
Summaryllama-index tools code_interpreter integration
upload_time2024-08-22 07:30:01
maintainerajhofmann
docs_urlNone
authorYour Name
requires_python<4.0,>=3.8.1
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.8.1",
    "maintainer_email": null,
    "keywords": null,
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/9c/a7/4e4b5dec04e29b6255cfc83ce6206e58b643cc03e54fcc7fb8cb47b08642/llama_index_tools_code_interpreter-0.2.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.2.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d822b69301646a293f2ec30e28c68b21f58687c08d69a5db13cfe1ff058051db",
                "md5": "82823e1ace9c7f56ab6fe6f929ea75fc",
                "sha256": "a6eb3a862090aecc043f935eb6b2d57b1755da5b2e668c99cffab69179ef5aee"
            },
            "downloads": -1,
            "filename": "llama_index_tools_code_interpreter-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "82823e1ace9c7f56ab6fe6f929ea75fc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 2870,
            "upload_time": "2024-08-22T07:30:00",
            "upload_time_iso_8601": "2024-08-22T07:30:00.336258Z",
            "url": "https://files.pythonhosted.org/packages/d8/22/b69301646a293f2ec30e28c68b21f58687c08d69a5db13cfe1ff058051db/llama_index_tools_code_interpreter-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9ca74e4b5dec04e29b6255cfc83ce6206e58b643cc03e54fcc7fb8cb47b08642",
                "md5": "f206d048da40881d007f6af6b4177082",
                "sha256": "0d3bd84b2bd3248ed5a2bbab89066cd84f287de1e76c2fef1c46f8f11c22b09c"
            },
            "downloads": -1,
            "filename": "llama_index_tools_code_interpreter-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f206d048da40881d007f6af6b4177082",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 2413,
            "upload_time": "2024-08-22T07:30:01",
            "upload_time_iso_8601": "2024-08-22T07:30:01.624068Z",
            "url": "https://files.pythonhosted.org/packages/9c/a7/4e4b5dec04e29b6255cfc83ce6206e58b643cc03e54fcc7fb8cb47b08642/llama_index_tools_code_interpreter-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 07:30:01",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-tools-code-interpreter"
}
        
Elapsed time: 0.78357s