跳转至

DALL-E 工具

描述

此工具用于赋予Agent使用DALL-E模型生成图像的能力。它是一个基于transformer的模型,能够从文本描述中生成图像。此工具允许Agent根据用户提供的文本输入生成图像。

安装

安装crewai_tools包

pip install 'crewai[tools]'

示例

请记住,在使用此工具时,文本必须由Agent自身生成。文本必须是对您想要生成的图像的描述。

from crewai_tools import DallETool

Agent(
    ...
    tools=[DallETool()],
)

如果需要,您还可以通过将参数传递给DallETool类来调整DALL-E模型的参数。例如:

from crewai_tools import DallETool

dalle_tool = DallETool(model="dall-e-3",
                       size="1024x1024",
                       quality="standard",
                       n=1)

Agent(
    ...
    tools=[dalle_tool]
)
The parameters are based on the client.images.generate method from the OpenAI API. For more information on the parameters, please refer to the OpenAI API documentation.

参数基于OpenAI API的client.images.generate方法。有关参数的更多信息,请参考OpenAI API文档