I can successfully process Microsoft Excel XLSX files via the WebUI on GCP (https://console.cloud.google.com/vertex-ai/generative/multimodal/create/text).
I can also successfully programmatically pass PDFs and TXT files into GCP VertexAI (with mime types “application/pdf” and “text/pain” respectively.)
user_prompt_content = Content(
role="user",
parts=[
Part.from_text(prompt),
Part.from_uri(gcp_cloud_object_ref, mime_type=obj_mime_type)
],
)
However, I cannot process XLSX files programmatically, presumably due to the mime type. When I try “application/pdf” I get
InvalidArgument: 400 The document has no pages.
When I try “text/plain” I get
InvalidArgument: 400 Request contains an invalid argument.
GCP docs do not list the correct mime type to use (https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference) but I tried the usual type unsuccessfully
- application/vnd.ms-excel
- xlsm application/vnd.ms-excel.sheet.macroEnabled.12
- xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
The docs and error might suggest that XLSX cannot be processed, but then how is the web-ui achieving this? Can I replicate the same functionality as the web-ui programmatically?