add wait time for webdriver

This commit is contained in:
Visagan Guruparan 2025-04-01 21:00:49 -05:00
parent 8c93870c95
commit d866d63cae
3 changed files with 13 additions and 8 deletions

View file

@ -33,6 +33,7 @@ public class ElementActionArgs
/// <summary> /// <summary>
/// Wait time in seconds /// Wait time in seconds
/// </summary> /// </summary>
[JsonPropertyName("wait_time")]
public int WaitTime { get; set; } public int WaitTime { get; set; }
/// <summary> /// <summary>

View file

@ -30,7 +30,7 @@ public class UtilWebActionOnElementFn : IFunctionCallback
} }
} }
actionArgs.WaitTime = 2; actionArgs.WaitTime = actionArgs.WaitTime > 0 ? actionArgs.WaitTime : 2;
var conv = _services.GetRequiredService<IConversationService>(); var conv = _services.GetRequiredService<IConversationService>();

View file

@ -16,23 +16,27 @@
"content": { "content": {
"type": "string", "type": "string",
"description": "content to input in element" "description": "content to input in element"
}, },
"file_urls": { "file_urls": {
"type": "array", "type": "array",
"description": "The output format must be string array of file urls.", "description": "The output format must be string array of file urls.",
"items": { "items": {
"type": "string", "type": "string",
"description": "file url" "description": "file url"
} }
}, },
"show_current_url": { "show_current_url": {
"type": "boolean", "type": "boolean",
"description": "check if need to extract the current url" "description": "check if need to extract the current url"
}, },
"press_key": { "press_key": {
"type": "string", "type": "string",
"enum": [ "Enter" ], "enum": [ "Enter" ],
"description": "press key after input text" "description": "press key after input text"
},
"wait_time": {
"type": "number",
"description": "wait time after action in seconds"
} }
}, },
"required": [ "selector", "action" ] "required": [ "selector", "action" ]