enabled togglable chat history (during runtime) that uses different api endpoints.
This commit is contained in:
@@ -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.
|
||||
}
|
||||
Reference in New Issue
Block a user