Add WaitTime to ElementActionArgs

This commit is contained in:
Haiping Chen 2024-08-01 13:18:34 -05:00
parent b8f6f53797
commit feb0a04571
7 changed files with 15 additions and 5 deletions

View file

@ -12,6 +12,11 @@ public class ElementActionArgs
public string? PressKey { get; set; }
/// <summary>
/// Wait time in seconds
/// </summary>
public int WaitTime { get; set; }
/// <summary>
/// Required for deserialization
/// </summary>

View file

@ -43,7 +43,7 @@ public interface IConversationService
Func<RoleDialogModel, Task> onFunctionExecuting,
Func<RoleDialogModel, Task> onFunctionExecuted);
List<RoleDialogModel> GetDialogHistory(int lastCount = 50, bool fromBreakpoint = true);
List<RoleDialogModel> GetDialogHistory(int lastCount = 100, bool fromBreakpoint = true);
Task CleanHistory(string agentId);
/// <summary>

View file

@ -40,7 +40,7 @@ public interface IRoutingService
/// <returns></returns>
Task<RoleDialogModel> InstructDirect(Agent agent, RoleDialogModel message);
Task<string> GetConversationContent(List<RoleDialogModel> dialogs, int maxDialogCount = 50);
Task<string> GetConversationContent(List<RoleDialogModel> dialogs, int maxDialogCount = 100);
(bool, string) HasMissingRequiredField(RoleDialogModel message, out string agentId);
}

View file

@ -92,7 +92,7 @@ public partial class ConversationService
return response.Content;
}
private string GetConversationContent(List<RoleDialogModel> dialogs, int maxDialogCount = 50)
private string GetConversationContent(List<RoleDialogModel> dialogs, int maxDialogCount = 100)
{
var conversation = "";

View file

@ -106,7 +106,7 @@ public partial class ConversationService : IConversationService
throw new NotImplementedException();
}
public List<RoleDialogModel> GetDialogHistory(int lastCount = 50, bool fromBreakpoint = true)
public List<RoleDialogModel> GetDialogHistory(int lastCount = 100, bool fromBreakpoint = true)
{
if (string.IsNullOrEmpty(_conversationId))
{

View file

@ -2,7 +2,7 @@ namespace BotSharp.Core.Routing;
public partial class RoutingService
{
public async Task<string> GetConversationContent(List<RoleDialogModel> dialogs, int maxDialogCount = 50)
public async Task<string> GetConversationContent(List<RoleDialogModel> dialogs, int maxDialogCount = 100)
{
var agentService = _services.GetRequiredService<IAgentService>();
var conversation = "";

View file

@ -58,5 +58,10 @@ public partial class PlaywrightWebDriver
{
await locator.HoverAsync();
}
if (action.WaitTime > 0)
{
await Task.Delay(1000 * action.WaitTime);
}
}
}