diff --git a/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementActionArgs.cs b/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementActionArgs.cs index 0d44066a..046187eb 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementActionArgs.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Browsing/Models/ElementActionArgs.cs @@ -12,6 +12,11 @@ public class ElementActionArgs public string? PressKey { get; set; } + /// + /// Wait time in seconds + /// + public int WaitTime { get; set; } + /// /// Required for deserialization /// diff --git a/src/Infrastructure/BotSharp.Abstraction/Conversations/IConversationService.cs b/src/Infrastructure/BotSharp.Abstraction/Conversations/IConversationService.cs index 9fd40c09..3cc2c5fd 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Conversations/IConversationService.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Conversations/IConversationService.cs @@ -43,7 +43,7 @@ public interface IConversationService Func onFunctionExecuting, Func onFunctionExecuted); - List GetDialogHistory(int lastCount = 50, bool fromBreakpoint = true); + List GetDialogHistory(int lastCount = 100, bool fromBreakpoint = true); Task CleanHistory(string agentId); /// diff --git a/src/Infrastructure/BotSharp.Abstraction/Routing/IRoutingService.cs b/src/Infrastructure/BotSharp.Abstraction/Routing/IRoutingService.cs index 5a12c0ed..eed00812 100644 --- a/src/Infrastructure/BotSharp.Abstraction/Routing/IRoutingService.cs +++ b/src/Infrastructure/BotSharp.Abstraction/Routing/IRoutingService.cs @@ -40,7 +40,7 @@ public interface IRoutingService /// Task InstructDirect(Agent agent, RoleDialogModel message); - Task GetConversationContent(List dialogs, int maxDialogCount = 50); + Task GetConversationContent(List dialogs, int maxDialogCount = 100); (bool, string) HasMissingRequiredField(RoleDialogModel message, out string agentId); } diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.Summary.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.Summary.cs index 2e7657ba..0983e2ed 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.Summary.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.Summary.cs @@ -92,7 +92,7 @@ public partial class ConversationService return response.Content; } - private string GetConversationContent(List dialogs, int maxDialogCount = 50) + private string GetConversationContent(List dialogs, int maxDialogCount = 100) { var conversation = ""; diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs index 4a5ac778..87beba41 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.cs @@ -106,7 +106,7 @@ public partial class ConversationService : IConversationService throw new NotImplementedException(); } - public List GetDialogHistory(int lastCount = 50, bool fromBreakpoint = true) + public List GetDialogHistory(int lastCount = 100, bool fromBreakpoint = true) { if (string.IsNullOrEmpty(_conversationId)) { diff --git a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetConversationContent.cs b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetConversationContent.cs index 2757d5d8..f8efab46 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetConversationContent.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/RoutingService.GetConversationContent.cs @@ -2,7 +2,7 @@ namespace BotSharp.Core.Routing; public partial class RoutingService { - public async Task GetConversationContent(List dialogs, int maxDialogCount = 50) + public async Task GetConversationContent(List dialogs, int maxDialogCount = 100) { var agentService = _services.GetRequiredService(); var conversation = ""; diff --git a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.DoAction.cs b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.DoAction.cs index 1ca20d28..91766736 100644 --- a/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.DoAction.cs +++ b/src/Plugins/BotSharp.Plugin.WebDriver/Drivers/PlaywrightDriver/PlaywrightWebDriver.DoAction.cs @@ -58,5 +58,10 @@ public partial class PlaywrightWebDriver { await locator.HoverAsync(); } + + if (action.WaitTime > 0) + { + await Task.Delay(1000 * action.WaitTime); + } } }