#Prompting with media files | Google AI...
1 messages · Page 1 of 1 (latest)
You can't use the File API to include text. If you want to include text, you need to just send the text part.
Thanks @fallen lake any other alternate solution ? Because i need to reduce the token size
Even if you were including it - it wouldn't reduce the token size.
Why do you need to reduce the token size?
I need to send the file content with my prompt to create a automation code
Include it as a text part.
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
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.
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
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.
okay @fallen lake thanks