Skip to content

Commit d1978f1

Browse files
committed
chore: typing
1 parent 6cee834 commit d1978f1

5 files changed

Lines changed: 9 additions & 15 deletions

File tree

src/agentpool/resource_providers/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def create_tool(
212212
category=category,
213213
source=self.name,
214214
requires_confirmation=requires_confirmation,
215-
metadata=metadata,
215+
meta=metadata,
216216
name_override=name_override,
217217
description_override=description_override,
218218
schema_override=schema_override,

src/agentpool/resource_providers/static.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def register_tool(
152152
name_override=name_override,
153153
description_override=description_override,
154154
requires_confirmation=requires_confirmation,
155-
metadata=metadata or {},
155+
meta=metadata or {},
156156
)
157157
case _ as unreachable:
158158
assert_never(unreachable) # ty:ignore[type-assertion-failure]
@@ -209,7 +209,6 @@ def tool(
209209
enabled: bool = True,
210210
requires_confirmation: bool = False,
211211
metadata: dict[str, str] | None = None,
212-
**kwargs: Any,
213212
) -> Callable[[Callable[..., Any]], Callable[..., Any]]: ...
214213

215214
def tool(
@@ -221,7 +220,6 @@ def tool(
221220
enabled: bool = True,
222221
requires_confirmation: bool = False,
223222
metadata: dict[str, str] | None = None,
224-
**kwargs: Any,
225223
) -> Callable[..., Any] | Callable[[Callable[..., Any]], Callable[..., Any]]:
226224
"""Decorator to register a function as a tool.
227225
@@ -246,7 +244,6 @@ def another_function(y: str) -> str:
246244
enabled: Whether tool is initially enabled
247245
requires_confirmation: Whether execution needs confirmation
248246
metadata: Additional tool metadata
249-
**kwargs: Additional arguments passed to Tool.from_callable
250247
"""
251248
from agentpool.tools.base import FunctionTool
252249

@@ -257,8 +254,7 @@ def decorator(f: Callable[..., Any]) -> Callable[..., Any]:
257254
description_override=description,
258255
enabled=enabled,
259256
requires_confirmation=requires_confirmation,
260-
metadata=metadata or {},
261-
**kwargs,
257+
meta=metadata or {},
262258
)
263259
self.add_tool(tool)
264260
return f

src/agentpool/tools/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ def from_callable(
274274
category: ToolKind | None = None,
275275
enabled: bool = True,
276276
source: ToolSource | str | None = None,
277-
**kwargs: Any,
277+
requires_confirmation: bool = False,
278+
meta: dict[str, Any] | None = None,
278279
) -> FunctionTool[TOutputType]:
279280
"""Create a FunctionTool from a callable or import path string."""
280281
from agentpool.utils import importing
@@ -301,7 +302,8 @@ def from_callable(
301302
hints=hints or ToolHints(),
302303
enabled=enabled,
303304
source=source or "dynamic",
304-
**kwargs,
305+
requires_confirmation=requires_confirmation,
306+
meta=meta or {},
305307
)
306308

307309

src/agentpool_config/tools.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ class BaseToolConfig(Schema):
8282
metadata: dict[str, str] = Field(default_factory=dict, title="Tool metadata")
8383
"""Additional tool metadata."""
8484

85-
instructions: str | None = Field(default=None, title="Tool instructions")
86-
"""Instructions for how to use this tool effectively."""
87-
8885
model_config = ConfigDict(frozen=True)
8986

9087
def get_tool(self) -> Tool:
@@ -123,6 +120,5 @@ def get_tool(self) -> Tool:
123120
description_override=self.description,
124121
enabled=self.enabled,
125122
requires_confirmation=self.requires_confirmation,
126-
metadata=self.metadata,
127-
instructions=self.instructions,
123+
meta=self.metadata,
128124
)

tests/servers/acp_server/test_mcp_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def dummy_mcp_tool(query: str) -> str:
153153
return f"MCP result for: {query}"
154154

155155
meta = {"mcp_tool": "dummy_search"}
156-
tool = FunctionTool.from_callable(dummy_mcp_tool, source="mcp", metadata=meta)
156+
tool = FunctionTool.from_callable(dummy_mcp_tool, source="mcp", meta=meta)
157157

158158
agent.tools.register_tool(tool)
159159

0 commit comments

Comments
 (0)