Merge pull request #363 from hchen2020/master
Delay persisting message to allow message content to be changed in hook.
This commit is contained in:
commit
71eeb01b50
|
|
@ -32,8 +32,6 @@ public partial class ConversationService
|
||||||
message.SenderId = _user.Id;
|
message.SenderId = _user.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
_storage.Append(_conversationId, message);
|
|
||||||
|
|
||||||
var conv = _services.GetRequiredService<IConversationService>();
|
var conv = _services.GetRequiredService<IConversationService>();
|
||||||
var dialogs = conv.GetDialogHistory();
|
var dialogs = conv.GetDialogHistory();
|
||||||
|
|
||||||
|
|
@ -72,6 +70,12 @@ public partial class ConversationService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Persist to storage
|
||||||
|
_storage.Append(_conversationId, message);
|
||||||
|
|
||||||
|
// Add to thread
|
||||||
|
dialogs.Add(message);
|
||||||
|
|
||||||
if (!stopCompletion)
|
if (!stopCompletion)
|
||||||
{
|
{
|
||||||
// Routing with reasoning
|
// Routing with reasoning
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue