8000 GitHub - abiola814/text-generation: y
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

abiola814/text-generation

Repository files navigation

AI Text Generation API

Running the Application

Follow these simple steps to run the API using Docker Compose:

  1. Set Up Environment Variables: Create a .env file in the project root:

    SECRET_KEY=your-secret-key
    JWT_SECRET_KEY=your-jwt-secret
    OPENAI_API_KEY=your-openai-api-key
    OPENAI_MODEL=gpt-4o-mini
    
  2. Start the Application:

    docker-compose up -d --build
  3. Access the API:

  4. API Documentation:

Running Tests

  1. Set Up Test Environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    pip install -r requirements.txt
    pip install pytest pytest-cov
  2. Run All Tests:

    python -m pytest
  3. Run Specific Test Categories:

    python -m pytest tests/unit/       # Unit tests only
    python -m pytest tests/integration/ # Integration tests only
    python -m pytest -v                 # Verbose output
    python -m pytest --cov=app          # With coverage

Troubleshooting

  • Database Connection: Verify port 5432 is available for container communication
  • Test Database Issues: Delete test.db and restart tests if database errors occur
  • API Key Issues: Ensure your OpenAI API key has sufficient quota

About

y

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0