-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal Error 500 when using function calls and multimodal prompts together #396
Comments
Thank you reporting this issue. This looks like an intermittent error and should work now. |
Oh I'm sorry then, my bad! Sadly the issue isn't fixed as of right now and I've consistently had the same error since last week Thursday :/ Can I still send feedback the way you described when I'm using VertexAI? |
+1. I'm not able to reproduce this, are you using google.generativeai or vertex? This code works fine:
|
I'm having the error with both Vertex and generativeai. Edit: I know you send "[IMG, prompt]" to the model but there's no "IMG" defined. If I actually define one and send the image to the model as well then I get the error. |
I was passing an PIL.Image here (it would have been a name error otherwise). |
Oh? That is very very weird then. I don't understand why I get this error then :( |
Now your code works for me, but VertexAI still has the same issue even when using the same code but with vertexai instead of genai |
Description of the bug:
When sending a multimodal request to the model via the Python SDK while also defining tools / function declarations I consistently receive an internal error 500. If I take away the tools OR the image and keep the other it works again.
I haven't changed anything about the code and it has worked before just fine, but now I suddenly get this error.
Actual vs expected behavior:
Actual: I receive an error 500
Expected: The modal should handle the request and respond without error
Any other information you'd like to share?
google_search_query = FunctionDeclaration(
name="search_and_scrape",
description="Get results from a Google Search",
parameters={
"type": "object",
"properties": {
"query": {"type": "string", "description": "Search query"}
},
},
)
search_tools = Tool(
function_declarations=[google_search_query]
)
model = GenerativeModel(
"gemini-1.5-pro-preview-0409",
generation_config=GenerationConfig(
temperature=0.6,
max_output_tokens=2048
),
tools=[search_tools])
async def main():
# User prompt
prompt = "What are the latest news for Paris?"
image_url = [image]
loaded_image = [load_image_from_url(url) for url in image_url]
print("In the function now")
The text was updated successfully, but these errors were encountered: