-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
227cca0
commit 59ab1ef
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# DALL-E Tool | ||
|
||
## Description | ||
This tool is used to give the Agent the ability to generate images using the DALL-E model. It is a transformer-based model that generates images from textual descriptions. This tool allows the Agent to generate images based on the text input provided by the user. | ||
|
||
## Installation | ||
Install the crewai_tools package | ||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
|
||
Remember that when using this tool, the text must be generated by the Agent itself. The text must be a description of the image you want to generate. | ||
|
||
```python | ||
from crewai_tools import DallETool | ||
|
||
Agent( | ||
... | ||
tools=[DallETool()], | ||
) | ||
``` | ||
|
||
If needed you can also tweak the parameters of the DALL-E model by passing them as arguments to the `DallETool` class. For example: | ||
|
||
```python | ||
from crewai_tools import DallETool | ||
|
||
dalle_tool = DallETool(model: str = "dall-e-3", | ||
size: str = "1024x1024", | ||
quality: str = "standard", | ||
n: int = 1) | ||
|
||
Agent( | ||
... | ||
tools=[dalle_tool] | ||
) | ||
``` | ||
|
||
The parameter 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](https://platform.openai.com/docs/guides/images/introduction?lang=python). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Vision Tool | ||
|
||
## Description | ||
|
||
This tool is used to extract text from images. When passed to the agent it will extract the text from the image and then use it to generate a response, report or any other output. The URL or the PATH of the image should be passed to the Agent. | ||
|
||
|
||
## Installation | ||
Install the crewai_tools package | ||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Usage | ||
|
||
In order to use the VisionTool, the OpenAI API key should be set in the environment variable `OPENAI_API_KEY`. | ||
|
||
```python | ||
from crewai_tools import VisionTool | ||
|
||
vision_tool = VisionTool() | ||
|
||
@agent | ||
def researcher(self) -> Agent: | ||
return Agent( | ||
config=self.agents_config["researcher"], | ||
allow_delegation=False, | ||
tools=[vision_tool] | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters