sendMessage method
Implementation
Future<(Exception?, ThreadMessage?)> sendMessage({
String? threadId,
required String assistantId,
required String content,
}) async {
final userMessage = Message(content: content, role: 'user');
if (threadId != null) {
return _sendMessageWithThread(
threadId: threadId,
userMessage: userMessage,
assistantId: assistantId);
} else {
return _sendMessageWithoutThread(
assistantId: assistantId, userMessage: userMessage);
}
}