pdf analysis using gemini-1.5-pro

hello

i saw sample code for python sdk for generative-ai using gemini-1.5-pro model (below snippet)
i tried doing the same using node sdk, but it keeps throwing a 500 error. 
isn't this functionality available in the node sdk yet?

 

pdf_file_uri = "gs://cloud-samples-data/generative-ai/pdf/2403.05530.pdf"

prompt = """
  Your are a very professional document summarization specialist.
  Please summarize the given document.
"""

pdf_file = Part.from_uri(pdf_file_uri, mime_type="application/pdf")
contents = [pdf_file, prompt]

response = model.generate_content(contents)
print(response.text)

 

 

6 1 741
1 REPLY 1

I think your error may be related to your authentication or some other issue, because I use the same code snippet and it works for me. Without more context I am not able to give much more help.