Skip to content

Commit 57dcdd6

Browse files
committed
Fix copy paste bug in SqliteChatRepository.cs
1 parent bc823a5 commit 57dcdd6

2 files changed

Lines changed: 18 additions & 19 deletions

File tree

src/MaIN.Infrastructure/Repositories/Sql/SqlChatRepository.cs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,21 @@ private ChatDocument MapChatDocument(dynamic row)
4646

4747
private object MapChatToParameters(ChatDocument chat)
4848
{
49-
return chat is null
50-
? throw new ArgumentNullException(nameof(chat))
51-
: new
52-
{
53-
chat.Id,
54-
chat.Name,
55-
chat.Model,
56-
Messages = JsonSerializer.Serialize(chat.Messages, _jsonOptions),
57-
Type = JsonSerializer.Serialize(chat.Type, _jsonOptions),
58-
ConvState = JsonSerializer.Serialize(chat.ConvState, _jsonOptions),
59-
InferenceParams = JsonSerializer.Serialize(chat.InferenceParams, _jsonOptions),
60-
MemoryParams = JsonSerializer.Serialize(chat.MemoryParams, _jsonOptions),
61-
Properties = JsonSerializer.Serialize(chat.Properties, _jsonOptions),
62-
Visual = chat.ImageGen,
63-
chat.Interactive
64-
};
49+
ArgumentNullException.ThrowIfNull(chat);
50+
return new
51+
{
52+
chat.Id,
53+
chat.Name,
54+
chat.Model,
55+
Messages = JsonSerializer.Serialize(chat.Messages, _jsonOptions),
56+
Type = JsonSerializer.Serialize(chat.Type, _jsonOptions),
57+
ConvState = JsonSerializer.Serialize(chat.ConvState, _jsonOptions),
58+
InferenceParams = JsonSerializer.Serialize(chat.InferenceParams, _jsonOptions),
59+
MemoryParams = JsonSerializer.Serialize(chat.MemoryParams, _jsonOptions),
60+
Properties = JsonSerializer.Serialize(chat.Properties, _jsonOptions),
61+
Visual = chat.ImageGen,
62+
chat.Interactive
63+
};
6564
}
6665

6766
public async Task<IEnumerable<ChatDocument>> GetAllChats()

src/MaIN.Infrastructure/Repositories/Sqlite/SqliteChatRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ private ChatDocument MapChatDocument(dynamic row)
2727
Type = row.Type is not null
2828
? JsonSerializer.Deserialize<ChatTypeDocument>(row.Type, _jsonOptions)
2929
: default,
30-
ConvState = row.Type is not null
30+
ConvState = row.ConvState is not null
3131
? JsonSerializer.Deserialize<dynamic>(row.ConvState, _jsonOptions)
3232
: default,
33-
InferenceParams = row.Type is not null
33+
InferenceParams = row.InferenceParams is not null
3434
? JsonSerializer.Deserialize<InferenceParamsDocument>(row.InferenceParams, _jsonOptions)
3535
: default,
36-
MemoryParams = row.Type is not null
36+
MemoryParams = row.MemoryParams is not null
3737
? JsonSerializer.Deserialize<MemoryParams>(row.MemoryParams, _jsonOptions)
3838
: default,
3939
Properties = row.Properties is not null

0 commit comments

Comments
 (0)