Haidra-Org / horde-sdk

A python library to interact with AI-Horde's free generative AI APIs
https://aihorde.net/
GNU Affero General Public License v3.0
23 stars 7 forks source link

feat: `kudos`, `users` and more `stats` endpoints; docs/style: `use_attribute_docstrings`, apply `D` ruff rule set, better examples #198

Closed tazlin closed 3 months ago

tazlin commented 3 months ago
tazlin commented 3 months ago

@CodiumAI-Agent /review

CodiumAI-Agent commented 3 months ago

PR Review 🔍

⏱️ Estimated effort to review [1-5] 5, because the PR is extensive with multiple files and significant changes across various modules, including new features, refactoring, and documentation updates. The complexity and breadth of the changes require a thorough review to ensure functionality, performance, and security are maintained or enhanced.
🧪 Relevant tests No
⚡ Possible issues Possible Bug: The use of `PROGRESS_STATE` enum in `consts.py` might not be fully integrated into the existing system if the rest of the codebase does not handle these new states.
Performance Concern: The addition of multiple new features and models might impact the performance if not properly optimized, especially in handling large data or high traffic.
🔒 Security concerns No
Code feedback:
relevant filehorde_sdk/ai_horde_api/apimodels/workers/_workers.py
suggestion       Consider adding validation for the `maintenance_msg` field in `ModifyWorkerRequest` to ensure it does not exceed a reasonable length and does not contain any inappropriate content. [important]
relevant linemaintenance_msg: str | None = Field(None)

relevant filehorde_sdk/ai_horde_api/apimodels/generate/_pop.py
suggestion       It's recommended to implement a method to handle the scenario when `bridge_version` is not provided in `ImageGenerateJobPopRequest`, perhaps by setting a sensible default or rejecting requests that do not meet the minimum required version. [important]
relevant linebridge_version: int | None = None

relevant filehorde_sdk/ai_horde_api/apimodels/base.py
suggestion       For the `JobRequestMixin` and `JobResponseMixin` classes, consider implementing a more robust ID validation system that not only checks for non-empty values but also ensures the format of the ID meets certain criteria (e.g., length, character set). [important]
relevant line"""Ensure that the job ID is not empty."""

relevant filehorde_sdk/ai_horde_api/apimodels/_status.py
suggestion       In `HordePerformanceResponse`, consider adding a method to calculate the average performance based on the `thread_count` and `worker_count` to provide more actionable insights into the system's performance. [medium]
relevant line"""How many worker threads are actively processing prompt generations in this {horde_noun} in the past 5