Merge branch 'SciSharp:master' into master
This commit is contained in:
commit
a8e436de5c
|
|
@ -35,6 +35,12 @@ public class ElementActionArgs
|
|||
/// </summary>
|
||||
public int WaitTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Add current url to the content
|
||||
/// </summary>
|
||||
[JsonPropertyName("show_current_url")]
|
||||
public bool ShowCurrentUrl { get; set; } = false;
|
||||
|
||||
/// <summary>
|
||||
/// Required for deserialization
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>$(TargetFramework)</TargetFramework>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public class UtilWebActionOnElementFn : IFunctionCallback
|
|||
}
|
||||
|
||||
actionArgs.WaitTime = 2;
|
||||
|
||||
|
||||
var conv = _services.GetRequiredService<IConversationService>();
|
||||
|
||||
var services = _services.CreateScope().ServiceProvider;
|
||||
|
|
@ -45,7 +45,13 @@ public class UtilWebActionOnElementFn : IFunctionCallback
|
|||
};
|
||||
var result = await browser.ActionOnElement(msg, locatorArgs, actionArgs);
|
||||
|
||||
message.Content = $"{actionArgs.Action} executed {(result.IsSuccess ? "success" : "failed")}";
|
||||
message.Content = $"{actionArgs.Action} executed {(result.IsSuccess ? "success" : "failed")}.";
|
||||
|
||||
// Add Current Url info to the message
|
||||
if (actionArgs.ShowCurrentUrl)
|
||||
{
|
||||
message.Content += $" Current page url: '{result.UrlAfterAction}'.";
|
||||
}
|
||||
|
||||
var path = webDriverService.GetScreenshotFilePath(message.MessageId);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,16 +16,20 @@
|
|||
"content": {
|
||||
"type": "string",
|
||||
"description": "content to input in element"
|
||||
},
|
||||
"file_urls": {
|
||||
},
|
||||
"file_urls": {
|
||||
"type": "array",
|
||||
"description": "The output format must be string array of file urls.",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": "file url"
|
||||
"type": "string",
|
||||
"description": "file url"
|
||||
}
|
||||
},
|
||||
"show_current_url": {
|
||||
"type": "boolean",
|
||||
"description": "check if need to extract the current url"
|
||||
},
|
||||
"press_key": {
|
||||
"press_key": {
|
||||
"type": "string",
|
||||
"enum": [ "Enter" ],
|
||||
"description": "press key after input text"
|
||||
|
|
|
|||
Loading…
Reference in a new issue