Skip to content

Commit 0c360a1

Browse files
committed
Add notes describing interaction of the discovery URL and API endpoint.
Change-Id: Ibb8740fd548cc8a8a75b32508d6d05aa6e89f633
1 parent 9f2efed commit 0c360a1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

google/generativeai/client.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@
3131
__version__ = "0.0.0"
3232

3333
USER_AGENT = "genai-py"
34+
35+
#### Caution! ####
36+
# - It would make sense for the discovery URL to respect the client_options.endpoint setting.
37+
# - That would make testing Files on the staging server possible.
38+
# - We tried fixing this once, but broke colab in the process because their endpoint didn't forward the discovery
39+
# requests. https://github.com/google-gemini/generative-ai-python/pull/333
40+
# - Kaggle would have a similar problem (b/362278209).
41+
# - I think their proxy would forward the discovery traffic.
42+
# - But they don't need to intercept the files-service at all, and uploads of large files could overload them.
43+
# - Do the scotty uploads go to the same domain?
44+
# - One solution to all this would be if configure could take overrides per service.
45+
# - set client_options.endpoint, but use a different endpoint for file service? It's not clear how best to do that
46+
# through the file service.
47+
##################
3448
GENAI_API_DISCOVERY_URL = "https://generativelanguage.googleapis.com/$discovery/rest"
3549

3650

0 commit comments

Comments
 (0)