Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public class ConversationStateService : IConversationStateService
/// States in the previous rounds of conversation
/// </summary>
private ConversationState _historyStates;
private bool _isReadOnly;

public ConversationStateService(
IServiceProvider services,
Expand Down Expand Up @@ -153,7 +154,8 @@ public IConversationStateService SetState<T>(string name, T value, bool isNeedVe

public async Task<Dictionary<string, string>> Load(string conversationId, bool isReadOnly = false)
{
_conversationId = !isReadOnly ? conversationId : null;
_isReadOnly = isReadOnly;
_conversationId = conversationId;
Reset();

var endNodes = new Dictionary<string, string>();
Expand Down Expand Up @@ -232,7 +234,7 @@ public async Task<Dictionary<string, string>> Load(string conversationId, bool i

public async Task Save()
{
if (_conversationId == null || _sidecar?.IsEnabled == true)
if (_conversationId == null || _sidecar?.IsEnabled == true || _isReadOnly)
{
return;
}
Expand Down
Loading