Browse Source

修改ai回复

weicu
tanlongsheng 2 years ago
parent
commit
184bcb5b7f
  1. 4
      lib/core/translations/language/en_us.dart
  2. 4
      lib/core/translations/language/zh_cn.dart
  3. 8
      lib/data/providers/agent_provider.dart
  4. 6
      lib/data/services/deapsound_ai_service.dart
  5. 10
      lib/modules/chat/controllers/chat_controller.dart

4
lib/core/translations/language/en_us.dart

@ -99,8 +99,8 @@ const Map<String, String> enUS = {
"simultaneousTranslationInfo": "Instant translation for 80+ languages",
"aiGirlfriend": "Parent-child bondingn",
"aiGirlfriendInfo": "Intelligent company, chat at any time",
"healthConsultant": "Health Consultant",
"healthConsultantInfo": "Provides scientific health advice",
"healthConsultant": "Multi-function AI chat",
"healthConsultantInfo": "More AI chat features",
"conferenceAssistant": "Business Meeting Assistant",
"conferenceAssistantInfo":
"Real-time minutes recording and multilingual translation",

4
lib/core/translations/language/zh_cn.dart

@ -98,8 +98,8 @@ const Map<String, String> zhCN = {
"simultaneousTranslationInfo": "实时翻译80+种语言",
"aiGirlfriend": "亲子陪伴",
"aiGirlfriendInfo": "智能陪伴,随时聊天",
"healthConsultant": "健康顾问",
"healthConsultantInfo": "提供科学健康建议",
"healthConsultant": "多功能AI聊天",
"healthConsultantInfo": "提供更多AI聊天功能",
"conferenceAssistant": "商务会议助手",
"conferenceAssistantInfo": "实时记录会议纪要,多语言翻译",
"studyAssistant": "语言学习助手",

8
lib/data/providers/agent_provider.dart

@ -130,15 +130,13 @@ class AgentProvider {
'''),
Agent(
id: 'health_advisor',
name: '健康顾问 吴小江博士',
name: '多功能AI聊天 吴小江',
avatarUrl: 'assets/images/agents/doctor.png',
description:
'我是吴博士,拥有丰富的健康管理经验。我可以为你提供科学的健康建议、生活方式指导和疾病预防知识,帮助你实现身心健康的平衡。',
description: '我是吴小江,我可以为你提供更多AI聊天功能。',
tag: '健康',
isOnline: true,
voice: "zh_male_shaonianzixin_moon_bigtts",
welcomeMessage:
"您好,我是李医生,很高兴能为您提供健康咨询服务。健康是人生最宝贵的财富,我将用专业知识帮助您维护和改善健康状况。请问有什么健康问题想咨询吗?",
welcomeMessage: "您好,我是吴小江,很高兴能为您提供多功能AI聊天。我将用专业知识帮助您。请问有什么问题想咨询吗?",
systemPrompt: '''
你是一位名叫李医生的健康顾问,拥有丰富的医学知识和健康管理经验。

6
lib/data/services/deapsound_ai_service.dart

@ -20,7 +20,7 @@ class DeapsoundAIService implements AiService {
required String systemPrompt,
}) async* {
final client = http.Client();
final url = Uri.parse('https://www.deapsound.com/ai/chat');
final url = Uri.parse('https://www.deapsound.com/ai/funcchat');
final headers = {
'Content-Type': 'application/json',
@ -51,8 +51,8 @@ class DeapsoundAIService implements AiService {
if (data['event'] == 'workflow_finished') {
break;
}
if (data['event'] == 'text_chunk') {
String content = data['data']['text'] ?? '';
if (data['content'] != null) {
String content = data['content'] ?? '';
if (content.isNotEmpty) {
yield content;
}

10
lib/modules/chat/controllers/chat_controller.dart

@ -93,16 +93,16 @@ class ChatController extends GetxController {
agent = foundAgent;
switch (agent.id) {
case 'personal_assistant':
// 全能助手
Get.put(DeapsoundAIService());
_aiService = Get.find<DeapsoundAIService>();
break;
case 'cyber_girlfriend':
// 亲子陪伴
Get.put(KouziAIService());
_aiService = Get.find<KouziAIService>();
break;
case 'health_advisor':
// 多功能AI聊天
Get.put(DeapsoundAIService());
_aiService = Get.find<DeapsoundAIService>();
break;
default:
_aiService = Get.find<VolcanoAIService>();
}

Loading…
Cancel
Save