mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-12 13:00:39 +00:00
max infer iters
This commit is contained in:
parent
e157f0ac89
commit
2fc64d611f
1 changed files with 4 additions and 0 deletions
|
@ -655,6 +655,9 @@ class ChatAgent(ShieldRunnerMixin):
|
||||||
|
|
||||||
if n_iter >= self.agent_config.max_infer_iters:
|
if n_iter >= self.agent_config.max_infer_iters:
|
||||||
log.info("Done with MAX iterations, exiting.")
|
log.info("Done with MAX iterations, exiting.")
|
||||||
|
# we always resume tool call, so we need a way to indicate to client that we are done
|
||||||
|
# currently let's do it with having the tool call be
|
||||||
|
message.stop_reason = StopReason.end_of_turn
|
||||||
yield message
|
yield message
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -704,6 +707,7 @@ class ChatAgent(ShieldRunnerMixin):
|
||||||
|
|
||||||
# If tool is a client tool, yield CompletionMessage and return
|
# If tool is a client tool, yield CompletionMessage and return
|
||||||
if tool_call.tool_name in client_tools:
|
if tool_call.tool_name in client_tools:
|
||||||
|
message.stop_reason = StopReason.end_of_message
|
||||||
await self.storage.set_in_progress_tool_call_step(
|
await self.storage.set_in_progress_tool_call_step(
|
||||||
session_id,
|
session_id,
|
||||||
turn_id,
|
turn_id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue