separate and improve conversation agent
This commit is contained in:
1 parent
951ceaa05b
commit
3c3febb92d
6 files changed
+161
-109
No files matched your search
@@ -95,7 +95,9 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
_title = chatInfo.name;
|
||||
|
||||
currentThreadId = initialMessages.last.threadId;
|
||||
if (currentThreadId != null) {
|
||||
if (currentThreadId == null) {
|
||||
createThread();
|
||||
} else {
|
||||
expandedThreads.add(currentThreadId!);
|
||||
}
|
||||
});
|
||||
@@ -151,9 +153,10 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
void sendMessage(String content) {
|
||||
void sendMessage(String content) async {
|
||||
if (content.trim().isEmpty) return; // Don't send empty messages
|
||||
_textController.clear();
|
||||
|
||||
final newMessage = Message(sender: "user", content: content, threadId: currentThreadId);
|
||||
Backend.sendAction("send-chat-message", {
|
||||
'chatId': widget.chatId,
|
||||
|
||||
Reference in new issue
Block a user