mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-11 08:28:11 -05:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b482dbf8e0 |
@@ -101,6 +101,9 @@ authentication token.
|
||||
TOOLBOX_URL = "https://your-toolbox-service-xyz.a.run.app"
|
||||
|
||||
# Initialize the client with the Cloud Run URL and Auth headers
|
||||
# WARNING: There is a known issue that may cause it to fail with a 401 error
|
||||
# on local machines.
|
||||
# See https://github.com/googleapis/mcp-toolbox-sdk-python/issues/496
|
||||
client = ToolboxSyncClient(
|
||||
TOOLBOX_URL,
|
||||
client_headers={"Authorization": auth_methods.get_google_id_token(TOOLBOX_URL)}
|
||||
|
||||
@@ -211,6 +211,9 @@ from toolbox_core import ToolboxClient, auth_methods
|
||||
# Replace with the Cloud Run service URL generated in the previous step
|
||||
URL = "https://cloud-run-url.app"
|
||||
|
||||
# WARNING: There is a known issue that may cause it to fail with a 401 error
|
||||
# on local machines.
|
||||
# See https://github.com/googleapis/mcp-toolbox-sdk-python/issues/496
|
||||
auth_token_provider = auth_methods.aget_google_id_token(URL) # can also use sync method
|
||||
|
||||
async def main():
|
||||
|
||||
Reference in New Issue
Block a user