Merge pull request #570 from Qtoss-AI/master

Add WaitTime to ElementActionArgs
This commit is contained in:
Haiping 2024-08-01 13:22:06 -05:00 committed by GitHub
commit 74c797abf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 16 additions and 6 deletions

View file

@ -5,5 +5,5 @@ namespace BotSharp.Abstraction.Browsing;
public interface IWebPageResponseHook
{
void OnDataFetched(MessageInfo message, string url, string postData, string responsData);
T? GetResponse<T>(MessageInfo message, string url);
T? GetResponse<T>(MessageInfo message, string url, string? queryParameter = null);
}

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);
}
}
}