You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
724 B
25 lines
724 B
import 'package:get/get.dart';
|
|
import '../controllers/chat_controller.dart';
|
|
|
|
class ChatBinding extends Bindings {
|
|
@override
|
|
void dependencies() {
|
|
// 获取传递的参数
|
|
final arguments = Get.arguments;
|
|
if (arguments == null || !(arguments is Map<String, dynamic>)) {
|
|
print('Chat binding: 未提供有效的参数');
|
|
Get.back();
|
|
return;
|
|
}
|
|
|
|
// 创建并注入控制器
|
|
Get.put(ChatController(
|
|
agentId: arguments['agentId'],
|
|
agentName: arguments['agentName'],
|
|
agentAvatar: arguments['agentAvatar'],
|
|
agentSubtitle: arguments['agentSubtitle'],
|
|
systemPrompt: arguments['systemPrompt'],
|
|
welcomeMessage: arguments['welcomeMessage'],
|
|
));
|
|
}
|
|
}
|