MoneyPrinterTurbo/test
google-labs-jules[bot] 460dfdfd3c I've added a new feature to your application that allows for text-based content generation using the configured LLM.
Here's a summary of the changes:

1.  **Web UI (`webui/Main.py`):**
    *   I've added a new "Content Generation" section in the middle panel of your application.
    *   This section includes a text input for your prompts and a button to start the generation process.
    *   The generated content will be displayed in a text area.
    *   I've used session state to manage the prompt input and the generated output.
    *   Localization has been integrated using the `tr()` function.

2.  **LLM Service (`app/services/llm.py`):**
    *   I introduced a new function `generate_content(prompt: str) -> str`.
    *   This function takes your prompt, formats it for the LLM, and then uses the existing `_generate_response` helper to communicate with the LLM provider.
    *   I've included logging for prompt processing and to track successful or failed operations.
    *   Error handling for interactions with the LLM layer has been implemented.

3.  **Unit Tests (`test/services/test_llm.py`):**
    *   I created a new test file specifically for the LLM service.
    *   I've added unit tests for the `generate_content` function, ensuring it handles:
        *   Successful content generation.
        *   Failures resulting from LLM errors.
        *   The scenario of empty prompts.
    *   These tests mock the `_generate_response` function to focus on the `generate_content` logic.
    *   All tests are currently passing.

This new feature offers you another way to utilize the application's LLM capabilities, expanding beyond video script generation.
2025-06-06 21:05:19 +00:00
..
resources feat: add unit tests 2025-05-10 12:34:37 +08:00
services I've added a new feature to your application that allows for text-based content generation using the configured LLM. 2025-06-06 21:05:19 +00:00
__init__.py feat: add unit tests 2025-05-10 12:34:37 +08:00
README.md feat: add test for voice service 2025-05-10 17:21:13 +08:00

MoneyPrinterTurbo Test Directory

This directory contains unit tests for the MoneyPrinterTurbo project.

Directory Structure

  • services/: Tests for components in the app/services directory
    • test_video.py: Tests for the video service
    • test_task.py: Tests for the task service
    • test_voice.py: Tests for the voice service

Running Tests

You can run the tests using Pythons built-in unittest framework:

# Run all tests
python -m unittest discover -s test

# Run a specific test file
python -m unittest test/services/test_video.py

# Run a specific test class
python -m unittest test.services.test_video.TestVideoService

# Run a specific test method
python -m unittest test.services.test_video.TestVideoService.test_preprocess_video

Adding New Tests

To add tests for other components, follow these guidelines:

  1. Create test files prefixed with test_ in the appropriate subdirectory
  2. Use unittest.TestCase as the base class for your test classes
  3. Name test methods with the test_ prefix

Test Resources

Place any resource files required for testing in the test/resources directory.