import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const asyncJobListResponse of client.knowledgeBases.asyncJobs.list('knowledge_base_id')) {
console.log(asyncJobListResponse.id);
}
[
{
"job_type": "evaluation-auto-eval",
"parent_job_id": "<string>",
"status": "<string>",
"progress": {},
"job_metadata": {},
"idempotency_key": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"created_by_identity_type": "user"
}
]
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
// Automatically fetches more pages as needed.
for await (const asyncJobListResponse of client.knowledgeBases.asyncJobs.list('knowledge_base_id')) {
console.log(asyncJobListResponse.id);
}
[
{
"job_type": "evaluation-auto-eval",
"parent_job_id": "<string>",
"status": "<string>",
"progress": {},
"job_metadata": {},
"idempotency_key": "<string>",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"created_by_identity_type": "user"
}
]
Optional search by status type
Active
, All
Page number for pagination to be returned by the given endpoint. Starts at page 1
x >= 1
Maximum number of artifacts to be returned by the given endpoint. Defaults to 100 and cannot be greater than 10k.
1 <= x <= 10000
Successful Response
The response is of type AsyncJobsEntity · object[]
.