Skip to content

datarobot_genai.dragent.frontends.response

response

run_error_response

run_error_response(message: str, *, code: str = RUN_ERROR_CODE) -> DRAgentEventResponse

Terminal AG-UI RUN_ERROR response, so a run can end in-band instead of raising.

Source code in datarobot_genai/dragent/frontends/response.py
def run_error_response(message: str, *, code: str = RUN_ERROR_CODE) -> DRAgentEventResponse:
    """Terminal AG-UI ``RUN_ERROR`` response, so a run can end in-band instead of raising."""
    return DRAgentEventResponse(
        events=[RunErrorEvent(message=message, code=code)],
        usage_metrics=default_usage_metrics(),
    )