List Trainings
Retrieve a paginated list of fine-tuning jobs using the Knowledgator TypeScript SDK.
Example Usage
import { createClient } from '@knowledgator/typescript-sdk';
const kg = createClient();
// List active or completed trainings with pagination
const trainings = await kg.finetuning.listTrainings({
offset: 0,
limit: 10,
status: 'completed'
});
console.log(trainings);
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
offset | number | No | Pagination offset (default: 0). |
limit | number | No | Maximum number of records to return (default: 10). |
status | string | No | Filter by job status ("pending", "running", "completed", "failed"). |
Response Structure
The SDK transparently handles backend response variants (whether returned as a direct array or wrapped in a container object like { trainings: [...] } or { items: [...] }):
[
{
"id": "78d379da228a4985ba19100f53245b79",
"model_id": "comprehend-it",
"dataset_id": "6babd48a-2256-4466-b16b-9fd45ba59688",
"status": "completed",
"type": "model",
"created_at": "2024-02-15T09:00:00Z"
}
]