44
55namespace BotSharp . Core . Rules . Actions ;
66
7- public sealed class HttpRequestAction : IRuleAction
7+ public class HttpRequestAction : IRuleAction
88{
99 private readonly IServiceProvider _services ;
1010 private readonly ILogger < HttpRequestAction > _logger ;
@@ -22,11 +22,26 @@ public HttpRequestAction(
2222
2323 public string Name => "http_request" ;
2424
25- // Default configuration example:
26- // {
27- // "http_url": "https://dummy.example.com/api/v1/employees",
28- // "http_method": "GET"
29- // }
25+ public FlowUnitSchema ? InputSchema => new (
26+ properties : new ( )
27+ {
28+ [ "http_url" ] = new ( "string" , "The HTTP URL to request" ) ,
29+ [ "http_method" ] = new ( "string" , "HTTP method: GET, POST, PUT, DELETE, PATCH" ) ,
30+ [ "http_query_params" ] = new ( "array" , "Query parameters as key-value pairs" ) ,
31+ [ "http_request_headers" ] = new ( "array" , "Request headers as key-value pairs" ) ,
32+ [ "http_request_body" ] = new ( "string" , "Request body (JSON string)" )
33+ } ,
34+ required : [ "http_url" , "http_method" ]
35+ ) ;
36+
37+ public FlowUnitSchema ? OutputSchema => new (
38+ properties : new ( )
39+ {
40+ [ "http_response" ] = new ( "string" , "The HTTP response body" ) ,
41+ [ "http_response_headers" ] = new ( "string" , "The HTTP response headers as JSON" )
42+ } ,
43+ required : [ "http_response" , "http_response_headers" ]
44+ ) ;
3045
3146 public async Task < RuleNodeResult > ExecuteAsync (
3247 Agent agent ,
0 commit comments