Skip to content

Commit 8d89e60

Browse files
committed
change docs
1 parent d549d7d commit 8d89e60

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

packages/toolbox-core/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,10 @@ For Toolbox servers hosted on Google Cloud (e.g., Cloud Run) and requiring
335335
3. **Connect to the Toolbox Server**
336336

337337
```python
338+
from functools import partial
338339
from toolbox_core import auth_methods
339340

340-
auth_token_provider = auth_methods.aget_google_id_token # can also use sync method
341+
auth_token_provider = partial(auth_methods.aget_google_id_token, URL) # can also use sync method
341342
async with ToolboxClient(
342343
URL,
343344
client_headers={"Authorization": auth_token_provider},

packages/toolbox-core/src/toolbox_core/auth_methods.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
from toolbox_core import auth_methods
2323
from functools import partial
2424
25+
URL = "https://toolbox-service-url"
2526
auth_token_provider = functools.partial(
2627
auth_methods.aget_google_id_token,
27-
"https://toolbox-service-url"
28+
URL
2829
)
2930
async with ToolboxClient(
3031
URL,

packages/toolbox-langchain/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,11 @@ For Toolbox servers hosted on Google Cloud (e.g., Cloud Run) and requiring
269269
3. **Connect to the Toolbox Server**
270270

271271
```python
272+
from functools import partial
272273
from toolbox_langchain import ToolboxClient
273274
from toolbox_core import auth_methods
274275

275-
auth_token_provider = auth_methods.aget_google_id_token # can also use sync method
276+
auth_token_provider = partial(auth_methods.aget_google_id_token, URL) # can also use sync method
276277
async with ToolboxClient(
277278
URL,
278279
client_headers={"Authorization": auth_token_provider},

packages/toolbox-llamaindex/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,11 @@ For Toolbox servers hosted on Google Cloud (e.g., Cloud Run) and requiring
248248
3. **Connect to the Toolbox Server**
249249

250250
```python
251+
from functools import partial
251252
from toolbox_llamaindex import ToolboxClient
252253
from toolbox_core import auth_methods
253254

254-
auth_token_provider = auth_methods.aget_google_id_token # can also use sync method
255+
auth_token_provider = partial(auth_methods.aget_google_id_token, URL)
255256
async with ToolboxClient(
256257
URL,
257258
client_headers={"Authorization": auth_token_provider},

0 commit comments

Comments
 (0)