Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix: return payload without parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dsdanielpark committed Mar 18, 2024
1 parent 117b01e commit 51bfed4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions gemini/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,14 @@ def generate_content(
f"Non-successful response status: {response_status_code}. Check Gemini session status."
)
return None

parser = ResponseParser(cookies=self.cookies)
parsed_response = parser.parse(response_text)
return self._create_model_output(parsed_response)
except Exception as e:
print(
f"Failed to generate content due to an error: {e}.\nIf the issue persists, submit it at https://github.com/dsdanielpark/Gemini-API/issues"
f"Failed to generate content due to an error: {e}.\nReturn reponse without parse. If the issue persists, submit it at https://github.com/dsdanielpark/Gemini-API/issues"
)
return None
return response_text

def _create_model_output(self, parsed_response: dict) -> GeminiModelOutput:
"""
Expand Down

0 comments on commit 51bfed4

Please sign in to comment.