diff --git a/docs/griptape-framework/drivers/prompt-drivers.md b/docs/griptape-framework/drivers/prompt-drivers.md index 131c596cfc..9df4aae0a7 100644 --- a/docs/griptape-framework/drivers/prompt-drivers.md +++ b/docs/griptape-framework/drivers/prompt-drivers.md @@ -19,6 +19,12 @@ Or use them independently: --8<-- "docs/griptape-framework/drivers/src/prompt_drivers_2.py" ``` +You can pass images to the Driver if the model supports it: + +```python +--8<-- "docs/griptape-framework/drivers/src/prompt_driver_images.py" +``` + ## Prompt Drivers Griptape offers the following Prompt Drivers for interacting with LLMs. diff --git a/docs/griptape-framework/drivers/src/prompt_drivers_images.py b/docs/griptape-framework/drivers/src/prompt_drivers_images.py new file mode 100644 index 0000000000..244308ef58 --- /dev/null +++ b/docs/griptape-framework/drivers/src/prompt_drivers_images.py @@ -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]))