cookbook icon indicating copy to clipboard operation
cookbook copied to clipboard

Pdf upload not working

Open rajivraghu opened this issue 10 months ago • 0 comments

Hello, I am trying to upload a PDF and trying to get a summary of it. Unsupported MIME type: application/pdf

sample_file = genai.upload_file(path="test.pdf",
                                display_name="Test")

model = genai.GenerativeModel(model_name="models/gemini-1.5-pro-latest")

response = model.generate_content(["Generate a summary of the document", sample_file])

print(response.text)

rajivraghu avatar Apr 15 '24 10:04 rajivraghu