Skip to content

_documents

DocumentFormat

Bases: StrEnum

Source code in horde_sdk/ai_horde_api/apimodels/_documents.py
class DocumentFormat(StrEnum):
    html = "html"
    markdown = "markdown"

html class-attribute instance-attribute

html = 'html'

markdown class-attribute instance-attribute

markdown = 'markdown'

HordeDocument

Bases: HordeResponseBaseModel

Source code in horde_sdk/ai_horde_api/apimodels/_documents.py
class HordeDocument(HordeResponseBaseModel):
    html: str | None = None
    """The HTML content of the document, if requested."""
    markdown: str | None = None
    """The markdown content of the document, if requested."""

    @override
    @classmethod
    def get_api_model_name(cls) -> str:
        return "HordeDocument"

html class-attribute instance-attribute

html: str | None = None

The HTML content of the document, if requested.

markdown class-attribute instance-attribute

markdown: str | None = None

The markdown content of the document, if requested.

get_api_model_name classmethod

get_api_model_name() -> str
Source code in horde_sdk/ai_horde_api/apimodels/_documents.py
@override
@classmethod
def get_api_model_name(cls) -> str:
    return "HordeDocument"

AIHordeDocumentRequestMixin

Bases: HordeAPIObjectBaseModel

Source code in horde_sdk/ai_horde_api/apimodels/_documents.py
class AIHordeDocumentRequestMixin(HordeAPIObjectBaseModel):
    format: DocumentFormat | str = DocumentFormat.html

    """The format of the document to return. Default is markdown."""

    @field_validator("format")
    def validate_format(cls, value: DocumentFormat | str) -> DocumentFormat | str:
        if isinstance(value, DocumentFormat):
            return value

        try:
            DocumentFormat(value)
        except ValueError:
            logger.warning(f"Unknown document format: {value}. Is your SDK out of date or did the API change?")

        return value

format class-attribute instance-attribute

format: DocumentFormat | str = html

The format of the document to return. Default is markdown.

validate_format

validate_format(value: DocumentFormat | str) -> DocumentFormat | str
Source code in horde_sdk/ai_horde_api/apimodels/_documents.py
@field_validator("format")
def validate_format(cls, value: DocumentFormat | str) -> DocumentFormat | str:
    if isinstance(value, DocumentFormat):
        return value

    try:
        DocumentFormat(value)
    except ValueError:
        logger.warning(f"Unknown document format: {value}. Is your SDK out of date or did the API change?")

    return value

AIHordeGetPrivacyPolicyRequest

Bases: BaseAIHordeRequest, AIHordeDocumentRequestMixin

Source code in horde_sdk/ai_horde_api/apimodels/_documents.py
class AIHordeGetPrivacyPolicyRequest(BaseAIHordeRequest, AIHordeDocumentRequestMixin):
    @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_documents_privacy

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

get_api_model_name classmethod

get_api_model_name() -> str | None
Source code in horde_sdk/ai_horde_api/apimodels/_documents.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/_documents.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/_documents.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_documents_privacy

get_default_success_response_type classmethod

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

AIHordeGetSponsorsRequest

Bases: BaseAIHordeRequest, AIHordeDocumentRequestMixin

Source code in horde_sdk/ai_horde_api/apimodels/_documents.py
class AIHordeGetSponsorsRequest(BaseAIHordeRequest, AIHordeDocumentRequestMixin):
    @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_documents_sponsors

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

get_api_model_name classmethod

get_api_model_name() -> str | None
Source code in horde_sdk/ai_horde_api/apimodels/_documents.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/_documents.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/_documents.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_documents_sponsors

get_default_success_response_type classmethod

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

AIHordeGetTermsRequest

Bases: BaseAIHordeRequest, AIHordeDocumentRequestMixin

Source code in horde_sdk/ai_horde_api/apimodels/_documents.py
class AIHordeGetTermsRequest(BaseAIHordeRequest, AIHordeDocumentRequestMixin):
    @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_documents_terms

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

get_api_model_name classmethod

get_api_model_name() -> str | None
Source code in horde_sdk/ai_horde_api/apimodels/_documents.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/_documents.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/_documents.py
@override
@classmethod
def get_api_endpoint_subpath(cls) -> AI_HORDE_API_ENDPOINT_SUBPATH:
    return AI_HORDE_API_ENDPOINT_SUBPATH.v2_documents_terms

get_default_success_response_type classmethod

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