getTask

abstract suspend fun getTask(id: TaskId, historyLength: Int? = null): GetTaskResponse(source)

Gets a task from the server.

Retrieves a task by its ID, optionally including a specified number of history items to show the task's progression over time.

Return

The response containing the task details, status, and history if requested.

Parameters

id

The ID of the task to get.

historyLength

The number of history items to include (optional).


abstract suspend fun getTask(request: GetTaskRequest): GetTaskResponse(source)

Gets a task from the server using a pre-constructed request object.

This method allows for more control over the request, including setting a custom request ID and complete query parameters.

Return

The response containing the task details, status, and history if requested.

Parameters

request

The fully constructed task request containing ID and query parameters.