Skip to content

Commit

Permalink
Disable response validation
Browse files Browse the repository at this point in the history
  • Loading branch information
vojay-dev committed Apr 8, 2024
1 parent b99bec2 commit 581d1a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gemini_movie_detectives_api/gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ def __init__(self, project_id: str, location: str, credentials: Credentials, mod
def start_chat(self) -> ChatSession:
# noinspection PyBroadException
try:
return self.model.start_chat()
return self.model.start_chat(response_validation=False)
except Exception as e:
logger.warning(
'error while using model %s, using fallback model %s, error: %s',
self.model,
self.FALLBACK_MODEL,
e
)
return self.fallback_model.start_chat()
return self.fallback_model.start_chat(response_validation=False)

@staticmethod
def get_chat_response(chat: ChatSession, prompt: str) -> str:
Expand Down

0 comments on commit 581d1a4

Please sign in to comment.