Skip to content

Commit

Permalink
feat: llm history
Browse files Browse the repository at this point in the history
  • Loading branch information
guchengxi1994 committed Apr 30, 2024
1 parent a0649ae commit 76fa59f
Show file tree
Hide file tree
Showing 10 changed files with 371 additions and 138 deletions.
2 changes: 1 addition & 1 deletion lib/isar/database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class IsarDatabase {
ScheduleItemSchema,
RecentlyUsedSchema,
LLMHistorySchema,
LLMHistoryMessagesSchema
LLMHistoryMessageSchema
];

Future initialDatabase() async {
Expand Down
5 changes: 3 additions & 2 deletions lib/isar/llm_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ class LLMHistory {
@enumerated
late LLMType llmType = LLMType.openai;

final messages = IsarLinks<LLMHistoryMessages>();
final messages = IsarLinks<LLMHistoryMessage>();
}

enum MessageType { query, response }

@collection
class LLMHistoryMessages {
class LLMHistoryMessage {
@enumerated
late MessageType messageType;

Id id = Isar.autoIncrement;
late int roleType = 0;

String? content;
}
Loading

0 comments on commit 76fa59f

Please sign in to comment.