Skip to content

Conversation

@QRcode1337
Copy link
Owner

…tion

This commit includes several major improvements to code quality and maintainability:

  1. Fixed critical missing dependencies in pyproject.toml

    • Added PyQt6 (entire GUI framework was missing!)
    • Added anthropic, openai, networkx, beautifulsoup4
    • Ensures proper installation via Poetry
  2. Added comprehensive type hints to shared_utils.py

    • All functions now have proper type annotations
    • Improved code clarity and IDE support
    • Better error detection during development
  3. Centralized configuration system in config.py

    • Added API_MAX_TOKENS, API_TEMPERATURE, API_TIMEOUT constants
    • Model-specific configs (LLaMA, DeepSeek, Together AI)
    • Image and video generation settings
    • Eliminated magic numbers throughout codebase
  4. Improved error handling consistency

    • Added proper logging configuration
    • Specific exception handling (RequestException, APIError, ReplicateError)
    • Better error messages and stack traces
    • Replaced print statements with logger calls
  5. Removed dead code

    • Eliminated unused functions (read_shared_html, update_shared_html, etc.)
    • Kept only actively used functionality

These changes make the codebase more maintainable, easier to debug, and safer to modify.

…tion

This commit includes several major improvements to code quality and maintainability:

1. Fixed critical missing dependencies in pyproject.toml
   - Added PyQt6 (entire GUI framework was missing!)
   - Added anthropic, openai, networkx, beautifulsoup4
   - Ensures proper installation via Poetry

2. Added comprehensive type hints to shared_utils.py
   - All functions now have proper type annotations
   - Improved code clarity and IDE support
   - Better error detection during development

3. Centralized configuration system in config.py
   - Added API_MAX_TOKENS, API_TEMPERATURE, API_TIMEOUT constants
   - Model-specific configs (LLaMA, DeepSeek, Together AI)
   - Image and video generation settings
   - Eliminated magic numbers throughout codebase

4. Improved error handling consistency
   - Added proper logging configuration
   - Specific exception handling (RequestException, APIError, ReplicateError)
   - Better error messages and stack traces
   - Replaced print statements with logger calls

5. Removed dead code
   - Eliminated unused functions (read_shared_html, update_shared_html, etc.)
   - Kept only actively used functionality

These changes make the codebase more maintainable, easier to debug, and safer to modify.
Copilot AI review requested due to automatic review settings November 8, 2025 11:32
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors shared_utils.py to improve code maintainability by adding type hints, centralizing configuration constants, and enhancing error handling with structured logging. The changes include extracting hardcoded values to config.py and removing unused stub functions.

  • Adds comprehensive type hints to all function signatures for better type safety
  • Centralizes API configuration constants (tokens, temperature, timeouts) into config.py
  • Improves error handling with structured logging and specific exception types

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
shared_utils.py Adds type hints to all functions, replaces hardcoded API parameters with config constants, implements structured logging with specific exception handlers, and removes unused stub functions
config.py Introduces centralized configuration constants for API parameters (max tokens, temperature, timeout), model-specific settings (LLaMA, DeepSeek, Together), and image/video generation settings
pyproject.toml Adds missing dependency declarations (PyQt6, anthropic, openai, networkx, beautifulsoup4)
Comments suppressed due to low confidence (1)

shared_utils.py:42

  • Import of 'SORA_POLL_INTERVAL_SECONDS' is not used.
from config import (
    API_MAX_TOKENS, API_TEMPERATURE, API_TIMEOUT,
    LLAMA_MAX_TOKENS, LLAMA_TEMPERATURE, LLAMA_TOP_P, LLAMA_REPETITION_PENALTY, LLAMA_MAX_HISTORY,
    DEEPSEEK_MAX_TOKENS, DEEPSEEK_TEMPERATURE,
    TOGETHER_MAX_TOKENS, TOGETHER_TEMPERATURE, TOGETHER_TOP_P,
    IMAGE_WIDTH, IMAGE_HEIGHT,
    SORA_POLL_INTERVAL_SECONDS
)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

QRcode1337 and others added 3 commits November 8, 2025 06:36
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
@QRcode1337 QRcode1337 enabled auto-merge (squash) November 8, 2025 11:54
Copy link
Owner Author

@QRcode1337 QRcode1337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@QRcode1337 QRcode1337 disabled auto-merge November 17, 2025 10:46
@QRcode1337 QRcode1337 closed this Nov 21, 2025
@QRcode1337 QRcode1337 reopened this Nov 21, 2025
@QRcode1337 QRcode1337 enabled auto-merge (squash) November 21, 2025 05:05
@QRcode1337 QRcode1337 closed this Nov 21, 2025
auto-merge was automatically disabled November 21, 2025 05:05

Pull request was closed

@QRcode1337 QRcode1337 reopened this Nov 23, 2025
@QRcode1337 QRcode1337 enabled auto-merge (rebase) November 23, 2025 18:37
@QRcode1337 QRcode1337 closed this Nov 30, 2025
auto-merge was automatically disabled November 30, 2025 16:19

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants