This repository contains sample code and tests for Nebula Block SDK. The project includes API tests for various models under the serverless_api directory.
Before running the tests, ensure you have the following installed:
- Python 3.x
pip- Virtual environment (recommended)
- Clone the repository:
git clone <repository_url> cd nebula-block-sdk-samples
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On macOS/Linux venv\Scripts\activate.bat # On Windows
- Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the root directory with your API keys:NEBULA_API_KEY=your_api_key_here -
The
config.yamlfile contains environment-specific configurations:staging: base_url: https://staging-api-url production: base_url: https://production-api-url
To run all test cases under serverless_api and generate an HTML report:
pytest --html=report.html --self-contained-html # Staging and personal api key
pytest --key=team --html=report.html --self-contained-html # Staging and team api key
pytest --env=production --key=personal --html=report.html --self-contained-html # Production and personal api key
pytest --env=production --key=team --html=report.html --self-contained-html # Production and team api keyYou can run tests inside a specific subdirectory, e.g., vision_models:
pytest serverless_api/vision_modelsTo run a single test file, specify its path:
pytest serverless_api/vision_models/test_analysis_image_with_Qwen25_VL_7B_Instruct.pyAfter running the tests, open report.html in a browser to see the test results.