From aaf192be427ede4e240066cca193a10bfddd9562 Mon Sep 17 00:00:00 2001 From: Jicheng Lu <103353@smsassist.com> Date: Thu, 30 May 2024 09:51:57 -0500 Subject: [PATCH] remove setting --- .../Routing/Hooks/RoutingAgentHook.cs | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/src/Infrastructure/BotSharp.Core/Routing/Hooks/RoutingAgentHook.cs b/src/Infrastructure/BotSharp.Core/Routing/Hooks/RoutingAgentHook.cs index 4aec88c8..a847f078 100644 --- a/src/Infrastructure/BotSharp.Core/Routing/Hooks/RoutingAgentHook.cs +++ b/src/Infrastructure/BotSharp.Core/Routing/Hooks/RoutingAgentHook.cs @@ -104,51 +104,6 @@ public class RoutingAgentHook : AgentHookBase } }); } - - var settings = _services.GetRequiredService(); - if (settings.EnableHttpHandler) - { - var httpHandlerName = "handle_http_request"; - var existHttpHandler = functions.Any(x => x.Name == httpHandlerName); - var funcs = _services.GetServices(); - var httpRequestFunc = funcs.FirstOrDefault(x => x.Name == httpHandlerName); - if (!existHttpHandler && httpRequestFunc != null) - { - var json = JsonSerializer.Serialize(new - { - request_url = new - { - type = "string", - description = $"The http url that is requested. It can be an absolute url that starts with \"http\" or \"https\", or a relative url that starts with \"/\"" - }, - http_method = new - { - type = "string", - description = $"The http method that is requested, e.g., GET, POST, PUT, and DELETE." - }, - request_content = new - { - type = "string", - description = $"The http request content. It must be in json format." - } - }); - functions.Add(new FunctionDef - { - Name = httpRequestFunc.Name, - Description = "If the user requests to send an http request, you need to capture the http method and request content, and then call this function to send the http request.", - Parameters = - { - Properties = JsonSerializer.Deserialize(json), - Required = new List - { - "request_url", - "http_method" - } - } - }); - } - - } } return base.OnFunctionsLoaded(functions);