@switch (XiaoZhiAgent.Emotion.ToLower())
{
case "happy":
case "excited":
break;
case "sad":
break;
case "surprised":
case "surprise":
break;
case "angry":
break;
case "laughing":
break;
case "pleased":
break;
case "loading":
break;
case "typing":
break;
case "voice":
break;
default:
break;
}
@if (XiaoZhiAgent.ChatHistory.Count == 0)
{
欢迎使用小智AI助手!
- • 输入文字或点击🎤语音对话
- • 支持实时语音识别和AI回复
}
@foreach (var message in XiaoZhiAgent.ChatHistory)
{
@message.Timestamp.ToString("HH:mm")
@message.Content
}
@if (!string.IsNullOrEmpty(XiaoZhiAgent.QuestionMessae) &&
(XiaoZhiAgent.ChatHistory.Count == 0 ||
!XiaoZhiAgent.ChatHistory.Any(m => m.IsUser && m.Content == XiaoZhiAgent.QuestionMessae)))
{
@DateTime.Now.ToString("HH:mm")
@XiaoZhiAgent.QuestionMessae
}
@if (!string.IsNullOrEmpty(XiaoZhiAgent.AnswerMessae) &&
(XiaoZhiAgent.ChatHistory.Count == 0 ||
!XiaoZhiAgent.ChatHistory.Any(m => !m.IsUser && m.Content == XiaoZhiAgent.AnswerMessae)))
{
@DateTime.Now.ToString("HH:mm")
@XiaoZhiAgent.AnswerMessae
}