Skip to content

Commit d3d03a0

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

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import pytest
1919
import pytest_asyncio
2020
from aioresponses import CallbackResult
21-
2221
from toolbox_core import ToolboxClient
2322
from toolbox_core.protocol import ManifestSchema, ParameterSchema, ToolSchema
2423

@@ -150,7 +149,7 @@ def token_handler():
150149
return expected_header
151150

152151
tool = await client.load_tool(
153-
tool_name, auth_service_tokens={"my-auth-service": token_handler}
152+
tool_name, auth_token_getters={"my-auth-service": token_handler}
154153
)
155154
res = await tool(5)
156155

0 commit comments

Comments
 (0)