enabled togglable chat history (during runtime) that uses different api endpoints.

This commit is contained in:
Joshua
2024-07-08 13:03:15 -06:00
parent 8956ed7885
commit ff4a54fbbc
4 changed files with 99 additions and 84 deletions
@@ -1,9 +1,22 @@
import 'dart:convert';
import 'package:json_annotation/json_annotation.dart';
@JsonSerializable()
class Chat {
late String message;
late bool isMe;
final String content;
final bool role;
// Most basic chat, text from server or from user.
Chat(this.message, this.isMe);
Chat(this.content, this.role);
String toJson() {
Map<String, dynamic> c = {
"content": content,
"role": role,
};
return json.encode(c);
}
// TODO: Overload constructors to allow for multimedia.
}