llama-index-tools-text-to-image


Namellama-index-tools-text-to-image JSON
Version 0.3.0 PyPI version JSON
download
home_pageNone
Summaryllama-index tools text_to_image integration
upload_time2024-11-17 23:02:52
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.
            # Text to Image Tool

This tool allows Agents to use the OpenAI Image endpoint to generate and create variations of images.

## Usage

This tool has more extensive example usage documented in a Jupyter notebook [here](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-text-to-image/examples/text_to_image.ipynb)

Another example showcases retrieval augmentation over a knowledge corpus with text-to-image. [Notebook](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-text-to-image/examples/text_to_image-pg.ipynb).

```python
from llama_index.tools.text_to_image import TextToImageToolSpec
from llama_index.agent.openai import OpenAIAgent

openai.api_key = "sk-your-key"
tool_spec = TextToImageToolSpec()
# OR
tool_spec = TextToImageToolSpec(api_key="sk-your-key")

agent = OpenAIAgent.from_tools(tool_spec.to_tool_list())

agent.chat("show 2 images of a beautiful beach with a palm tree at sunset")
agent.chat("make the second image higher quality")
```

`generate_images`: Generate images from a prompt, specifying the number of images and resolution
`show_images`: Show the images using matplot, useful for Jupyter notebooks
`generate_image_variation`: Generate a variation of an image given a URL.

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-text-to-image",
    "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/54/82/1056b3e43223645dbd1d26e38881685b1a8cee1d8b31d96fb2868526e444/llama_index_tools_text_to_image-0.3.0.tar.gz",
    "platform": null,
    "description": "# Text to Image Tool\n\nThis tool allows Agents to use the OpenAI Image endpoint to generate and create variations of images.\n\n## Usage\n\nThis tool has more extensive example usage documented in a Jupyter notebook [here](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-text-to-image/examples/text_to_image.ipynb)\n\nAnother example showcases retrieval augmentation over a knowledge corpus with text-to-image. [Notebook](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/tools/llama-index-tools-text-to-image/examples/text_to_image-pg.ipynb).\n\n```python\nfrom llama_index.tools.text_to_image import TextToImageToolSpec\nfrom llama_index.agent.openai import OpenAIAgent\n\nopenai.api_key = \"sk-your-key\"\ntool_spec = TextToImageToolSpec()\n# OR\ntool_spec = TextToImageToolSpec(api_key=\"sk-your-key\")\n\nagent = OpenAIAgent.from_tools(tool_spec.to_tool_list())\n\nagent.chat(\"show 2 images of a beautiful beach with a palm tree at sunset\")\nagent.chat(\"make the second image higher quality\")\n```\n\n`generate_images`: Generate images from a prompt, specifying the number of images and resolution\n`show_images`: Show the images using matplot, useful for Jupyter notebooks\n`generate_image_variation`: Generate a variation of an image given a URL.\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 text_to_image integration",
    "version": "0.3.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "769f9c327318c65d7cce5d45b65852ef71378f8c7cfbf1c7c69039bae3451a21",
                "md5": "7d3da4e7294b5201484e39a138d42e29",
                "sha256": "854855dbb445dbfa289159d8d1d70a1cf5a8c92e104f1c60287acb229b1f4042"
            },
            "downloads": -1,
            "filename": "llama_index_tools_text_to_image-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7d3da4e7294b5201484e39a138d42e29",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 3277,
            "upload_time": "2024-11-17T23:02:51",
            "upload_time_iso_8601": "2024-11-17T23:02:51.357375Z",
            "url": "https://files.pythonhosted.org/packages/76/9f/9c327318c65d7cce5d45b65852ef71378f8c7cfbf1c7c69039bae3451a21/llama_index_tools_text_to_image-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "54821056b3e43223645dbd1d26e38881685b1a8cee1d8b31d96fb2868526e444",
                "md5": "8d69fc6f74eec14143ffe8f5d44e1ad4",
                "sha256": "ca8b44e9498c8358313bcb4d54c5b68fdfd4f41663883c1f0e764e1e9977571c"
            },
            "downloads": -1,
            "filename": "llama_index_tools_text_to_image-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8d69fc6f74eec14143ffe8f5d44e1ad4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 2980,
            "upload_time": "2024-11-17T23:02:52",
            "upload_time_iso_8601": "2024-11-17T23:02:52.205697Z",
            "url": "https://files.pythonhosted.org/packages/54/82/1056b3e43223645dbd1d26e38881685b1a8cee1d8b31d96fb2868526e444/llama_index_tools_text_to_image-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-17 23:02:52",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-tools-text-to-image"
}
        
Elapsed time: 1.28078s