diff --git a/llama_stack/apis/agents/agents.py b/llama_stack/apis/agents/agents.py index eb1cdde90..c904fdbef 100644 --- a/llama_stack/apis/agents/agents.py +++ b/llama_stack/apis/agents/agents.py @@ -296,7 +296,7 @@ class AgentTurnCreateRequest(AgentConfigOverridablePerTurn): stream: Optional[bool] = False tool_config: Optional[ToolConfig] = None - # TODO (xiyan): used for backward compatibility, update for 0.1.5 + # TODO (xiyan): temporary flag, will remove for 0.1.5 allow_turn_resume: Optional[bool] = False @@ -369,7 +369,19 @@ class Agents(Protocol): turn_id: str, tool_responses: List[ToolResponseMessage], stream: Optional[bool] = False, - ) -> Union[Turn, AsyncIterator[AgentTurnResponseStreamChunk]]: ... + ) -> Union[Turn, AsyncIterator[AgentTurnResponseStreamChunk]]: + """Resume an agent turn with executed tool call responses. + + When a Turn has the status `awaiting_input` due to pending input from client side tool calls, this endpoint can be used to submit the outputs from the tool calls once they are ready. + + :param agent_id: The ID of the agent to resume. + :param session_id: The ID of the session to resume. + :param turn_id: The ID of the turn to resume. + :param tool_responses: The tool call responses to resume the turn with. + :param stream: Whether to stream the response. + :returns: A Turn object if stream is False, otherwise an AsyncIterator of AgentTurnResponseStreamChunk objects. + """ + ... @webmethod( route="/agents/{agent_id}/session/{session_id}/turn/{turn_id}",