// Create an evaluation for a single call
const response = await client.evaluation.createJob({
/**
* You can find the evaluator slug from the Evaluators section on the dashboard
* Or you can use 'all' to evaluate with all available evaluators.
*
* Evaluators to evaluate the call
* Usage examples:
* - Specific evaluators: ['evaluator-slug-1', 'evaluator-slug-2']
* - All evaluators: 'all'
*/
evaluators: ['evaluator-slug-1', 'evaluator-slug-2'],
call: {
recordingUrl: 'https://example.com/recording.wav',
callDirection: 'INBOUND' as CallDirectionEnum,
interfaceType: 'WEB' as CallInterfaceTypeEnum,
startedAt: new Date(),
isTest: false,
participants: [
{
name: 'Sales Agent',
phoneNumber: '+15551234567',
role: 'AGENT' as CallParticipantRoleEnum,
spokeFirst: true,
},
{
name: 'John Doe',
phoneNumber: '+15557654321',
role: 'CUSTOMER' as CallParticipantRoleEnum,
spokeFirst: false,
},
],
// Custom metadata and properties
properties: {
business_name: 'customer-business-name',
business_id: 'customer-business-id',
},
toolInvocations: [
{
name: 'getDentalAppointments',
description: 'Get available dental appointments',
startOffsetMs: 2000,
endTimeOffsetMs: 3000,
parameters: {},
result: { appointments: ['cleaning', 'whitening', 'rootCanal'] },
},
],
},
});
console.log('Evaluation created:', response.data);