Skip to main content

llama-index tools text_to_image integration

Project description

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

Another example showcases retrieval augmentation over a knowledge corpus with text-to-image. Notebook.

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.

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

llama_index_tools_text_to_image-0.3.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_tools_text_to_image-0.3.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_text_to_image-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ca8b44e9498c8358313bcb4d54c5b68fdfd4f41663883c1f0e764e1e9977571c
MD5 8d69fc6f74eec14143ffe8f5d44e1ad4
BLAKE2b-256 54821056b3e43223645dbd1d26e38881685b1a8cee1d8b31d96fb2868526e444

See more details on using hashes here.

File details

Details for the file llama_index_tools_text_to_image-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_text_to_image-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 854855dbb445dbfa289159d8d1d70a1cf5a8c92e104f1c60287acb229b1f4042
MD5 7d3da4e7294b5201484e39a138d42e29
BLAKE2b-256 769f9c327318c65d7cce5d45b65852ef71378f8c7cfbf1c7c69039bae3451a21

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page