Skip to content

horde_sdk.ai_horde_api.apimodels.generate.check

ImageGenerateCheckResponse

Bases: HordeResponseBaseModel, ResponseWithProgressMixin, ResponseGenerationProgressInfoMixin

The progress of an image request. This does not return any image data.

Represents the data returned from the following endpoints and http status codes
  • /v2/generate/check/{id} | ImageGenerateCheckRequest [GET] -> 200

v2 API Model: RequestStatusCheck

Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
class ImageGenerateCheckResponse(
    HordeResponseBaseModel,
    ResponseWithProgressMixin,
    ResponseGenerationProgressInfoMixin,
):
    """The progress of an image request. This does not return any image data.

    Represents the data returned from the following endpoints and http status codes:
        - /v2/generate/check/{id} | ImageGenerateCheckRequest [GET] -> 200

    v2 API Model: `RequestStatusCheck`
    """

    @override
    @classmethod
    def get_api_model_name(cls) -> str | None:
        return "RequestStatusCheck"

    @override
    def is_job_complete(self, number_of_result_expected: int) -> bool:
        if self.done and self.finished != number_of_result_expected:
            logger.error(
                "There is a mismatch between the number of results expected and the number of results "
                "finished. This should not happen - tell the developers about this error.",
            )
        return self.done

    @override
    def is_job_possible(self) -> bool:
        return self.is_possible

    @override
    @classmethod
    def get_finalize_success_request_type(cls) -> type[ImageGenerateStatusRequest]:
        return ImageGenerateStatusRequest

get_api_model_name classmethod

get_api_model_name() -> str | None
Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
@override
@classmethod
def get_api_model_name(cls) -> str | None:
    return "RequestStatusCheck"

is_job_complete

is_job_complete(number_of_result_expected: int) -> bool
Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
@override
def is_job_complete(self, number_of_result_expected: int) -> bool:
    if self.done and self.finished != number_of_result_expected:
        logger.error(
            "There is a mismatch between the number of results expected and the number of results "
            "finished. This should not happen - tell the developers about this error.",
        )
    return self.done

is_job_possible

is_job_possible() -> bool
Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
@override
def is_job_possible(self) -> bool:
    return self.is_possible

get_finalize_success_request_type classmethod

get_finalize_success_request_type() -> (
    type[ImageGenerateStatusRequest]
)
Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
@override
@classmethod
def get_finalize_success_request_type(cls) -> type[ImageGenerateStatusRequest]:
    return ImageGenerateStatusRequest

ImageGenerateCheckRequest

Bases: BaseAIHordeRequest, JobRequestMixin

Request the progress of an image request.

This is the preferred way to check the progress of a generate request.

Represents a GET request to the /v2/generate/check/{id} endpoint.

Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
class ImageGenerateCheckRequest(BaseAIHordeRequest, JobRequestMixin):
    """Request the progress of an image request.

    This is the preferred way to check the progress of a generate request.

    Represents a GET request to the /v2/generate/check/{id} endpoint.
    """

    @override
    @classmethod
    def get_api_model_name(cls) -> str | None:
        return None

    @override
    @classmethod
    def get_http_method(cls) -> HTTPMethod:
        return HTTPMethod.GET

    @override
    @classmethod
    def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
        return AI_HORDE_API_ENDPOINT_SUBPATH.v2_generate_check

    @override
    @classmethod
    def get_default_success_response_type(cls) -> type[ImageGenerateCheckResponse]:
        return ImageGenerateCheckResponse

get_api_model_name classmethod

get_api_model_name() -> str | None
Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
@override
@classmethod
def get_api_model_name(cls) -> str | None:
    return None

get_http_method classmethod

get_http_method() -> HTTPMethod
Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
@override
@classmethod
def get_http_method(cls) -> HTTPMethod:
    return HTTPMethod.GET

get_api_endpoint_subpath classmethod

get_api_endpoint_subpath() -> AI_HORDE_API_ENDPOINT_SUBPATH
Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_generate_check

get_default_success_response_type classmethod

get_default_success_response_type() -> (
    type[ImageGenerateCheckResponse]
)
Source code in horde_sdk/ai_horde_api/apimodels/generate/check.py
@override
@classmethod
def get_default_success_response_type(cls) -> type[ImageGenerateCheckResponse]:
    return ImageGenerateCheckResponse