Skip to content
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

vertexai.generative_models._generative_models.ResponseValidationError: The model response did not complete successfully. #530

Closed
shashank-v-gowda opened this issue Aug 27, 2024 · 0 comments

Comments

@shashank-v-gowda
Copy link

shashank-v-gowda commented Aug 27, 2024

Description of the bug:

I'm getting the below error whenever I try to analyze any code using gemini api. I've tried it with different prompts and codes, it's throwing the same error.
raise ResponseValidationError(
vertexai.generative_models._generative_models.ResponseValidationError: The model response did not complete successfully.
Finish reason: 2.
Finish message: .
Safety ratings: [category: HARM_CATEGORY_HATE_SPEECH
probability: NEGLIGIBLE
probability_score: 0.388671875
severity: HARM_SEVERITY_NEGLIGIBLE
severity_score: 0.188476562
, category: HARM_CATEGORY_DANGEROUS_CONTENT
probability: NEGLIGIBLE
probability_score: 0.3359375
severity: HARM_SEVERITY_LOW
severity_score: 0.28125
, category: HARM_CATEGORY_HARASSMENT
probability: NEGLIGIBLE
probability_score: 0.388671875
severity: HARM_SEVERITY_LOW
severity_score: 0.2734375
, category: HARM_CATEGORY_SEXUALLY_EXPLICIT
probability: NEGLIGIBLE
probability_score: 0.255859375
severity: HARM_SEVERITY_LOW
severity_score: 0.249023438
].

I've added the below safety settings, still I'm facing the same issue.
safety_settings = {
HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE,
HarmCategory.HARM_CATEGORY_HATE_SPEECH: HarmBlockThreshold.BLOCK_NONE,
HarmCategory.HARM_CATEGORY_HARASSMENT: HarmBlockThreshold.BLOCK_NONE,
HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: HarmBlockThreshold.BLOCK_NONE,
}

@shashank-v-gowda shashank-v-gowda changed the title Unable to run a function calling prompt vertexai.generative_models._generative_models.ResponseValidationError: The model response did not complete successfully. Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant