google.api_core.exceptions.InvalidArgument: 400 Invalid or unsupported file uri:
glm.FileData with a uri doesn't seem to work? I need to use Part.from_uri from the old vertex.preview library, but that library does not let me use model = genai.GenerativeModel('gemini-1.5-pro-latest')
Actual vs expected behavior:
api_key = os.getenv("GEMINI_API_KEY")
genai.configure(api_key=api_key)
model = genai.GenerativeModel('gemini-1.5-pro-latest')
response = model.generate_content(
glm.Content(
parts = [
glm.Part(text="What is this image of?"),
glm.Part(
file_data=glm.FileData(
mime_type='image/png',
file_uri="gs://urihere.png"
)
),
],
),
stream=False)
print(response)
I'd expect this to work...but it says unsupported file uri (note: the uri is correct i just put a placeholder here for the example)
Description of the bug:
google.api_core.exceptions.InvalidArgument: 400 Invalid or unsupported file uri:
glm.FileData with a uri doesn't seem to work? I need to use Part.from_uri from the old vertex.preview library, but that library does not let me use
model = genai.GenerativeModel('gemini-1.5-pro-latest')
Actual vs expected behavior:
api_key = os.getenv("GEMINI_API_KEY") genai.configure(api_key=api_key) model = genai.GenerativeModel('gemini-1.5-pro-latest') response = model.generate_content( glm.Content( parts = [ glm.Part(text="What is this image of?"), glm.Part( file_data=glm.FileData( mime_type='image/png', file_uri="gs://urihere.png" ) ), ], ), stream=False)
print(response)
I'd expect this to work...but it says unsupported file uri (note: the uri is correct i just put a placeholder here for the example)
Any other information you'd like to share?
No response