Skip to content

Commit bb58ab8

Browse files
authored
Use api_endpoint for uploads (#330)
Change-Id: I1babfdc6fee0a1ceefb590966d1e2e88a338b19c
1 parent e09e7f2 commit bb58ab8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

google/generativeai/client.py

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

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

3231

3332
class FileServiceClient(glm.FileServiceClient):
@@ -43,7 +42,7 @@ def _setup_discovery_api(self):
4342
request = googleapiclient.http.HttpRequest(
4443
http=httplib2.Http(),
4544
postproc=lambda resp, content: (resp, content),
46-
uri=f"{GENAI_API_DISCOVERY_URL}?version=v1beta&key={api_key}",
45+
uri=f"https://{self.api_endpoint}/$discovery/rest?version=v1beta&key={api_key}",
4746
)
4847
response, content = request.execute()
4948

0 commit comments

Comments
 (0)