Skip to content

Commit 61d32aa

Browse files
committed
chore: correct arg name
1 parent 0dc7034 commit 61d32aa

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async def close(self):
119119
async def load_tool(
120120
self,
121121
name: str,
122-
auth_service_tokens: dict[str, Callable[[], str]] = {},
122+
auth_token_getters: dict[str, Callable[[], str]] = {},
123123
) -> ToolboxTool:
124124
"""
125125
Asynchronously loads a tool from the server.
@@ -130,6 +130,8 @@ async def load_tool(
130130
131131
Args:
132132
name: The unique name or identifier of the tool to load.
133+
auth_token_getters: A mapping of authentication service names to
134+
callables that return the corresponding authentication token.
133135
134136
Returns:
135137
ToolboxTool: A callable object representing the loaded tool, ready
@@ -148,7 +150,7 @@ async def load_tool(
148150
if name not in manifest.tools:
149151
# TODO: Better exception
150152
raise Exception(f"Tool '{name}' not found!")
151-
tool = self.__parse_tool(name, manifest.tools[name], auth_service_tokens)
153+
tool = self.__parse_tool(name, manifest.tools[name], auth_token_getters)
152154

153155
return tool
154156

@@ -162,6 +164,9 @@ async def load_toolset(
162164
163165
Args:
164166
name: Name of the toolset to load tools.
167+
auth_token_getters: A mapping of authentication service names to
168+
callables that return the corresponding authentication token.
169+
165170
166171
Returns:
167172
list[ToolboxTool]: A list of callables, one for each tool defined

packages/toolbox-core/tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def token_handler():
150150
return expected_header
151151

152152
tool = await client.load_tool(
153-
tool_name, auth_service_tokens={"my-auth-service": token_handler}
153+
tool_name, auth_token_getters={"my-auth-service": token_handler}
154154
)
155155
res = await tool(5)
156156

0 commit comments

Comments
 (0)