telecom_mas_agent 1.0.0
telecom_mas_agent: ^1.0.0 copied to clipboard
A telecom multi-agent system for managing call balances, push notifications, marketing, targeting, and conversational AI sales.
example/telecom_mas_agent_example.dart
import 'package:telecom_mas_agent/telecom_mas_agent.dart';
void main() async {
// Initialize the agent
final agent = TelecomMASAgent(agentName: 'Demo Telecom Agent');
print('=== Telecom MAS Agent Demo ===\n');
// Initialize a user
print('1. Initializing user...');
final initMessage = await agent.initializeUser('user123', initialBalance: 100);
print(initMessage);
print('');
// Check call balance
print('2. Checking balance...');
final balanceMessage = await agent.checkCallBalance('user123');
print(balanceMessage);
print('');
// Make a call
print('3. Making a call...');
final callMessage = await agent.makeCall('user123', 10);
print(callMessage);
print('');
// Send SMS
print('4. Sending SMS...');
final smsMessage = await agent.sendSMS('user123', 'Hello from Telecom MAS!');
print(smsMessage);
print('');
// Send push notification
print('5. Sending push notification...');
final pushMessage = await agent.sendPushNotification(
'user123',
'Special offer: 50% off on international calls!',
);
print(pushMessage);
print('');
// Get marketing insights
print('6. Getting marketing insights...');
final insights = await agent.getMarketingInsights('user123');
print(insights);
print('');
// Get user logs
print('7. User activity logs:');
final logs = agent.getUserLogs('user123');
for (var log in logs) {
print(' $log');
}
print('');
// Initialize another user
print('8. Initializing another user...');
await agent.initializeUser('user456', initialBalance: 200);
await agent.makeCall('user456', 25);
await agent.sendSMS('user456', 'Welcome to our service!');
print('');
// Show all users
print('9. All registered users:');
for (var userId in agent.userIds) {
print(' - $userId (Balance: ${agent.getBalance(userId)} minutes)');
}
}