Open main menu
首页
专栏
课程
分类
归档
Chat
Sci-Hub
谷歌学术
Libgen
GitHub镜像
登录/注册
搜索
关闭
Previous
Previous
Next
Next
OpenAI最新官方ChatGPT聊天插件接口《插件部署上生产》全网最详细中英文实用指南和教程,助你零基础快速轻松掌握全新技术(五)(附源码)
sockstack
/
249
/
2023-11-06 23:54:24
<p><span style="color: red; font-size: 18px">ChatGPT 可用网址,仅供交流学习使用,如对您有所帮助,请收藏并推荐给需要的朋友。</span><br><a href="https://ckai.xyz/?sockstack§ion=detail" target="__blank">https://ckai.xyz</a><br><br></p> <article class="baidu_pl"><div id="article_content" class="article_content clearfix"> <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css"> <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-25cebea3f9.css"> <div id="content_views" class="markdown_views prism-atom-one-dark"> <svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path></svg><p></p> <div class="toc"> <h3>Plugins in production 插件部署上生产</h3> <ul> <li>前言</li> <li>Rate limits 速率限制</li> <li>Updating your plugin 更新您的插件</li> <li>Plugin terms</li> <li>Domain verification and security 域验证和安全性</li> <li> <ul> <li>Defining the plugin's root domain 定义插件的根域</li> <li>Manifest validation 清单验证</li> <li>Resolving the API spec 解析API规范</li> <li>Use TLS and HTTPS 使用TLS和HTTPS</li> <li>IP egress ranges IP出口范围</li> </ul> </li> <li>FAQ 问答</li> <li> <ul> <li>How is plugin data used? 如何使用插件数据?</li> <li>What happens if a request to my API fails? 如果对我的API的请求失败,会发生什么?</li> <li>Can I invite people to try my plugin? 我可以邀请别人试用我的插件吗?</li> <li>Can I charge people money for my plugin? 我可以为我的插件向人们收取费用吗?</li> </ul> </li> <li>其它资料下载</li> </ul> </div> <p></p> <p><img referrerpolicy="no-referrer" src="https://img-blog.csdnimg.cn/1784ec75edd04979aec060f06520b9d8.jpeg#pic_center" alt="在这里插入图片描述"></p> <h1> <a id="_5"></a>前言</h1> <p>插件可以让 ChatGPT 具有更强大的功能和更灵活的扩展性,使得我们的系统更加适应不同领域的需求。</p> <p>在生产环境使用插件时,我们一定要保证插件的质量和可靠性。一个不稳定的插件可能会严重影响 ChatGPT 的性能,甚至导致系统崩溃。因此,在引入插件之前,我们需要经过充分的测试和验证,并仔细考虑其是否真正符合我们的需求和标准。</p> <p>同时,在生产环境中使用插件还需要注意安全问题。恶意插件可能会造成信息泄漏、攻击等安全问题,对用户造成极大的危害。因此,在使用插件时,我们需要仔细审查其源代码,防范潜在的风险。</p> <h1> <a id="Rate_limits__12"></a>Rate limits 速率限制</h1> <p>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.<br> 考虑在您公开的API端点上实施速率限制。虽然目前的规模有限,但ChatGPT被广泛使用,您应该期待大量的请求。您可以监视请求的数量并相应地设置限制。</p> <h1> <a id="Updating_your_plugin__16"></a>Updating your plugin 更新您的插件</h1> <p>After deploying your plugin to production, you might want to make changes to the <code>ai-plugin.json</code> 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.<br> 在将插件部署到生产环境后,您可能希望对 <code>ai-plugin.json</code> 清单文件进行更改。目前,清单文件必须在每次更改文件时通过插件商店中的“Develop your own plugin”流程手动更新。</p> <p>ChatGPT will automatically fetch the latest OpenAPI spec each time a request is made.<br> ChatGPT将在每次请求时自动获取最新的OpenAPI规范。</p> <h1> <a id="Plugin_terms_23"></a>Plugin terms</h1> <p>In order to register a plugin, you must agree to the Plugin Terms.<br> 为了注册插件,您必须同意插件条款。</p> <h1> <a id="Domain_verification_and_security__27"></a>Domain verification and security 域验证和安全性</h1> <p>To ensure that plugins can only perform actions on resources that they control, OpenAI enforces requirements on the plugin’s manifest and API specifications.<br> 为了确保插件只能在它们控制的资源上执行操作,OpenAI对插件的清单和API规范强制执行要求。</p> <h2> <a id="Defining_the_plugins_root_domain__31"></a>Defining the plugin’s root domain 定义插件的根域</h2> <p>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:<br> 清单文件定义了显示给用户的信息(如徽标和联系信息)以及托管插件的OpenAPI规范的URL。当获取清单时,插件的根域将按照以下规则建立:</p> <ul> <li>If the domain has <code>www.</code> as a subdomain, then the root domain will strip out <code>www.</code> from the domain that hosts the manifest.<br> 如果域具有 <code>www.</code> 作为子域,则根域将从托管清单的域中去除 <code>www.</code> 。</li> <li>Otherwise, the root domain is the same as the domain that hosts the manifest.<br> 否则,根域与承载清单的域相同。</li> </ul> <p>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.<br> 重定向注意事项:如果在解析清单时有任何重定向,则只允许子子域重定向。唯一的例外是从www子域重定向到没有www的子域。</p> <ul> <li>✅ https://example.com/.well-known/ai-plugin.json<br> Root domain: example.com</li> <li>✅ https://www.example.com/.well-known/ai-plugin.json<br> Root domain: example.com</li> <li>✅ https://www.example.com/.well-known/ai-plugin.json → redirects to https://example.com/.well-known/ai-plugin.json<br> Root domain: example.com</li> <li>✅ https://foo.example.com/.well-known/ai-plugin.json → redirects to https://bar.foo.example.com/.well-known/ai-plugin.json<br> Root domain: bar.foo.example.com</li> <li>✅ https://foo.example.com/.well-known/ai-plugin.json → redirects to https://bar.foo.example.com/baz/ai-plugin.json<br> Root domain: bar.foo.example.com</li> <li>❌ https://foo.example.com/.well-known/ai-plugin.json → redirects to https://example.com/.well-known/ai-plugin.json<br> Redirect to parent level domain is disallowed 不允许重定向到父级域</li> <li>❌ https://foo.example.com/.well-known/ai-plugin.json → redirects to https://bar.example.com/.well-known/ai-plugin.json<br> Redirect to same level subdomain is disallowed 不允许重定向到同一级别子域</li> <li>❌ https://example.com/.well-known/ai-plugin.json -> redirects to https://example2.com/.well-known/ai-plugin.json<br> Redirect to another domain is disallowed 不允许重定向到另一个域</li> </ul> <h2> <a id="Manifest_validation__60"></a>Manifest validation 清单验证</h2> <p>Specific fields in the manifest itself must satisfy the following requirements:<br> 清单本身中的特定字段必须满足以下要求:</p> <ul> <li> <code>api.url</code> - the URL provided to the OpenAPI spec must be hosted at the same level or a subdomain of the root domain.<br> <code>api.url</code> -提供给OpenAPI规范的URL必须托管在根域的同一级别或子域。</li> <li>legal_info - The second-level domain of the URL provided must be the same as the second-level domain of the root domain.<br> legal_info -提供的URL的二级域名必须与根域名的二级域名相同。</li> <li>contact_info - The second-level domain of the email address should be the same as the second-level domain of the root domain.<br> contact_info -电子邮件地址的二级域应与根域的二级域相同。</li> </ul> <h2> <a id="Resolving_the_API_spec_API_71"></a>Resolving the API spec 解析API规范</h2> <p>The <code>api.url</code> 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:<br> 清单中的 <code>api.url</code> 字段提供了一个指向OpenAPI规范的链接,该规范定义了插件可以调用的API。OpenAPI允许指定多个服务器基础URL。以下逻辑用于选择服务器URL:</p> <ul> <li>Iterate through the list of server URLs<br> 遍历服务器URL列表</li> <li>Use the first server URL that is either an exact match of the root domain or a subdomain of the root domain<br> 使用与根域或根域的子域完全匹配的第一个服务器URL</li> <li>If neither cases above apply, then default to the domain where the API spec is hosted. For example, if the spec is hosted on <code>api.example.com</code>, then <code>api.example.com</code> will be used as the base URL for the routes in the OpenAPI spec.<br> 如果以上两种情况都不适用,则默认为API规范所在的域。例如,如果规范托管在 <code>api.example.com</code> 上,那么 <code>api.example.com</code> 将用作OpenAPI规范中路由的基本URL。</li> </ul> <p>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.<br> 注意:请避免使用重定向来托管API规范和任何API端点,因为不能保证重定向总是被遵循。</p> <h2> <a id="Use_TLS_and_HTTPS_TLSHTTPS_85"></a>Use TLS and HTTPS 使用TLS和HTTPS</h2> <p>All traffic with the plugin (e.g., fetching the <code>ai-plugin.json</code> file, the OpenAPI spec, API calls) must use TLS 1.2 or later on port 443 with a valid public certificate.<br> 与插件的所有流量(例如,获取 <code>ai-plugin.json</code> 文件、OpenAPI规范、API调用)必须在端口443上使用TLS 1.2或更高版本,并具有有效的公共证书。</p> <h2> <a id="IP_egress_ranges_IP_89"></a>IP egress ranges IP出口范围</h2> <p>ChatGPT will call your plugin from an IP address in the CIDR block <code>23.102.140.112/28</code>. You may wish to explicitly allowlist these IP addresses.<br> ChatGPT将从CIDR块中的IP地址调用插件 <code>23.102.140.112/28</code> 。您可能希望明确允许列出这些IP地址。</p> <p>Separately, OpenAI’s web browsing plugin accesses websites from a different IP address block: <code>23.98.142.176/28</code>.<br> 另外,OpenAI的网页浏览插件从不同的IP地址块访问网站: <code>23.98.142.176/28</code>。</p> <h1> <a id="FAQ__96"></a>FAQ 问答</h1> <h2> <a id="How_is_plugin_data_used__97"></a>How is plugin data used? 如何使用插件数据?</h2> <p>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.<br> 插件将ChatGPT连接到外部应用程序。如果用户启用了插件,ChatGPT可能会将他们的部分对话以及他们的国家或州发送到您的插件。</p> <h2> <a id="What_happens_if_a_request_to_my_API_fails_API_101"></a>What happens if a request to my API fails? 如果对我的API的请求失败,会发生什么?</h2> <p>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.<br> 如果API请求失败,模型可能会重试请求多达10次,然后才能让用户知道它无法从该插件获得响应。</p> <h2> <a id="Can_I_invite_people_to_try_my_plugin__105"></a>Can I invite people to try my plugin? 我可以邀请别人试用我的插件吗?</h2> <p>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.<br> 是的,所有未经验证的插件最多可以由15个用户安装。在启动时,只有其他具有访问权限的开发人员才能安装该插件。我们计划随着时间的推移扩大访问范围,并最终推出一个流程,在向所有用户提供之前提交您的插件进行审查。</p> <h2> <a id="Can_I_charge_people_money_for_my_plugin__109"></a>Can I charge people money for my plugin? 我可以为我的插件向人们收取费用吗?</h2> <p>Yes, we encourage you to consider a limited number of free API calls but understand that it requires resources to run your plugin.<br> 是的,我们鼓励您考虑有限数量的免费API调用,但要理解它需要资源来运行您的插件。</p> <h1> <a id="_114"></a>其它资料下载</h1> <p>如果大家想继续了解人工智能相关学习路线和知识体系,欢迎大家翻阅我的另外一篇博客《重磅 | 完备的人工智能AI 学习——基础知识学习路线,所有资料免关注免套路直接网盘下载》<br> 这篇博客参考了Github知名开源平台,AI技术平台以及相关领域专家:Datawhale,ApacheCN,AI有道和黄海广博士等约有近100G相关资料,希望能帮助到所有小伙伴们。</p> </div> <link href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/markdown_views-98b95bb57c.css" rel="stylesheet"> <link href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/style-c216769e99.css" rel="stylesheet"> </div> <div id="treeSkill"></div> </article>
OpenAI最新官方ChatGPT聊天插件接口《插件部署上生产》全网最详细中英文实用指南和教程,助你零基础快速轻松掌握全新技术(五)(附源码)
作者
sockstack
许可协议
CC BY 4.0
发布于
2023-11-06
修改于
2024-12-20
上一篇:软件:常用 Linux 软件汇总,值得收藏
下一篇:chatgpt赋能python:Python中的构造方法是什么?
尚未登录
登录 / 注册
文章分类
博客重构之路
5
Spring Boot简单入门
4
k8s 入门教程
0
MySQL 知识
1
NSQ 消息队列
0
ThinkPHP5 源码分析
5
使用 Docker 从零开始搭建私人代码仓库
3
日常开发汇总
4
标签列表
springboot
hyperf
swoole
webman
php
多线程
数据结构
docker
k8s
thinkphp
mysql
tailwindcss
flowbite
css
前端