Closed Snigdha8 closed 5 months ago
The model you're using does not support returning multiple candidates (as the error message indicates). I'm not sure any publicly released model currently supports multiple candidates. The support for multiple candidates might be added in the future.
If there is another way of getting all responses from LLM, please share.
To get multiple responses, you can call generate_content
multiple times.
I want to obtain all the possible candidates from the response of Gemini 1.0. In the code, when candidate_count = 1, it returns some response with 1 candidate. But when candidate_count > 1, then it returns the below error -
Below is my code -
In general I have noticed for all the responses from Gemini, by default only 1 response is returned.
I am following the below documentation - https://ai.google.dev/api/python/google/generativeai/GenerationConfig https://ai.google.dev/api/rest/v1/GenerateContentResponse
Can someone please tell why candidate_count is not accepting values greater than 1, when the documentation mentions it as a configurable parameter? If there is another way of getting all responses from LLM, please share.