Skip to content

Commit 0039cf8

Browse files
committed
feat(summary): support list input for tool names
1 parent 7e82a31 commit 0039cf8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

reme_ai/summary/tool/summary_tool_memory_op.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import asyncio
2-
from typing import List
2+
from typing import List, Union
33

44
from flowllm import C, BaseAsyncOp
55
from flowllm.enumeration.role import Role
@@ -124,7 +124,7 @@ def parse_summary(message: Message) -> ToolMemory:
124124
return result
125125

126126
async def async_execute(self):
127-
tool_names: str = self.context.get("tool_names", "")
127+
tool_names: Union[str, List[str]] = self.context.get("tool_names", "")
128128
workspace_id: str = self.context.workspace_id
129129

130130
if not tool_names:
@@ -133,8 +133,14 @@ async def async_execute(self):
133133
self.context.response.success = False
134134
return
135135

136-
# Split tool names by comma
137-
tool_name_list = [name.strip() for name in tool_names.split(",") if name.strip()]
136+
# Normalize tool_names to list
137+
if isinstance(tool_names, str):
138+
# Split tool names by comma
139+
tool_name_list = [name.strip() for name in tool_names.split(",") if name.strip()]
140+
else:
141+
# Already a list
142+
tool_name_list = [name.strip() for name in tool_names if name.strip()]
143+
138144
logger.info(f"workspace_id={workspace_id} processing {len(tool_name_list)} tools: {tool_name_list}")
139145

140146
# Search for each tool in the vector store

0 commit comments

Comments
 (0)