Open wwparzival opened 1 month ago
Hi @wwparzival
It seems a Content object is being passed instead of the expected input type in the send_message method. I recommend following this doc.
If you still face issues, please provide your code snippet to replicate the same.
Hi @gmKeshari,
I used the same code as in the example of the "chat.py".
model = genai.GenerativeModel("gemini-1.5-flash") chat = model.start_chat( history=[ {"role": "user", "parts": "Hello"}, {"role": "model", "parts": "Great to meet you. What would you like to know?"}, ] ) response = chat.send_message("I have 2 dogs in my house.") print(response.text) response = chat.send_message("How many paws are in my house?") print(response.text)
When I execute this code, I get the error output as already posted in the previous message.
Description of the bug:
When I execute the example of the "chat.py" code, only the first execution of the command "response = chat.send_message(...)" works. Every further execution of the "send_message" function in the multi-turn chat fails.
Debug output attached. debug.txt