Skip to content

Commit

Permalink
feat: support for seek by worker name
Browse files Browse the repository at this point in the history
  • Loading branch information
db0 committed Sep 15, 2024
1 parent 372400b commit 1423f27
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions horde_sdk/ai_horde_api/apimodels/workers/_workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 1423f27

Please sign in to comment.