-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Image Query Drivers with Prompt Drivers #1340
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from griptape.artifacts import ListArtifact, TextArtifact | ||
from griptape.drivers import OpenAiChatPromptDriver | ||
from griptape.loaders import ImageLoader | ||
|
||
driver = OpenAiChatPromptDriver(model="gpt-4o", max_tokens=256) | ||
|
||
image_artifact = ImageLoader().load("./tests/resources/mountain.jpg") | ||
text_artifact = TextArtifact("Describe the weather in the image") | ||
|
||
driver.run(ListArtifact([text_artifact, image_artifact])) |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
from griptape.drivers import OpenAiImageQueryDriver | ||
from griptape.drivers import OpenAiChatPromptDriver | ||
from griptape.structures import Agent | ||
from griptape.tools import ImageQueryTool | ||
|
||
# Create an Image Query Driver. | ||
driver = OpenAiImageQueryDriver(model="gpt-4o") | ||
driver = OpenAiChatPromptDriver(model="gpt-4o") | ||
|
||
# Create an Image Query Tool configured to use the engine. | ||
tool = ImageQueryTool( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious about the use case when an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is still value in having a Tool that can query images from the file system/task memory. Long term this functionality should maybe be baked into the File Manager Tool but that would require refactors outside the scope of this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it. in that case, may be good to add |
||
image_query_driver=driver, | ||
prompt_driver=driver, | ||
) | ||
|
||
# Create an agent and provide the tool to it. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you on this, but may be good to add a line in the prompt drivers that they can now handle multi-modal queries or something so it doesn't seem like we don't support it at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this list could focus on functionality (like verbs), then mention which driver gives it to you 🤷 .