from google import genai
from google.genai import types
import pathlib
client = genai.Client()
filepath = pathlib.Path('my_local_file.pdf')
prompt = "Summarize this document"
response = client.models.generate_content(
model="gemini-3-flash-preview",
contents=[
types.Part.from_bytes(
data=filepath.read_bytes(),
mime_type='application/pdf',
),
prompt
]
)
print(response.text)
Hi @MJ_MORSALIN
Welcome to the Google AI Forum!!!
I am having difficulty understanding your concern. Could you please provide a few more details about your issue? This will help us better understand and analyze the problem so we can provide you with a more accurate and helpful response.
Thanks!