Skip to content

invoke_act_step

invoke_act_step(
    workflow_definition_name: WorkflowDefinitionName,
    workflow_run_id: UuidString,
    session_id: UuidString,
    act_id: UuidString,
    call_results: CallResults,
    *,
    config_overrides: Optional[NovaActClientConfig] = None,
    previous_step_id: Optional[UuidString] = None,
) -> InvokeActStepResponse

Executes the next step of an act, processing tool call results and returning new tool calls if needed.

Parameters:

  • workflow_definition_name (WorkflowDefinitionName) –

    The name of the workflow definition containing the act.

  • workflow_run_id (UuidString) –

    The unique identifier of the workflow run containing the act.

  • session_id (UuidString) –

    The unique identifier of the session containing the act.

  • act_id (UuidString) –

    The unique identifier of the act to invoke the next step for.

  • call_results (CallResults) –

    The results from previous tool calls that the act requested.

  • previous_step_id (Optional[UuidString], default: None ) –

    The identifier of the previous step, used for tracking execution flow.

Raises:

Source code in docs_src/capo_nova_act/_services/nova_act.py
def invoke_act_step(
    self,
    workflow_definition_name: "capo_nova_act.types.workflow_definition_name.WorkflowDefinitionName",
    workflow_run_id: "capo_nova_act.types.uuid_string.UuidString",
    session_id: "capo_nova_act.types.uuid_string.UuidString",
    act_id: "capo_nova_act.types.uuid_string.UuidString",
    call_results: "capo_nova_act.types.call_results.CallResults",
    *,
    config_overrides: Optional[NovaActClientConfig] = None,
    previous_step_id: Optional["capo_nova_act.types.uuid_string.UuidString"] = None,
) -> "capo_nova_act.types.invoke_act_step_response.InvokeActStepResponse":
    """<p>Executes the next step of an act, processing tool call results and returning new tool calls if needed.</p>

    Args:
        workflow_definition_name: <p>The name of the workflow definition containing the act.</p>
        workflow_run_id: <p>The unique identifier of the workflow run containing the act.</p>
        session_id: <p>The unique identifier of the session containing the act.</p>
        act_id: <p>The unique identifier of the act to invoke the next step for.</p>
        call_results: <p>The results from previous tool calls that the act requested.</p>
        previous_step_id: <p>The identifier of the previous step, used for tracking execution flow.</p>

    Raises:
        capo_nova_act.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_nova_act.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the resource.</p>
        capo_nova_act.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Please try again later.</p>
        capo_nova_act.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_nova_act.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota limit.</p>
        capo_nova_act.errors.throttling_exception.ThrottlingException: <p>The request was throttled due to too many requests. Please try again later.</p>
        capo_nova_act.errors.validation_exception.ValidationException: <p>The input parameters for the request are invalid.</p>
        capo_nova_act.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_nova_act.types.invoke_act_step_request.InvokeActStepRequest]",
    ) -> OperationResponse[
        "capo_nova_act.types.invoke_act_step_response.InvokeActStepResponse"
    ]:
        import capo_nova_act._operations.amazon_nova_agents_data_plane.invoke_act_step

        output, http_response = (
            capo_nova_act._operations.amazon_nova_agents_data_plane.invoke_act_step.invoke_act_step(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_nova_act.types.invoke_act_step_request.InvokeActStepRequest",
    ) -> dict[str, Any]:
        import capo_nova_act.types.invoke_act_step_request

        return capo_nova_act.types.invoke_act_step_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_nova_act.types.invoke_act_step_response.InvokeActStepResponse",
    ) -> dict[str, Any]:
        import capo_nova_act.types.invoke_act_step_response

        return capo_nova_act.types.invoke_act_step_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "InvokeActStep",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_nova_act.types.invoke_act_step_request.InvokeActStepRequest = {
        "workflow_definition_name": workflow_definition_name,
        "workflow_run_id": workflow_run_id,
        "session_id": session_id,
        "act_id": act_id,
        "call_results": call_results,
    }
    if previous_step_id is not None:
        input_["previous_step_id"] = previous_step_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output