企业 Tools
最新更新:2024-02-20

企业 Tools

image-20240220173428986

在这里,您可以管理您创建的 Tools。

创建 Tool

您可以通过创建 Tool,并通过 Tool 访问外部数据。

鉴权

image-20240220173559661

在这里,可以为 Tool 配置鉴权方式。

  • 开发方鉴权:即 Tool 由 Tool 的开发者来执行鉴权。由开发方鉴权的 Tool,可以被其他组织添加并集成至 Bot 内使用。
  • 集成方鉴权:即 Tool 由需要集成该 Tool 的组织的管理员来执行鉴权,鉴权通过后,Tool 才能被添加至组织内。

同时,也可以为 Tool 配置是否「收费」。若选择「站内付费」,则您可以设置一个积分收取值。若其他组织的 Bot 调用了该 Tool,则每次 Tool 调用,该组织都将向您支付该积分数。

参数配置

您可以在 JSON 配置区域,对插件参数进行配置。

{ "openapi": "3.0.0", "servers": [ { "url": "请求的域名,必须是 URL 地址格式,如:https://restapi.amap.com" } ], "paths": { "/api/custom/path": { "get": { "operationId": "【必填】接口名称,名称可由英文和下划线组成,禁止使用空格。如:getAdCode、get_Ad_Code" "description": "【必填】清晰描述接口功能,由 LLM 判断调用该接口时机,描述文案长度限制为 200 个字符长度。" "parameters": [ { "name": "【必填】参数字段名称,如:key", "in": "【必填】参数位置,支持:path(路径参数)/query(追加在 url 地址之后的参数)/header(请求中使用的自定义请求头)/cookie(特定的 cookie 值)", "description":"【必填】清晰描述参数含义,描述文案长度限制为 200 个字符长度。" "required": true, "schema": { "type": "字段类型,支持:integer/number/string/boolean", "default": "参数的默认值,如:e1a791daabb6b8d2bc8cb22633e37" } } ], "responses": { "200": { "description": "响应的描述", "content": { "*/*": { "schema": { "type": "string" } } } }, "403": { "description": "Authentication failed" } } } }, "post": { "operationId": "【必填】接口名称,名称可由英文和下划线组成,禁止使用空格。如:createUser、create_User" "description":"【必填】清晰描述接口功能,由 LLM 判断调用该接口时机,描述文案长度限制为 200 个字符长度。" "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/User" } } } }, "responses": { "200": { "description": "User created successfully", "content": { "application/json": { "schema": { "$ref": "引用,例如:#/components/schemas/User" } } } }, "400": { "description": "Invalid request" } } } , "components": { "schemas": { "User": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string", "format": "email" } }, "required": ["name", "email"] } } } }
          {
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "请求的域名,必须是 URL 地址格式,如:https://restapi.amap.com"
    }
  ],
  "paths": {
    "/api/custom/path": {
      "get": {
        "operationId": "【必填】接口名称,名称可由英文和下划线组成,禁止使用空格。如:getAdCode、get_Ad_Code"
        "description": "【必填】清晰描述接口功能,由 LLM 判断调用该接口时机,描述文案长度限制为 200 个字符长度。"
        "parameters": [
          {
            "name": "【必填】参数字段名称,如:key",
            "in": "【必填】参数位置,支持:path(路径参数)/query(追加在 url 地址之后的参数)/header(请求中使用的自定义请求头)/cookie(特定的 cookie 值)",
            "description":"【必填】清晰描述参数含义,描述文案长度限制为 200 个字符长度。"
            "required": true,
            "schema": {
              "type": "字段类型,支持:integer/number/string/boolean",
              "default": "参数的默认值,如:e1a791daabb6b8d2bc8cb22633e37"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "响应的描述",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Authentication failed"
          }
        }
      }
    },
    "post": {
        "operationId": "【必填】接口名称,名称可由英文和下划线组成,禁止使用空格。如:createUser、create_User"    
        "description":"【必填】清晰描述接口功能,由 LLM 判断调用该接口时机,描述文案长度限制为 200 个字符长度。"
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/User"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "User created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "引用,例如:#/components/schemas/User"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          }
        }
      }
    ,
  "components": {
    "schemas": {
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          }
        },
        "required": ["name", "email"]
      }
    }
  }
}

        
此代码块在浮窗中显示

该 Tool 能根据用户要求,执行谷歌搜索,获取搜索结果。

{ "openapi": "3.0.0", "servers": [ { "url": "https://www.googleapis.com" } ], "paths": { "/customsearch/v1": { "get": { "description": "A wrapper around Google Search. Useful for when you need to answer questions about current events. Input should be a search query.", "operationId": "GoogleSearch", "parameters": [ { "name": "q", "in": "query", "description": "Queried questions.", "required": true, "schema": { "type": "string", "default": "question" } } ], "responses": { "200": { "description": "Successful response", "content": { "*/*": { "schema": { "type": "string" } } } }, "403": { "description": "Authentication failed" } } } } } }
          {
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://www.googleapis.com"
    }
  ],
  "paths": {
    "/customsearch/v1": {
      "get": {
        "description": "A wrapper around Google Search. Useful for when you need to answer questions about current events. Input should be a search query.",
        "operationId": "GoogleSearch",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Queried questions.",
            "required": true,
            "schema": {
              "type": "string",
              "default": "question"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "*/*": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Authentication failed"
          }
        }
      }
    }
  }
}

        
此代码块在浮窗中显示

案例:WeatherWhiz

该 Tool 能查询特定地点的天气情况。

{ "openapi": "3.0.2", "info": { "title": "WeatherWhiz", "description": "Get weather information for a given location and time option.", "version": "1.0.0" }, "servers": [ { "url": "https://redantai.pythonanywhere.com/" } ], "paths": { "/weather/": { "get": { "operationId": "getWeatherByLocation", "description": "Get weather information for a given location and time option.)", "parameters": [ { "in": "query", "name": "location", "schema": { "type": "string" }, "required": true, "description": "The location for which to get the weather information" }, { "in": "query", "name": "time", "schema": { "type": "string" }, "required": true, "description": "The time option for the weather forecast ('current', 'minutely', 'hourly', 'daily')" } ], "responses": { "200": { "description": "A JSON object containing weather information for the specified location and time option" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string", "example": "Invalid input. Please provide a valid location and time option." } } } } } } } } } } }
          {
  "openapi": "3.0.2",
  "info": {
    "title": "WeatherWhiz",
    "description": "Get weather information for a given location and time option.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://redantai.pythonanywhere.com/"
    }
  ],
  "paths": {
    "/weather/": {
      "get": {
        "operationId": "getWeatherByLocation",
        "description": "Get weather information for a given location and time option.)",
        "parameters": [
          {
            "in": "query",
            "name": "location",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "The location for which to get the weather information"
          },
          {
            "in": "query",
            "name": "time",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "The time option for the weather forecast ('current', 'minutely', 'hourly', 'daily')"
          }
        ],
        "responses": {
          "200": {
            "description": "A JSON object containing weather information for the specified location and time option"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Invalid input. Please provide a valid location and time option."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

        
此代码块在浮窗中显示

案例:PortfoliosLab

该 Tool 能调用 PortfoliosLab 的服务,通过公司名称,查询股票、ETF、基金的股市数据。

{ "openapi": "3.0.0", "info": { "title": "PortfoliosLab API", "description": "API to get financial information about ETFs.", "version": "1.0.0" }, "servers": [ { "url": "https://portfolioslab.com/api" } ], "paths": { "/symbol/{symbol}": { "get": { "operationId": "getSymbol", "summary": "Get information about a specific symbol.", "description": "Get information about a specific symbol.Retrieves detailed information about the ETF, stock, mutual fund, index, or crypto currency specified by its symbol name.", "parameters": [ { "in": "path", "name": "symbol", "schema": { "type": "string" }, "required": true, "description": "The symbol name (e.g., VTI, AAPL, BTC-USD)." } ], "responses": { "200": { "description": "Successful operation", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Symbol" } } } } } } } }, "components": { "schemas": { "Symbol": { "type": "object", "properties": { "cusip": { "type": "string", "example": "922908769" }, "created": { "type": "string", "format": "date-time", "example": "2022-06-07T07:56:40.798Z" }, "description": { "type": "string", "example": "VTI is an exchange-traded fund (ETF) that tracks the performance of the CRSP US Total Market Index. ..." }, "type": { "type": "string", "example": "ETF" }, "indicators": { "$ref": "#/components/schemas/Indicators" }, "full_name": { "type": "string", "example": "Vanguard Total Stock Market ETF" }, "name": { "type": "string", "example": "VTI" }, "alternatives": { "type": "array", "items": { "type": "string" }, "example": [ "SPY", "VT", "VOO", "ITOT", "SPHD", "SPTM", "VWO", "VXUS" ] }, "currency": { "type": "string", "example": "USD" }, "exchange": { "type": "string", "nullable": true }, "updated": { "type": "string", "format": "date-time", "example": "2023-05-03T10:32:37.717737" }, "isin": { "type": "string", "example": "US9229087690" }, "info": { "$ref": "#/components/schemas/Info" } } }, "Indicators": { "type": "object", "properties": { "return5Y": { "type": "number", "format": "float", "example": 0.1033, "description": "The 5-year annualized return of the symbol." }, "return10Y": { "type": "number", "format": "float", "example": 0.1139, "description": "The 10-year annualized return of the symbol." }, "maxDrawdown": { "type": "number", "format": "float", "example": -0.5545, "description": "The maximum drawdown of the symbol." }, "return1Y": { "type": "number", "format": "float", "example": 0.0015, "description": "The 1-year annualized return of the symbol." }, "dividendYield": { "type": "number", "format": "float", "example": 0.0195, "description": "The dividend yield of the symbol." }, "volatility10Y": { "type": "number", "format": "float", "example": 0.1786, "description": "The 10-year annualized volatility of the symbol." }, "volatility1Y": { "type": "number", "format": "float", "example": 0.2298, "description": "The 1-year annualized volatility of the symbol." }, "returnYTD": { "type": "number", "format": "float", "example": 0.0696, "description": "The year-to-date return of the symbol." }, "volatility5Y": { "type": "number", "format": "float", "example": 0.219, "description": "The 5-year annualized volatility of the symbol." }, "sharpe": { "type": "number", "format": "float", "example": 0.0063, "description": "The Sharpe ratio of the symbol." }, "ulcerIndex": { "type": "number", "format": "float", "example": 0.0861, "description": "The Ulcer Index of the symbol." }, "calmar": { "type": "number", "format": "float", "example": 0.0087, "description": "The Calmar ratio of the symbol." }, "omega": { "type": "number", "format": "float", "example": 1.0023, "description": "The Omega ratio of the symbol." }, "sortino": { "type": "number", "format": "float", "example": 0.0198, "description": "The Sortino ratio of the symbol." } } }, "Info": { "type": "object", "properties": { "asset_class": { "type": "string", "example": "Equity" }, "inception": { "type": "string", "format": "date", "example": "2001-05-24" }, "asset_class_style": { "type": "string", "example": "Blend" }, "issuer": { "type": "string", "example": "Vanguard" }, "structure": { "type": "string", "example": "ETF" }, "asset_class_size": { "type": "string", "example": "Large-Cap" }, "home_page": { "type": "string", "example": "https://advisors.vanguard.com/investments/products/VTI" }, "issuer_slug": { "type": "string", "example": "vanguard" }, "expense_ratio": { "type": "string", "example": "0.03" }, "region_general": { "type": "string", "example": "North America" }, "asset_class_slug": { "type": "string", "example": "equity" }, "index_tracked": { "type": "string", "example": "CRSP US Total Market Index" }, "region_specific": { "type": "string", "example": "U.S." }, "category": { "type": "array", "items": { "type": "string" }, "example": [ "Large Cap Growth Equities" ] }, "category_slug": { "type": "array", "items": { "type": "string" }, "example": [ "large-cap-growth-equities" ] } } } } } }
          {
  "openapi": "3.0.0",
  "info": {
    "title": "PortfoliosLab API",
    "description": "API to get financial information about ETFs.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://portfolioslab.com/api"
    }
  ],
  "paths": {
    "/symbol/{symbol}": {
      "get": {
        "operationId": "getSymbol",
        "summary": "Get information about a specific symbol.",
        "description": "Get information about a specific symbol.Retrieves detailed information about the ETF, stock, mutual fund, index, or crypto currency specified by its symbol name.",
        "parameters": [
          {
            "in": "path",
            "name": "symbol",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "The symbol name (e.g., VTI, AAPL, BTC-USD)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Symbol"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Symbol": {
        "type": "object",
        "properties": {
          "cusip": {
            "type": "string",
            "example": "922908769"
          },
          "created": {
            "type": "string",
            "format": "date-time",
            "example": "2022-06-07T07:56:40.798Z"
          },
          "description": {
            "type": "string",
            "example": "VTI is an exchange-traded fund (ETF) that tracks the performance of the CRSP US Total Market Index. ..."
          },
          "type": {
            "type": "string",
            "example": "ETF"
          },
          "indicators": {
            "$ref": "#/components/schemas/Indicators"
          },
          "full_name": {
            "type": "string",
            "example": "Vanguard Total Stock Market ETF"
          },
          "name": {
            "type": "string",
            "example": "VTI"
          },
          "alternatives": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "SPY",
              "VT",
              "VOO",
              "ITOT",
              "SPHD",
              "SPTM",
              "VWO",
              "VXUS"
            ]
          },
          "currency": {
            "type": "string",
            "example": "USD"
          },
          "exchange": {
            "type": "string",
            "nullable": true
          },
          "updated": {
            "type": "string",
            "format": "date-time",
            "example": "2023-05-03T10:32:37.717737"
          },
          "isin": {
            "type": "string",
            "example": "US9229087690"
          },
          "info": {
            "$ref": "#/components/schemas/Info"
          }
        }
      },
      "Indicators": {
        "type": "object",
        "properties": {
          "return5Y": {
            "type": "number",
            "format": "float",
            "example": 0.1033,
            "description": "The 5-year annualized return of the symbol."
          },
          "return10Y": {
            "type": "number",
            "format": "float",
            "example": 0.1139,
            "description": "The 10-year annualized return of the symbol."
          },
          "maxDrawdown": {
            "type": "number",
            "format": "float",
            "example": -0.5545,
            "description": "The maximum drawdown of the symbol."
          },
          "return1Y": {
            "type": "number",
            "format": "float",
            "example": 0.0015,
            "description": "The 1-year annualized return of the symbol."
          },
          "dividendYield": {
            "type": "number",
            "format": "float",
            "example": 0.0195,
            "description": "The dividend yield of the symbol."
          },
          "volatility10Y": {
            "type": "number",
            "format": "float",
            "example": 0.1786,
            "description": "The 10-year annualized volatility of the symbol."
          },
          "volatility1Y": {
            "type": "number",
            "format": "float",
            "example": 0.2298,
            "description": "The 1-year annualized volatility of the symbol."
          },
          "returnYTD": {
            "type": "number",
            "format": "float",
            "example": 0.0696,
            "description": "The year-to-date return of the symbol."
          },
          "volatility5Y": {
            "type": "number",
            "format": "float",
            "example": 0.219,
            "description": "The 5-year annualized volatility of the symbol."
          },
          "sharpe": {
            "type": "number",
            "format": "float",
            "example": 0.0063,
            "description": "The Sharpe ratio of the symbol."
          },
          "ulcerIndex": {
            "type": "number",
            "format": "float",
            "example": 0.0861,
            "description": "The Ulcer Index of the symbol."
          },
          "calmar": {
            "type": "number",
            "format": "float",
            "example": 0.0087,
            "description": "The Calmar ratio of the symbol."
          },
          "omega": {
            "type": "number",
            "format": "float",
            "example": 1.0023,
            "description": "The Omega ratio of the symbol."
          },
          "sortino": {
            "type": "number",
            "format": "float",
            "example": 0.0198,
            "description": "The Sortino ratio of the symbol."
          }
        }
      },
      "Info": {
        "type": "object",
        "properties": {
          "asset_class": {
            "type": "string",
            "example": "Equity"
          },
          "inception": {
            "type": "string",
            "format": "date",
            "example": "2001-05-24"
          },
          "asset_class_style": {
            "type": "string",
            "example": "Blend"
          },
          "issuer": {
            "type": "string",
            "example": "Vanguard"
          },
          "structure": {
            "type": "string",
            "example": "ETF"
          },
          "asset_class_size": {
            "type": "string",
            "example": "Large-Cap"
          },
          "home_page": {
            "type": "string",
            "example": "https://advisors.vanguard.com/investments/products/VTI"
          },
          "issuer_slug": {
            "type": "string",
            "example": "vanguard"
          },
          "expense_ratio": {
            "type": "string",
            "example": "0.03"
          },
          "region_general": {
            "type": "string",
            "example": "North America"
          },
          "asset_class_slug": {
            "type": "string",
            "example": "equity"
          },
          "index_tracked": {
            "type": "string",
            "example": "CRSP US Total Market Index"
          },
          "region_specific": {
            "type": "string",
            "example": "U.S."
          },
          "category": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "Large Cap Growth Equities"
            ]
          },
          "category_slug": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "large-cap-growth-equities"
            ]
          }
        }
      }
    }
  }
}

        
此代码块在浮窗中显示