import { makeAICall, startAIServer } from './make_call';
/**
* Example usage of the AI calling functions
*/
async function example() {
try {
// Start the AI server first
console.log('๐ Starting AI server...');
await startAIServer();
// Wait a moment for server to be ready
await new Promise(resolve => setTimeout(resolve, 2000));
// Make an AI call
console.log('๐ Making AI call...');
const callResult = await makeAICall();
console.log('โ
AI call initiated successfully!');
console.log('Call details:', {
sid: callResult.sid,
status: callResult.status,
from: callResult.from,
to: callResult.to
});
} catch (error) {
console.error('โ Error in example:', error);
}
}
// Run the example if this file is executed directly
if (require.main === module) {
example();
}
export { example };