Quick Start
Prerequisites
Before getting started, ensure you have the following installed on your local machine:
- Python 3.8+ or Node.js 16+ (depending on your specific implementation environment).
- Git for version control.
- An active account on the Supervised AI platform to obtain your API credentials.
Installation
To integrate the testing-api structure into your local environment, clone the repository and install the necessary dependencies.
# Clone the repository
git clone https://github.com/UditAkhourii/testing-api.git
# Navigate to the directory
cd testing-api
# Install dependencies (Example for Python environments)
pip install -r requirements.txt
# OR (Example for Node.js environments)
npm install
Configuration
The testing-api requires specific environment variables to authenticate with the Supervised AI platform. Create a .env file in your root directory:
SUPERVISED_AI_API_KEY=your_api_key_here
SUPERVISED_AI_BASE_URL=https://api.supervised.ai/v1
TEST_ENVIRONMENT=development
Basic Usage
The testing-api is designed to provide a standardized structure for executing and reporting test results within the platform.
Initializing the Client
Import the core module to begin interacting with the testing structure.
from testing_api import TestingClient
# Initialize the client
client = TestingClient(api_key="your_api_key_here")
print("Client initialized successfully.")
Running a Test Case
Use the public interface to submit a test payload to the Supervised AI structure.
# Define your test payload
test_payload = {
"test_id": "suite_001",
"parameters": {
"threshold": 0.85,
"model_version": "v2.4-stable"
}
}
# Execute the test
response = client.execute_test(test_payload)
# Output results
if response.status == "success":
print(f"Test passed with accuracy: {response.data['accuracy']}")
else:
print(f"Test failed: {response.error_message}")
API Reference Overview
| Method | Description | Input Type | Return Type |
| :--- | :--- | :--- | :--- |
| execute_test(payload) | Dispatches a test execution to the platform. | dict / JSON | TestResponse |
| get_test_status(test_id) | Retrieves the current status of a running test. | string | StatusObject |
| list_test_suites() | Fetches all available test suites in the environment. | None | List[Suite] |
For more detailed information on specific modules, refer to the /docs folder within the repository.