Skip to content

Commit cc85ce7

Browse files
authored
Revert "Use api_endpoint for uploads (#330)" (#333)
This reverts commit bb58ab8.
1 parent bb58ab8 commit cc85ce7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

google/generativeai/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
__version__ = "0.0.0"
2828

2929
USER_AGENT = "genai-py"
30+
GENAI_API_DISCOVERY_URL = "https://generativelanguage.googleapis.com/$discovery/rest"
3031

3132

3233
class FileServiceClient(glm.FileServiceClient):
@@ -42,7 +43,7 @@ def _setup_discovery_api(self):
4243
request = googleapiclient.http.HttpRequest(
4344
http=httplib2.Http(),
4445
postproc=lambda resp, content: (resp, content),
45-
uri=f"https://{self.api_endpoint}/$discovery/rest?version=v1beta&key={api_key}",
46+
uri=f"{GENAI_API_DISCOVERY_URL}?version=v1beta&key={api_key}",
4647
)
4748
response, content = request.execute()
4849

0 commit comments

Comments
 (0)