Skip to content

Commit

Permalink
Use api_endpoint for uploads (#330)
Browse files Browse the repository at this point in the history
Change-Id: I1babfdc6fee0a1ceefb590966d1e2e88a338b19c
  • Loading branch information
MarkDaoust committed May 9, 2024
1 parent e09e7f2 commit bb58ab8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions google/generativeai/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
__version__ = "0.0.0"

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


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

Expand Down

0 comments on commit bb58ab8

Please sign in to comment.