OpenAI最新官方ChatGPT聊天插件接口《插件部署上生产》全网最详细中英文实用指南和教程,助你零基础快速轻松掌握全新技术(五)(附源码)

2023-10-26

在这里插入图片描述

前言

插件可以让 ChatGPT 具有更强大的功能和更灵活的扩展性,使得我们的系统更加适应不同领域的需求。

在生产环境使用插件时,我们一定要保证插件的质量和可靠性。一个不稳定的插件可能会严重影响 ChatGPT 的性能,甚至导致系统崩溃。因此,在引入插件之前,我们需要经过充分的测试和验证,并仔细考虑其是否真正符合我们的需求和标准。

同时,在生产环境中使用插件还需要注意安全问题。恶意插件可能会造成信息泄漏、攻击等安全问题,对用户造成极大的危害。因此,在使用插件时,我们需要仔细审查其源代码,防范潜在的风险。

Rate limits 速率限制

Consider implementing rate limiting on the API endpoints you expose. While the current scale is limited, ChatGPT is widely used and you should expect a high volume of requests. You can monitor the number of requests and set limits accordingly.
考虑在您公开的API端点上实施速率限制。虽然目前的规模有限,但ChatGPT被广泛使用,您应该期待大量的请求。您可以监视请求的数量并相应地设置限制。

Updating your plugin 更新您的插件

After deploying your plugin to production, you might want to make changes to the ai-plugin.json manifest file. Currently, manifest files must be manually updated by going through the “Develop your own plugin” flow in the plugin store each time you make a change to the file.
在将插件部署到生产环境后,您可能希望对 ai-plugin.json 清单文件进行更改。目前,清单文件必须在每次更改文件时通过插件商店中的“Develop your own plugin”流程手动更新。

ChatGPT will automatically fetch the latest OpenAPI spec each time a request is made.
ChatGPT将在每次请求时自动获取最新的OpenAPI规范。

Plugin terms

In order to register a plugin, you must agree to the Plugin Terms.
为了注册插件,您必须同意插件条款。

Domain verification and security 域验证和安全性

To ensure that plugins can only perform actions on resources that they control, OpenAI enforces requirements on the plugin’s manifest and API specifications.
为了确保插件只能在它们控制的资源上执行操作,OpenAI对插件的清单和API规范强制执行要求。

Defining the plugin’s root domain 定义插件的根域

The manifest file defines information shown to the user (like logo and contact information) as well as a URL where the plugin’s OpenAPI spec is hosted. When the manifest is fetched, the plugin’s root domain is established following these rules:
清单文件定义了显示给用户的信息(如徽标和联系信息)以及托管插件的OpenAPI规范的URL。当获取清单时,插件的根域将按照以下规则建立:

  • If the domain has www. as a subdomain, then the root domain will strip out www. from the domain that hosts the manifest.
    如果域具有 www. 作为子域,则根域将从托管清单的域中去除 www.
  • Otherwise, the root domain is the same as the domain that hosts the manifest.
    否则,根域与承载清单的域相同。

Note on redirects: If there are any redirects in resolving the manifest, only child subdomain redirects are allowed. The only exception is following a redirect from a www subdomain to one without the www.
重定向注意事项:如果在解析清单时有任何重定向,则只允许子子域重定向。唯一的例外是从www子域重定向到没有www的子域。

  • ✅ https://example.com/.well-known/ai-plugin.json
    Root domain: example.com
  • ✅ https://www.example.com/.well-known/ai-plugin.json
    Root domain: example.com
  • ✅ https://www.example.com/.well-known/ai-plugin.json → redirects to https://example.com/.well-known/ai-plugin.json
    Root domain: example.com
  • ✅ https://foo.example.com/.well-known/ai-plugin.json → redirects to https://bar.foo.example.com/.well-known/ai-plugin.json
    Root domain: bar.foo.example.com
  • ✅ https://foo.example.com/.well-known/ai-plugin.json → redirects to https://bar.foo.example.com/baz/ai-plugin.json
    Root domain: bar.foo.example.com
  • ❌ https://foo.example.com/.well-known/ai-plugin.json → redirects to https://example.com/.well-known/ai-plugin.json
    Redirect to parent level domain is disallowed 不允许重定向到父级域
  • ❌ https://foo.example.com/.well-known/ai-plugin.json → redirects to https://bar.example.com/.well-known/ai-plugin.json
    Redirect to same level subdomain is disallowed 不允许重定向到同一级别子域
  • ❌ https://example.com/.well-known/ai-plugin.json -> redirects to https://example2.com/.well-known/ai-plugin.json
    Redirect to another domain is disallowed 不允许重定向到另一个域

Manifest validation 清单验证

Specific fields in the manifest itself must satisfy the following requirements:
清单本身中的特定字段必须满足以下要求:

  • api.url - the URL provided to the OpenAPI spec must be hosted at the same level or a subdomain of the root domain.
    api.url -提供给OpenAPI规范的URL必须托管在根域的同一级别或子域。
  • legal_info - The second-level domain of the URL provided must be the same as the second-level domain of the root domain.
    legal_info -提供的URL的二级域名必须与根域名的二级域名相同。
  • contact_info - The second-level domain of the email address should be the same as the second-level domain of the root domain.
    contact_info -电子邮件地址的二级域应与根域的二级域相同。

Resolving the API spec 解析API规范

The api.url field in the manifest provides a link to an OpenAPI spec that defines APIs that the plugin can call into. OpenAPI allows specifying multiple server base URLs. The following logic is used to select the server URL:
清单中的 api.url 字段提供了一个指向OpenAPI规范的链接,该规范定义了插件可以调用的API。OpenAPI允许指定多个服务器基础URL。以下逻辑用于选择服务器URL:

  • Iterate through the list of server URLs
    遍历服务器URL列表
  • Use the first server URL that is either an exact match of the root domain or a subdomain of the root domain
    使用与根域或根域的子域完全匹配的第一个服务器URL
  • If neither cases above apply, then default to the domain where the API spec is hosted. For example, if the spec is hosted on api.example.com, then api.example.com will be used as the base URL for the routes in the OpenAPI spec.
    如果以上两种情况都不适用,则默认为API规范所在的域。例如,如果规范托管在 api.example.com 上,那么 api.example.com 将用作OpenAPI规范中路由的基本URL。

Note: Please avoid using redirects for hosting the API spec and any API endpoints, as it is not guaranteed that redirects will always be followed.
注意:请避免使用重定向来托管API规范和任何API端点,因为不能保证重定向总是被遵循。

Use TLS and HTTPS 使用TLS和HTTPS

All traffic with the plugin (e.g., fetching the ai-plugin.json file, the OpenAPI spec, API calls) must use TLS 1.2 or later on port 443 with a valid public certificate.
与插件的所有流量(例如,获取 ai-plugin.json 文件、OpenAPI规范、API调用)必须在端口443上使用TLS 1.2或更高版本,并具有有效的公共证书。

IP egress ranges IP出口范围

ChatGPT will call your plugin from an IP address in the CIDR block 23.102.140.112/28. You may wish to explicitly allowlist these IP addresses.
ChatGPT将从CIDR块中的IP地址调用插件 23.102.140.112/28 。您可能希望明确允许列出这些IP地址。

Separately, OpenAI’s web browsing plugin accesses websites from a different IP address block: 23.98.142.176/28.
另外,OpenAI的网页浏览插件从不同的IP地址块访问网站23.98.142.176/28

FAQ 问答

How is plugin data used? 如何使用插件数据?

Plugins connect ChatGPT to external apps. If a user enables a plugin, ChatGPT may send parts of their conversation and their country or state to your plugin.
插件将ChatGPT连接到外部应用程序。如果用户启用了插件,ChatGPT可能会将他们的部分对话以及他们的国家或州发送到您的插件。

What happens if a request to my API fails? 如果对我的API的请求失败,会发生什么?

If an API request fails, the model might retry the request up to 10 times before letting the user know it cannot get a response from that plugin.
如果API请求失败,模型可能会重试请求多达10次,然后才能让用户知道它无法从该插件获得响应。

Can I invite people to try my plugin? 我可以邀请别人试用我的插件吗?

Yes, all unverified plugins can be installed by up to 15 users. At launch, only other developers with access will be able to install the plugin. We plan to expand access over time and will eventually roll out a process to submit your plugin for review before being made available to all users.
是的,所有未经验证的插件最多可以由15个用户安装。在启动时,只有其他具有访问权限的开发人员才能安装该插件。我们计划随着时间的推移扩大访问范围,并最终推出一个流程,在向所有用户提供之前提交您的插件进行审查。

Can I charge people money for my plugin? 我可以为我的插件向人们收取费用吗?

Yes, we encourage you to consider a limited number of free API calls but understand that it requires resources to run your plugin.
是的,我们鼓励您考虑有限数量的免费API调用,但要理解它需要资源来运行您的插件。

其它资料下载

如果大家想继续了解人工智能相关学习路线和知识体系,欢迎大家翻阅我的另外一篇博客《重磅 | 完备的人工智能AI 学习——基础知识学习路线,所有资料免关注免套路直接网盘下载
这篇博客参考了Github知名开源平台,AI技术平台以及相关领域专家:Datawhale,ApacheCN,AI有道和黄海广博士等约有近100G相关资料,希望能帮助到所有小伙伴们。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

OpenAI最新官方ChatGPT聊天插件接口《插件部署上生产》全网最详细中英文实用指南和教程,助你零基础快速轻松掌握全新技术(五)(附源码) 的相关文章

随机推荐

  • Python实现队列

    Python实现队列 关于队列的介绍 请参考 https blog csdn net weixin 43790276 article details 104033337 队列的数据存储结构可以是顺序表 也可以是链表 本篇使用 Python
  • Keil中工程文件编译后没有显示.h文件

    一 第一种解决方法 打开Keil软件 重新打开试试 二 第二种解决方法 查看是否点击了Show include File Dependencies 1 右击源组 记住 一定是右击 不是双击 就可以看到如下画面 如果你没有打勾的话 那就是如下
  • 开源项目哪家强?Github年终各大排行榜超级盘点(内附开源项目学习资源)

    整理 Jane 出品 AI科技大本营 导语 提到开源项目 2018 年注定是不平凡的一年 据 Octoverse 报告数据 仅在 2018 年 Github 上的新用户就比过去六年的用户总数还要多 存储库数量近一亿 这些增长都要归功于开源社
  • Linux 系统中kill命令杀死进程常用技巧

    目录 前言 基础 进阶 1 查找进程号的方式进行改进 2 将常规的两步杀死进程合并为一步 3 强制踢掉登陆用户 kill的注意事项 前言 在Linux的系统中 kill是我们最常见的命令之一 kill 英语中为杀死的意思 顾名思义 就是用来
  • pytorch中使用detach()

    import torch nn as nn import torch class net nn Module def init self super init self conv nn Conv2d 3 6 3 stride 2 paddi
  • GOOGLE地图基站定位-Google Mobile Maps API

    如果你在你的手机装过Google Mobile Maps 你就可以发现只要你的手机能连接GPRS 即使没有GPS功能 也能定位到你手机所在的位置 只是精度不够准确 在探讨这个原理之前 我们需要了解一些移动知识 了解什么是MNC LAC Ce
  • Spark SQL 基本操作

    将下列JSON格式数据复制到Linux系统中 并保存命名为employee json id 1 name Ella age 36 id 2 name Bob age 29 id 3 name Jack age 29 id 4 name Ji
  • 【财富空间】一场史无前例的白领破产潮,正在来袭!

    来源 水木然 ID smr8700 最近 我们在上海做一个项目 准备招一个部门经理 于是发了招聘启示 应聘的人符合条件的很少 这不算什么 最令我吃惊的是 他们基本上个个都是要求年薪百万以上 放眼四望 诺大的上海 除去垄断国企 大牌的外企 再
  • xshell及xftp更新提示:Xshell出现要继续使用此程序必须应用到最新的更新或使用新版本

    一 前言 java开发者或者linux运维都肯定会用到xshell及xftp工具 说实话这两个工具真心是好用 但是有两个问题一直困扰这我 1 每次打开xshell或xftp总是会提示更新 2 今天打开xftp的时候 突然提示 要继续使用此程
  • Arduino基础 — Arduino 字符串

    Arduino 字符串 在Arduino编程中有两位字符串 1 字符数组 与C语言编程使用相同 2 Arduino 字符串 它允许我们在代码中使用字符对象 字符串数组 字符串是一个特殊的数组 在字符串的末尾有一个额外的元素 其值总是为0 零
  • 面试鹅厂,我三面被虐的体无完肤……

    戳蓝字 CSDN云计算 关注我们哦 作者 codegoose 来源 https segmentfault com a 1190000017864721 经过半年的沉淀 加上对MySQL redis和分布式这块的补齐 终于重拾面试信心 再次出
  • SOLO代码阅读解析

    SOLO是一种直接预测instance mask的范式 摒弃了之前top down和bottom up两种主流的实例分割方法 从而pipeline更加简洁直观 这篇文章以官方代码中的demo为例 简单梳理一下SOLO在inference时的
  • etcd编译与简单使用

    etcd是用go语言编写的 首先安装与配置go语言的环境 ubuntu1404安装go开发环境参考 http xhrwang me 2014 12 22 go dev env html http go ctolib com topics 3
  • 队列的C语言实现

    头文件 Queue h typedef int BTDataType typedef struct BindaryTreeNode BTDataType data struct BindaryTreeNode left struct Bin
  • Elasticsearch解决只能查询10000条数据方案

    es官方默认限制索引查询最多只能查询10000条数据 查询第10001条数据开始就会报错 Result window is too large from size must be less than or equal to 但是很多时候10
  • tan和atan--正切和反正切函数

    功能简介 求变量的正切和反正切 语法格式 1 Y tan X 求X中元素的正切值 元素可以为复数 tan函数是周期函数 以pi为一个周期 当元素值等于pi 2的奇数倍时 函数失去定义 在三角函数中 tan x sin x cos x 2 Y
  • P1025 数的划分(dfs/dp)

    题目 https www luogu com cn problem P1025 题目描述 将整数n分成k份 且每份不能为空 任意两个方案不相同 不考虑顺序 例如 n 7 k 3 下面三种分法被认为是相同的 1 1 5 1 5 1 5 1 1
  • 关于vscode头文件出现红色波浪曲线问题

    关于vscode头文件总显示红色波浪曲线解决 方法1 可以在设置中直接关掉 方法2 没有添加编译器的路径 我们可以找到gcc exe所在的路径 或者重新安装官网下载 解压到c盘非中文路径 复制路径 主要是看gcc g 所在的路径
  • 环信iOS使用步骤及使用总结

    环信iOS使用步骤及使用总结 第一步 集成 请参照环信官方文档http docs easemob com im 300iosclientintegration 20iossdkimport 集成 iOSSDK 在您阅读此文档时 我们假定您已
  • OpenAI最新官方ChatGPT聊天插件接口《插件部署上生产》全网最详细中英文实用指南和教程,助你零基础快速轻松掌握全新技术(五)(附源码)

    Plugins in production 插件部署上生产 前言 Rate limits 速率限制 Updating your plugin 更新您的插件 Plugin terms Domain verification and secur