Skip to content

Commit 6d46291

Browse files
authored
refactor: add kwargs to multiagent interfaces (strands-agents#454)
1 parent 4167c5c commit 6d46291

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/strands/multiagent/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from abc import ABC, abstractmethod
77
from dataclasses import dataclass, field
88
from enum import Enum
9-
from typing import Union
9+
from typing import Any, Union
1010

1111
from ..agent import AgentResult
1212
from ..types.content import ContentBlock
@@ -76,11 +76,11 @@ class MultiAgentBase(ABC):
7676
"""
7777

7878
@abstractmethod
79-
async def execute_async(self, task: str | list[ContentBlock]) -> MultiAgentResult:
79+
async def execute_async(self, task: str | list[ContentBlock], **kwargs: Any) -> MultiAgentResult:
8080
"""Execute task asynchronously."""
8181
raise NotImplementedError("execute_async not implemented")
8282

8383
@abstractmethod
84-
def execute(self, task: str | list[ContentBlock]) -> MultiAgentResult:
84+
def execute(self, task: str | list[ContentBlock], **kwargs: Any) -> MultiAgentResult:
8585
"""Execute task synchronously."""
8686
raise NotImplementedError("execute not implemented")

src/strands/multiagent/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def __init__(self, nodes: dict[str, GraphNode], edges: set[GraphEdge], entry_poi
254254
self.state = GraphState()
255255
self.tracer = get_tracer()
256256

257-
def execute(self, task: str | list[ContentBlock]) -> GraphResult:
257+
def execute(self, task: str | list[ContentBlock], **kwargs: Any) -> GraphResult:
258258
"""Execute task synchronously."""
259259

260260
def execute() -> GraphResult:
@@ -264,7 +264,7 @@ def execute() -> GraphResult:
264264
future = executor.submit(execute)
265265
return future.result()
266266

267-
async def execute_async(self, task: str | list[ContentBlock]) -> GraphResult:
267+
async def execute_async(self, task: str | list[ContentBlock], **kwargs: Any) -> GraphResult:
268268
"""Execute the graph asynchronously."""
269269
logger.debug("task=<%s> | starting graph execution", task)
270270

0 commit comments

Comments
 (0)