Skip to content

Commit e6a81b1

Browse files
resolve: issue
1 parent 0a50ab2 commit e6a81b1

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

src/amrita_core/builtins/agent.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,24 @@ async def append_reasoning_msg(
139139
)
140140
await _append_reasoning(msg, response)
141141

142-
async def run_tools(
142+
async def continue_by_run(
143143
msg_list: list,
144144
call_count: int,
145145
original_msg: str = "",
146146
) -> bool:
147+
"""One term for function calling.
148+
149+
Args:
150+
msg_list (list): Context
151+
call_count (int): Called times.
152+
original_msg (str, optional): Original message (Used for reasoning). Defaults to "".
153+
154+
Raises:
155+
RuntimeError: Raised on response error.
156+
157+
Returns:
158+
bool: Should continue to call next round.
159+
"""
147160
suggested_stop: bool = False
148161

149162
def stop_running():
@@ -359,7 +372,7 @@ def stop_running():
359372
try:
360373
for i in range(1, config.function_config.agent_tool_call_limit + 1):
361374
if not (
362-
await run_tools(
375+
await continue_by_run(
363376
msg_list,
364377
i,
365378
original_msg=event.original_context
@@ -388,7 +401,7 @@ def stop_running():
388401
Message(
389402
role="user",
390403
content="Too much tools called,please call later or follow user's instruction."
391-
+ "Now please continue to completion.",
404+
+ "Now please continue to completion and NOT to call tools.",
392405
)
393406
)
394407
event.message.extend(msg_list[current_length:])

0 commit comments

Comments
 (0)