refine code
This commit is contained in:
parent
805dc63ea8
commit
07ee8fcf2f
|
|
@ -7,5 +7,5 @@ public interface IConversationSideCar
|
|||
List<DialogElement> GetConversationDialogs(string conversationId);
|
||||
void UpdateConversationBreakpoint(string conversationId, ConversationBreakpoint breakpoint);
|
||||
ConversationBreakpoint? GetConversationBreakpoint(string conversationId);
|
||||
Task<RoleDialogModel> Execute(string conversationId, string agentId, string text, PostbackMessageModel? postback = null, List<MessageState>? states = null);
|
||||
Task<RoleDialogModel> Execute(string agentId, string text, PostbackMessageModel? postback = null, List<MessageState>? states = null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public interface IRoutingContext
|
|||
|
||||
int CurrentRecursionDepth { get; }
|
||||
int GetRecursiveCounter();
|
||||
int IncreaseRecursiveCounter();
|
||||
void IncreaseRecursiveCounter();
|
||||
void SetRecursiveCounter(int counter);
|
||||
void ResetRecursiveCounter();
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public class ConversationSideCar : IConversationSideCar
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<RoleDialogModel> Execute(string conversationId, string agentId, string text,
|
||||
public async Task<RoleDialogModel> Execute(string agentId, string text,
|
||||
PostbackMessageModel? postback = null, List<MessageState>? states = null)
|
||||
{
|
||||
BeforeExecute();
|
||||
|
|
|
|||
|
|
@ -394,7 +394,9 @@ public class ConversationStateService : IConversationStateService, IDisposable
|
|||
|
||||
public void SetCurrentState(ConversationState state)
|
||||
{
|
||||
_curStates = state;
|
||||
var values = _curStates.Values.ToList();
|
||||
var copy = JsonSerializer.Deserialize<List<StateKeyValue>>(JsonSerializer.Serialize(values));
|
||||
_curStates = new ConversationState(copy ?? new());
|
||||
}
|
||||
|
||||
public void ResetCurrentState()
|
||||
|
|
|
|||
|
|
@ -214,9 +214,9 @@ public class RoutingContext : IRoutingContext
|
|||
return _currentRecursionDepth;
|
||||
}
|
||||
|
||||
public int IncreaseRecursiveCounter()
|
||||
public void IncreaseRecursiveCounter()
|
||||
{
|
||||
return _currentRecursionDepth;
|
||||
_currentRecursionDepth++;
|
||||
}
|
||||
|
||||
public void SetRecursiveCounter(int counter)
|
||||
|
|
|
|||
Loading…
Reference in a new issue