From 442abae8acda2b30c872d946da0af4d5b8243a2d Mon Sep 17 00:00:00 2001 From: leehuwuj <leehuwuj@gmail.com> Date: Wed, 29 May 2024 08:40:16 +0700 Subject: [PATCH] add openapi tool and http request tool --- helpers/tools.ts | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/helpers/tools.ts b/helpers/tools.ts index a41764eb..2f7bb75d 100644 --- a/helpers/tools.ts +++ b/helpers/tools.ts @@ -117,6 +117,50 @@ export const supportedTools: Tool[] = [ }, ], }, + { + display: "OpenAPI", + name: "openapi.OpenAPIToolSpec", + dependencies: [ + { + name: "llama-index-tools-openapi", + version: "0.1.3", + }, + { + name: "jsonschema", + version: "^4.22.0", + }, + ], + config: { + url: "The URL of the OpenAPI schema", + }, + supportedFrameworks: ["fastapi"], + type: ToolType.LLAMAHUB, + envVars: [ + { + name: TOOL_SYSTEM_PROMPT_ENV_VAR, + description: "System prompt for openapi tool.", + value: `You can use the provided OpenAPI schema to see the available endpoints to make requests with the HTTP Request tool.`, + }, + ], + }, + { + display: "HTTP Request", + name: "requests.RequestsToolSpec", + dependencies: [], + supportedFrameworks: ["fastapi"], + type: ToolType.LLAMAHUB, + config: { + domain_headers: + "A mapping of domain to its headers. Example: example.com: {}", + }, + envVars: [ + { + name: TOOL_SYSTEM_PROMPT_ENV_VAR, + description: "System prompt for openapi tool.", + value: `You can make HTTP requests to the provided domain.`, + }, + ], + }, ]; export const getTool = (toolName: string): Tool | undefined => { -- GitLab