-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Description Image to Image agent that uses Fal tools.
- Loading branch information
Showing
3 changed files
with
77 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from phi.agent import Agent | ||
from phi.model.openai import OpenAIChat | ||
from phi.tools.fal_tools import FalTools | ||
|
||
agent = Agent( | ||
model=OpenAIChat(id="gpt-4o"), | ||
agent_id="image-to-image", | ||
name="Image to Image Agent", | ||
tools=[FalTools()], | ||
markdown=True, | ||
debug=True, | ||
show_tool_calls=True, | ||
instructions=[ | ||
"You have to use the `image_to_image` tool to generate the image.", | ||
"You are an AI agent that can generate images using the Fal AI API.", | ||
"You will be given a prompt and an image URL.", | ||
"You have to return the image URL as provided, don't convert it to markdown or anything else.", | ||
], | ||
) | ||
|
||
agent.print_response("a cat dressed as a wizard with a background of a mystic forest. Make it look like 'https://fal.media/files/koala/Chls9L2ZnvuipUTEwlnJC.png'", stream=True) |
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