Gemini: Document allowing arbitrary attachments (#37520)

This commit is contained in:
tronikos 2025-02-23 16:13:24 -08:00 committed by GitHub
commit e05332cb47
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -85,15 +85,16 @@ The tutorial is using OpenAI, but this could also be done with the Google Genera
This action isn't tied to any integration entry, so it won't use the model, prompt, or any of the other settings in your options. If you only want to pass text, you should use the `conversation.process` action. This action isn't tied to any integration entry, so it won't use the model, prompt, or any of the other settings in your options. If you only want to pass text, you should use the `conversation.process` action.
{% endtip %} {% endtip %}
Allows you to ask Gemini Pro or Gemini Pro Vision to generate content from a prompt consisting of text and optionally images. Allows you to ask Gemini Pro or Gemini Pro Vision to generate content from a prompt consisting of text and optionally attachments (images, PDFs, etc.).
This action populates [response data](/docs/scripts/perform-actions#use-templates-to-handle-response-data) with the generated content. This action populates [response data](/docs/scripts/perform-actions#use-templates-to-handle-response-data) with the generated content.
| Data attribute | Optional | Description | Example | | Data attribute | Optional | Description | Example |
| ---------------------- | -------- | ----------------------------------------------- | ------------------- | | ---------------------- | -------- | ----------------------------------------------- | ------------------- |
| `prompt` | no | The prompt for generating the content. | Describe this image | | `prompt` | no | The prompt for generating the content. | Describe this image |
| `image_filename` | yes | File names for images to include in the prompt. | /tmp/image.jpg | | `filenames` | yes | File names for attachments to include in the prompt. | /tmp/image.jpg |
{% raw %} {% raw %}
```yaml ```yaml
action: google_generative_ai_conversation.generate_content action: google_generative_ai_conversation.generate_content
data: data:
@ -101,9 +102,10 @@ data:
Very briefly describe what you see in this image from my doorbell camera. Very briefly describe what you see in this image from my doorbell camera.
Your message needs to be short to fit in a phone notification. Don't Your message needs to be short to fit in a phone notification. Don't
describe stationary objects or buildings. describe stationary objects or buildings.
image_filename: /tmp/doorbell_snapshot.jpg filenames: /tmp/doorbell_snapshot.jpg
response_variable: generated_content response_variable: generated_content
``` ```
{% endraw %} {% endraw %}
The response data field `text` will contain the generated content. The response data field `text` will contain the generated content.
@ -111,19 +113,21 @@ The response data field `text` will contain the generated content.
Another example with multiple images: Another example with multiple images:
{% raw %} {% raw %}
```yaml ```yaml
action: google_generative_ai_conversation.generate_content action: google_generative_ai_conversation.generate_content
data: data:
prompt: >- prompt: >-
Briefly describe what happened in the following sequence of images Briefly describe what happened in the following sequence of images
from my driveway camera. from my driveway camera.
image_filename: filenames:
- /tmp/driveway_snapshot1.jpg - /tmp/driveway_snapshot1.jpg
- /tmp/driveway_snapshot2.jpg - /tmp/driveway_snapshot2.jpg
- /tmp/driveway_snapshot3.jpg - /tmp/driveway_snapshot3.jpg
- /tmp/driveway_snapshot4.jpg - /tmp/driveway_snapshot4.jpg
response_variable: generated_content response_variable: generated_content
``` ```
{% endraw %} {% endraw %}
### Video tutorial ### Video tutorial