Skip to content

Commit

Permalink
fix a issue that cannot edit-and-save-new
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Jan 22, 2025
1 parent 1c490cf commit 6715276
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/BE/Controllers/Chats/Messages/MessagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ public async Task<ActionResult<RequestMessageDto>> EditAndSaveNew(string encrypt
Message? message = await db.Messages
.Include(x => x.Chat)
.Include(x => x.Usage)
.Include(x => x.Usage!.UserModel)
.Include(x => x.Usage!.UserModel.Model)
.Include(x => x.Usage!.UserModel.Model.ModelKey)
.FirstOrDefaultAsync(x => x.Id == messageId, cancellationToken);
if (message == null)
{
Expand All @@ -181,6 +184,7 @@ public async Task<ActionResult<RequestMessageDto>> EditAndSaveNew(string encrypt
newMessage.Usage = new UserModelUsage()
{
UserModelId = message.Usage.UserModelId,
UserModel = message.Usage.UserModel,
FinishReasonId = (byte)DBFinishReason.Success,
SegmentCount = 1,
InputTokens = message.Usage.InputTokens,
Expand Down

0 comments on commit 6715276

Please sign in to comment.