#Prompting with media files  |  Google AI...

1 messages · Page 1 of 1 (latest)

pseudo cedar
#

Can please anyone help me on this

fallen lake
#

You can't use the File API to include text. If you want to include text, you need to just send the text part.

pseudo cedar
#

Thanks @fallen lake any other alternate solution ? Because i need to reduce the token size

fallen lake
#

Even if you were including it - it wouldn't reduce the token size.

Why do you need to reduce the token size?

pseudo cedar
#

I need to send the file content with my prompt to create a automation code

fallen lake
#

Include it as a text part.

pseudo cedar
#

Okay thanks @fallen lake text part means you are telling as send it as raw text instead of taking from file . am i right ? correct me if am wrong

fallen lake
#

well, the prompts are allowed to have multiple parts.

When you wanted to reference a file, you would be using a "fileData" part. If you're just including text, you can include that as a "text" part. The text prompts are all "text" parts.

pseudo cedar
#

Thanks @fallen lake

#

hope this also supports following MIME type of the source data. Accepted types include: "image/png", "image/jpeg", "image/heic", "image/heif", "image/webp".

#

it wont support text/plain or application/pdf ?

#

@fallen lake

fallen lake
#

I think it might support application/pdf now. That documentation is out of date in some ways.

But it does not support text/plain.

As I said, if you want to include plain text, use the "text" part.

pseudo cedar
#

okay @fallen lake thanks