File "gemini-agents-toolkit/venv/lib/python3.11/site-packages/vertexai/generative_models/_generative_models.py", line 855, in _validate_response
raise ResponseValidationError(
vertexai.generative_models._generative_models.ResponseValidationError: The model response did not completed successfully.
Finish reason: 9.
Finish message: Malformed function call:
import json
data_from_prev_steps = {"individus": {"parent1": {"date_naissance": "1972-01-01", "depcom_entreprise": "69381", "primes_fonction_publique": 500}, "parent2": {"date_naissance": "1972-01-01", "depcom_entreprise": "69381", "primes_fonction_publique": 500, "traitement_indiciaire_brut": 2000}, "enfant1": {"date_naissance": "2000-01-01"}, "enfant2": {"date_naissance": "2009-01-01"}}}
print(default_api.write_file(path = 'examples/test_out.json', content = json.dumps(data_from_prev_steps)))
.
Safety ratings: [].
To protect the integrity of the chat session, the request and response were not added to chat history.
To skip the response validation, specify `model.start_chat(response_validation=False)`.
Note that letting blocked or otherwise incomplete responses into chat history might lead to future interactions being blocked by the service.
VertexAI checks responses and returns errors when code generated incorrectly (code link).
Task:
Work on the agent and pipelines execution code, add retry request for the case when a model returns error.
Add to the configuration: max number of retries (we don't want request the model endlessly) and the list of codes reasons for retries (not all errors need to have retries, the config will be allow retry list).
Context: Periodically observed issue:
VertexAI checks responses and returns errors when code generated incorrectly (code link).
Task: