Skip to content

Commit

Permalink
Fix 'ResourceWarning: unclosed <ssl.SSLSocket>' (#422)
Browse files Browse the repository at this point in the history
Change-Id: I013bd4b4d559913224a49f7a69c5daab78acc157
  • Loading branch information
MarkDaoust authored Jul 3, 2024
1 parent 63a15fe commit 12774d0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions google/generativeai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def _setup_discovery_api(self):
uri=f"{GENAI_API_DISCOVERY_URL}?version=v1beta&key={api_key}",
)
response, content = request.execute()
request.http.close()

discovery_doc = content.decode("utf-8")
self._discovery_api = googleapiclient.discovery.build_from_document(
Expand Down

0 comments on commit 12774d0

Please sign in to comment.