From 1423f2700785854ac511e38d88e7e61dd9a5e427 Mon Sep 17 00:00:00 2001 From: db0 Date: Sun, 15 Sep 2024 12:54:53 +0200 Subject: [PATCH] feat: support for seek by worker name --- horde_sdk/ai_horde_api/apimodels/workers/_workers.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/horde_sdk/ai_horde_api/apimodels/workers/_workers.py b/horde_sdk/ai_horde_api/apimodels/workers/_workers.py index 6d18cb1..4009257 100644 --- a/horde_sdk/ai_horde_api/apimodels/workers/_workers.py +++ b/horde_sdk/ai_horde_api/apimodels/workers/_workers.py @@ -189,10 +189,15 @@ def get_api_model_name(cls) -> str | None: class AllWorkersDetailsRequest(BaseAIHordeRequest, APIKeyAllowedInRequestMixin): - """Returns information on all works. If a moderator API key is specified, it will return additional information.""" + """Returns information on all workers. + + If a moderator API key is specified, it will return additional information. + """ type_: WORKER_TYPE = Field(WORKER_TYPE.all, alias="type") """Filter workers by type. Default is 'all' which returns all workers.""" + name: str | None = Field(None) + """Returns a worker matching the exact name provided. Case insensitive.""" @override @classmethod @@ -217,7 +222,7 @@ def get_default_success_response_type(cls) -> type[AllWorkersDetailsResponse]: @override @classmethod def get_query_fields(cls) -> list[str]: - return ["type_"] + return ["type_", "name"] @classmethod def is_api_key_required(cls) -> bool: