-
Notifications
You must be signed in to change notification settings - Fork 467
Closed
Labels
component:python sdkIssue/PR related to Python SDKIssue/PR related to Python SDKtype:bugSomething isn't workingSomething isn't working
Description
Description of the bug:
When passing empty message to ChatSession.send_message
it triggers a 500 Internal Server Error.
Here is an example :
import google.generativeai as genai
genai.configure(api_key ="YOUR API KEY")
model = genai.GenerativeModel(model_name='gemini-pro')
chat = model.start_chat(history=[])
response = chat.send_message("")
Actual vs expected behavior:
Actual behavior:
InternalServerError: 500 POST https://dp.kaggle.net/palmapi/v1beta/models/gemini-pro:generateContent?%24alt=json%3Benum-encoding%3Dint: An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting
Actual behavior:
Should be handled in the same way as it is in GenerativeModel.generate_content
:
TypeError: contents must not be empty
Any other information you'd like to share?
No response
Metadata
Metadata
Assignees
Labels
component:python sdkIssue/PR related to Python SDKIssue/PR related to Python SDKtype:bugSomething isn't workingSomething isn't working