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

news2024/10/7 9:18:06

Plugins in production 插件部署上生产

  • 前言
  • Rate limits 速率限制
  • Updating your plugin 更新您的插件
  • Plugin terms
  • Domain verification and security 域验证和安全性
    • Defining the plugin's root domain 定义插件的根域
    • Manifest validation 清单验证
    • Resolving the API spec 解析API规范
    • Use TLS and HTTPS 使用TLS和HTTPS
    • IP egress ranges IP出口范围
  • FAQ 问答
    • How is plugin data used? 如何使用插件数据?
    • What happens if a request to my API fails? 如果对我的API的请求失败,会发生什么?
    • Can I invite people to try my plugin? 我可以邀请别人试用我的插件吗?
    • Can I charge people money for my plugin? 我可以为我的插件向人们收取费用吗?
  • 其它资料下载

在这里插入图片描述

前言

插件可以让 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相关资料,希望能帮助到所有小伙伴们。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/463702.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【小程序】input输入双向数据绑定

小程序中&#xff0c;input标签中的数据为单向绑定&#xff1a; <inputtype"number"bindinput"inputRealmoney"value"{{ amount }}"placeholder"请输入金额" />如上代码&#xff0c;我们绑定了输入框的数据amount&#xff0c;并…

前端后端实现防盗链

防盗链&#xff08;Referer Header&#xff09;是指在网页中嵌入的外部资源&#xff08;如图片、音视频等&#xff09;被非法使用或盗链的现象。为了避免这种情况的发生&#xff0c;我们可以通过前端和后端技术来防止盗链。 前端防盗链 前端防盗链可以通过在页面中添加 JavaSc…

在f1tenth仿真中如何实现更快速的跑圈-曲线分析篇

本文使用蓝桥云课&#xff0c;即开即用&#xff0c;如果配置第三方课程资源&#xff0c;通常也在10分钟内完成。 效果如下&#xff1a; 全部参考资料如下&#xff1a; 蓝桥ROS之f1tenth案例学习与调试&#xff08;失败&#xff09; 蓝桥ROS之f1tenth案例学习与调试&#xff…

Maven 三种archetype说明合集

Maven 三种archetype说明合集【转载】_maven-archetype-quickstart_太阳神LoveU的博客-CSDN博客 新建Maven project项目时&#xff0c;需要选择archetype。 那么&#xff0c;什么是archetype&#xff1f; archetype的意思就是模板原型的意思&#xff0c;原型是一个Maven项目模…

【ant-design-vue】树形表格数据,实现父子关联选择

ant-design-vue 版本1.7.8 ,2.2.8 这两个版本都是不支持树形表格数据&#xff0c;实现父子关联选择 只能自己写方法来实现父子关联选择 <template><a-card><a-table :columns"columnsA" :data-source"tabData" :customRow"tableClic…

Redis数据库和SpringBoot的故事|这一篇就够了(超详细)

&#x1f648;作者简介&#xff1a;练习时长两年半的Java up主 &#x1f649;个人主页&#xff1a;老茶icon &#x1f64a; ps:点赞&#x1f44d;是免费的&#xff0c;却可以让写博客的作者开兴好久好久&#x1f60e; &#x1f4da;系列专栏&#xff1a;Java全栈&#xff0c;计…

路由功能开启

开启路由 转发&#xff0c;为当前实验环境提供路由功能 RouterSrv 1.安装路由和远程访问 选中 路由 和 DirectAccess 和 VPN 2.配置 启用 路由功能 工具 ---- 路由和远程访问----右键 配置启用路由和远程访问 3.测试 找两个在不同网段的 服务端 是否能ping通

基于趋动云部署复旦大学MOSS大模型

首先新建项目&#xff1a; MOSS部署项目&#xff0c;然后选择镜像&#xff0c;直接用官方的镜像就可以。 之后选择数据集&#xff1a; 公开数据集中&#xff0c;MOSS_复旦大学_superx 这个数据集就是了&#xff0c;大小31G多 完成选择后&#xff1a; 点击创建&#xff0c;…

【c语言】enum枚举类型的定义格式 | 基本用法

创作不易&#xff0c;本篇文章如果帮助到了你&#xff0c;还请点赞支持一下♡>&#x16966;<)!! 主页专栏有更多知识&#xff0c;如有疑问欢迎大家指正讨论&#xff0c;共同进步&#xff01; 给大家跳段街舞感谢支持&#xff01;ጿ ኈ ቼ ዽ ጿ ኈ ቼ ዽ ጿ ኈ ቼ ዽ ጿ…

Nuxt3从零到发布

官网地址&#xff1a;Nuxt3 一&#xff1a;创建项目 Node.js -或更新版本v16.10.0 npx nuxi init nuxt-app 如果出现下面错误&#xff0c;请修改DNS为114.114,114,114 创建完成后在 Visual Studio Code 中打开项目文件夹&#xff1a; 二&#xff1a;安装依赖 npm install …

Newegg 新蛋供应链管理良策——EDI

美国新蛋网Newegg平台于2001年在美国洛杉矶创立&#xff0c;服务版图遍及全球52国&#xff0c;全球员工 2200人以上&#xff0c;用户总数达3600万、每月访客数达1700万&#xff0c;持续赢得广大网购用户喜爱&#xff0c;被Forbes与Computer Shopper等多家权威媒体评选为最佳购物…

类的几种实例化方法 new clone 反射 序列化 反序列化

目录 ①用类的new &#xff08;&#xff09;创建 ②用clone方法创建&#xff0c; 需要类实现 Cloneable 接口 ③通过反射机制创建 ④将一个对象实例化后&#xff0c;进行序列化&#xff0c;再反序列化 ①用类的new &#xff08;&#xff09;创建 User user new User(); ②…

如何从身份证号中提取年月日

怎样根据身份证号提取出生日期呢&#xff1f; 下面是一些数据&#xff0c;B列是身份证号&#xff0c;需要把出生日期提取到C列 方法1&#xff1a;技巧法&#xff08;数据-->分列&#xff09; 选中身份证号所在的列&#xff0c;单击菜单栏中的【数据】-->【分列】&#…

H.264/AVC加密----选择加密

文献学习&#xff1a; 《Data Hiding in Encrypted H.264/AVC Video Streams by Codeword Substitution》 期刊&#xff1a;IEEE TRANSACTIONS ON INFORMATION FORENSICS AND SECURITY 简介 通过分析H.264/AVC编解码器的特性&#xff0c;提出了三个敏感部分(IPM、MVD和残差系…

基于深度学习mediapipe的人脸打码人脸模糊教程pyqt5界面附源码

一、人脸识别 人脸识别是一门比较成熟的技术。 它的身影随处可见&#xff0c;刷脸支付&#xff0c;信息审核&#xff0c;监控搜索&#xff0c;人脸打码等。 更多的时候&#xff0c;它是方便了我们的生活&#xff0c;足不出户&#xff0c;就可以实现各种 APP 的实名认证&…

格式化数据恢复怎么做?超实用的3种方法在这!

案例&#xff1a;格式化数据怎么恢复 【我的电脑前段时间中病毒了&#xff0c;无奈之下我只能将其格式化&#xff0c;但是很多重要的文件和图片之类的也一起被删除了&#xff0c;有什么方法可以恢复这些格式化的数据吗&#xff1f;非常着急&#xff01;】 格式化数据恢复&…

1390:食物链【NOI2001】

1390&#xff1a;食物链【NOI2001】 时间限制: 1000 ms 内存限制: 65536 KB 【题目描述】 动物王国中有三类动物A,B,C&#xff0c;这三类动物的食物链构成了有趣的环形。A吃B&#xff0c; B吃C&#xff0c;C吃A。 现有N个动物&#xff0c;以1&#xff0d;N编号。每个动…

安全常见基础名词概念

一、域名 1、域名&#xff1a;相当网站的名字&#xff0c;互联网上某一台计算机或计算机组的名称&#xff0c;用于在数据传输时标识计算机的电子方位。 2、网域名系统&#xff08;Domain Name System&#xff09;有时也简称为域名&#xff08;DNS&#xff09;&#xff0c;是互…

Sametime 12.0.1 FP1发布以及Notes中的SwiftFile使用

大家好&#xff0c;才是真的好。 上周&#xff0c;HCL推出了Sametime 12.0.1FP1FP1更新包程序&#xff0c;包含不少新功能以及很多修复程序。虽然Sametime组件现在不需要运行在Domino服务器上&#xff0c;但毕竟Sametime通常会使用Domino目录或Domino中的LDAP目录服务&#xf…

陆奇最新演讲高清PPT下载;AI 绘画20+工具体验汇总;我愿称MOSS为全球开源界最强;思否AIGC黑客马拉松北京站 | ShowMeAI日报

&#x1f440;日报&周刊合集 | &#x1f3a1;生产力工具与行业应用大全 | &#x1f9e1; 点赞关注评论拜托啦&#xff01; &#x1f916; 『陆奇罕见公开演讲「新范式 新时代 新机会」』高清PPT和视频可直接下载 ShowMeAI知识星球资料编号&#xff1a;R054 奇绩创坛创始人兼…