diff --git a/google/colab/_import_hooks/_generativeai.py b/google/colab/_import_hooks/_generativeai.py index e945a293..3ed833da 100644 --- a/google/colab/_import_hooks/_generativeai.py +++ b/google/colab/_import_hooks/_generativeai.py @@ -91,7 +91,7 @@ async def _handle_request(self): self.set_status(int(result['error']['code'])) self.write(result['error']['message']) return - self.write(result) + self.write(json.dumps(result)) except Exception as e: # pylint:disable=broad-except self.set_status(500) self.write(str(e))