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

Example plugins 插件示例demo

  • 前言
  • Introduction 导言
  • Learn how to build a simple todo list plugin with no auth 了解如何构建一个简单的待办事项列表插件,无需授权
  • Learn how to build a simple todo list plugin with service level auth 了解如何构建一个简单的待办事项列表插件与服务级别身份验证
  • Learn how to build a simple sports stats plugin 了解如何构建一个简单的体育统计插件
  • Learn how to build a semantic search and retrieval plugin 了解如何构建语义搜索和检索插件
  • 其它资料下载

在这里插入图片描述

前言

在ChatGPT中学习构建插件是一个有趣和富有挑战性的过程。通过使用官方提供的四个例子,我们可以逐步了解如何构建ChatGPT插件,从而更好地理解插件的规范使用。也希望能帮助到大家快速掌握构建插件的各种技能和工具。

Introduction 导言

To get started building, we are making available a set of simple plugins that cover different authentication schemas and use cases. From our simple no authentication todo list plugin to the more powerful retrieval plugin, these examples provide a glimpse into what we hope to make possible with plugins.
为了开始构建,我们提供了一组简单的插件,涵盖了不同的身份验证模式和用例。从我们简单的无身份验证的todo列表插件到更强大的检索插件,这些示例提供了我们希望通过插件实现的东西的一瞥。

During development, you can run the plugin locally on your computer or through a cloud development environment like GitHub Codespaces, Replit, or CodeSandbox.
在开发过程中,您可以在计算机上本地运行插件,也可以通过GitHub Codespaces,Replit或CodeSandbox等云开发环境运行插件。

Learn how to build a simple todo list plugin with no auth 了解如何构建一个简单的待办事项列表插件,无需授权

To start, define an ai-plugin.json file with the following fields:
首先,使用以下字段定义一个 ai-plugin.json 文件:

{"schema_version": "v1","name_for_human": "TODO Plugin (no auth)","name_for_model": "todo","description_for_human": "Plugin for managing a TODO list, you can add, remove and view your TODOs.","description_for_model": "Plugin for managing a TODO list, you can add, remove and view your TODOs.","auth": {"type": "none"},"api": {"type": "openapi","url": "PLUGIN_HOSTNAME/openapi.yaml","is_user_authenticated": false},"logo_url": "PLUGIN_HOSTNAME/logo.png","contact_email": "support@example.com","legal_info_url": "https://example.com/legal"
}

Note the PLUGIN_HOSTNAME should be the actual hostname of your plugin server.
注意 PLUGIN_HOSTNAME 应该是插件服务器的实际主机名。

Next, we can define the API endpoints to create, delete, and fetch todo list items for a specific user.
接下来,我们可以定义API端点来为特定用户创建、删除和获取待办事项列表项。

import jsonimport quart
import quart_cors
from quart import request# Note: Setting CORS to allow chat.openapi.com is only required when running a localhost plugin 注意:只有在运行localhost插件时才需要设置CORS以允许chat.openapi.com
app = quart_cors.cors(quart.Quart(__name__), allow_origin="https://chat.openai.com")_TODOS = {}@app.post("/todos/<string:username>")
async def add_todo(username):request = await quart.request.get_json(force=True)if username not in _TODOS:_TODOS[username] = []_TODOS[username].append(request["todo"])return quart.Response(response='OK', status=200)@app.get("/todos/<string:username>")
async def get_todos(username):return quart.Response(response=json.dumps(_TODOS.get(username, [])), status=200)@app.delete("/todos/<string:username>")
async def delete_todo(username):request = await quart.request.get_json(force=True)todo_idx = request["todo_idx"]if 0 <= todo_idx < len(_TODOS[username]):_TODOS[username].pop(todo_idx)return quart.Response(response='OK', status=200)@app.get("/logo.png")
async def plugin_logo():filename = 'logo.png'return await quart.send_file(filename, mimetype='image/png')@app.get("/.well-known/ai-plugin.json")
async def plugin_manifest():host = request.headers['Host']with open("ai-plugin.json") as f:text = f.read()# This is a trick we do to populate the PLUGIN_HOSTNAME constant in the manifesttext = text.replace("PLUGIN_HOSTNAME", f"https://{host}")return quart.Response(text, mimetype="text/json")@app.get("/openapi.yaml")  # openai规范yaml文件
async def openapi_spec():host = request.headers['Host']with open("openapi.yaml") as f:text = f.read()# This is a trick we do to populate the PLUGIN_HOSTNAME constant in the OpenAPI spec 这是我们在OpenAPI规范中填充PLUGIN_HOSTNAME常量的一个技巧text = text.replace("PLUGIN_HOSTNAME", f"https://{host}")return quart.Response(text, mimetype="text/yaml")def main():app.run(debug=True, host="0.0.0.0", port=5002)if __name__ == "__main__":main()

Last, we need to set up and define a OpenAPI specification to match the endpoints defined on our local or remote server. You do not need to expose the full functionality of your API via the specification and can instead choose to let ChatGPT have access to only certain functionality.
最后,我们需要设置和定义OpenAPI规范,以匹配本地或远程服务器上定义的端点。您不需要通过规范公开API的全部功能,而是可以选择让ChatGPT仅访问某些功能。

There are also many tools that will automatically turn your server definition code into an OpenAPI specification so you don’t need to do it manually. In the case of the Python code above, the OpenAPI specification will look like:
还有许多工具可以自动将服务器定义代码转换为OpenAPI规范,因此您不需要手动执行此操作。在上面的Python代码中,OpenAPI规范看起来像这样:

openapi: 3.0.1
info:title: TODO Plugindescription: A plugin that allows the user to create and manage a TODO list using ChatGPT. If you do not know the user's username, ask them first before making queries to the plugin. Otherwise, use the username "global".version: 'v1'
servers:- url: PLUGIN_HOSTNAME
paths:/todos/{username}:get:operationId: getTodossummary: Get the list of todosparameters:- in: pathname: usernameschema:type: stringrequired: truedescription: The name of the user.responses:"200":description: OKcontent:application/json:schema:$ref: '#/components/schemas/getTodosResponse'post:operationId: addTodosummary: Add a todo to the listparameters:- in: pathname: usernameschema:type: stringrequired: truedescription: The name of the user.requestBody:required: truecontent:application/json:schema:$ref: '#/components/schemas/addTodoRequest'responses:"200":description: OKdelete:operationId: deleteTodosummary: Delete a todo from the listparameters:- in: pathname: usernameschema:type: stringrequired: truedescription: The name of the user.requestBody:required: truecontent:application/json:schema:$ref: '#/components/schemas/deleteTodoRequest'responses:"200":description: OKcomponents:schemas:getTodosResponse:type: objectproperties:todos:type: arrayitems:type: stringdescription: The list of todos.addTodoRequest:type: objectrequired:- todoproperties:todo:type: stringdescription: The todo to add to the list.required: truedeleteTodoRequest:type: objectrequired:- todo_idxproperties:todo_idx:type: integerdescription: The index of the todo to delete.required: true

Learn how to build a simple todo list plugin with service level auth 了解如何构建一个简单的待办事项列表插件与服务级别身份验证

To start, define an ai-plugin.json file with the following fields:
首先,使用以下字段定义一个 ai-plugin.json 文件:

{"schema_version": "v1","name_for_human": "TODO Plugin (service level auth)","name_for_model": "todo","description_for_human": "Plugin for managing a TODO list, you can add, remove and view your TODOs.","description_for_model": "Plugin for managing a TODO list, you can add, remove and view your TODOs.","auth": {"type": "service_http","authorization_type": "bearer","verification_tokens": {"openai": "758e9ef7984b415688972d749f8aa58e"}},"api": {"type": "openapi","url": "https://example.com/openapi.yaml","is_user_authenticated": false},"logo_url": "https://example.com/logo.png","contact_email": "support@example.com","legal_info_url": "https://example.com/legal"
}

Notice that the verification token is required for service level authentication plugins. The token is generated during the plugin installation process in the ChatGPT web UI.
请注意,服务级别身份验证插件需要验证令牌。令牌是在ChatGPT Web UI中的插件安装过程中生成的。

Next, we can define the API endpoints to create, delete, and fetch todo list items for a specific user. The endpoints also check that the user is authenticated.
接下来,我们可以定义API端点来为特定用户创建、删除和获取待办事项列表项。端点还检查用户是否经过身份验证。

import jsonimport quart
import quart_cors
from quart import request# Note: Setting CORS to allow chat.openapi.com is only required when running a localhost plugin 注意:只有在运行localhost插件时才需要设置CORS以允许chat.openapi.com
app = quart_cors.cors(quart.Quart(__name__), allow_origin="https://chat.openai.com")_SERVICE_AUTH_KEY = "REPLACE_ME"
_TODOS = {}def assert_auth_header(req):assert req.headers.get("Authorization", None) == f"Bearer {_SERVICE_AUTH_KEY}"@app.post("/todos/<string:username>")
async def add_todo(username):assert_auth_header(quart.request)request = await quart.request.get_json(force=True)if username not in _TODOS:_TODOS[username] = []_TODOS[username].append(request["todo"])return quart.Response(response='OK', status=200)@app.get("/todos/<string:username>")
async def get_todos(username):assert_auth_header(quart.request)return quart.Response(response=json.dumps(_TODOS.get(username, [])), status=200)@app.delete("/todos/<string:username>")
async def delete_todo(username):assert_auth_header(quart.request)request = await quart.request.get_json(force=True)todo_idx = request["todo_idx"]if 0 <= todo_idx < len(_TODOS[username]):_TODOS[username].pop(todo_idx)return quart.Response(response='OK', status=200)@app.get("/logo.png")
async def plugin_logo():filename = 'logo.png'return await quart.send_file(filename, mimetype='image/png')@app.get("/.well-known/ai-plugin.json")
async def plugin_manifest():host = request.headers['Host']with open("ai-plugin.json") as f:text = f.read()return quart.Response(text, mimetype="text/json")@app.get("/openapi.yaml")
async def openapi_spec():host = request.headers['Host']with open("openapi.yaml") as f:text = f.read()return quart.Response(text, mimetype="text/yaml")def main():app.run(debug=True, host="0.0.0.0", port=5002)if __name__ == "__main__":main()

Last, we need to set up and define a OpenAPI specification to match the endpoints defined on our local or remote server. In general, the OpenAPI specification would look the same regardless of the authentication method. Using an automatic OpenAPI generator will reduce the chance of errors when creating your OpenAPI specification so it is worth exploring the options.
最后,我们需要设置和定义OpenAPI规范,以匹配本地或远程服务器上定义的端点。一般来说,OpenAPI规范看起来都是一样的,与身份验证方法无关。使用自动OpenAPI生成器将减少创建OpenAPI规范时出错的可能性,因此值得探索这些选项。

openapi: 3.0.1
info:title: TODO Plugindescription: A plugin that allows the user to create and manage a TODO list using ChatGPT. If you do not know the user's username, ask them first before making queries to the plugin. Otherwise, use the username "global".version: 'v1'
servers:- url: https://example.com
paths:/todos/{username}:get:operationId: getTodossummary: Get the list of todosparameters:- in: pathname: usernameschema:type: stringrequired: truedescription: The name of the user.responses:"200":description: OKcontent:application/json:schema:$ref: '#/components/schemas/getTodosResponse'post:operationId: addTodosummary: Add a todo to the listparameters:- in: pathname: usernameschema:type: stringrequired: truedescription: The name of the user.requestBody:required: truecontent:application/json:schema:$ref: '#/components/schemas/addTodoRequest'responses:"200":description: OKdelete:operationId: deleteTodosummary: Delete a todo from the listparameters:- in: pathname: usernameschema:type: stringrequired: truedescription: The name of the user.requestBody:required: truecontent:application/json:schema:$ref: '#/components/schemas/deleteTodoRequest'responses:"200":description: OKcomponents:schemas:getTodosResponse:type: objectproperties:todos:type: arrayitems:type: stringdescription: The list of todos.addTodoRequest:type: objectrequired:- todoproperties:todo:type: stringdescription: The todo to add to the list.required: truedeleteTodoRequest:type: objectrequired:- todo_idxproperties:todo_idx:type: integerdescription: The index of the todo to delete.required: true

Learn how to build a simple sports stats plugin 了解如何构建一个简单的体育统计插件

This plugin is an example of a simple sports stats API. Please keep in mind our domain policy and usage policies when considering what to build.
这个插件是一个简单的体育统计API的例子。在考虑构建什么时,请记住我们的域策略和使用策略。

To start, define an ai-plugin.json file with the following fields:
首先,使用以下字段定义一个 ai-plugin.json 文件:

{"schema_version": "v1","name_for_human": "Sport Stats","name_for_model": "sportStats","description_for_human": "Get current and historical stats for sport players and games.","description_for_model": "Get current and historical stats for sport players and games. Always display results using markdown tables.","auth": {"type": "none"},"api": {"type": "openapi","url": "PLUGIN_HOSTNAME/openapi.yaml","is_user_authenticated": false},"logo_url": "PLUGIN_HOSTNAME/logo.png","contact_email": "support@example.com","legal_info_url": "https://example.com/legal"
}

Note the PLUGIN_HOSTNAME should be the actual hostname of your plugin server.
注意 PLUGIN_HOSTNAME 应该是插件服务器的实际主机名。

Next, we define a mock API for a simple sports service plugin.
接下来,我们为一个简单的体育服务插件定义一个模拟API。

import json
import requests
import urllib.parseimport quart
import quart_cors
from quart import request# Note: Setting CORS to allow chat.openapi.com is only required when running a localhost plugin 注意:只有在运行localhost插件时才需要设置CORS以允许chat.openapi.com
app = quart_cors.cors(quart.Quart(__name__), allow_origin="https://chat.openai.com")
HOST_URL = "https://example.com"@app.get("/players")
async def get_players():query = request.args.get("query")res = requests.get(f"{HOST_URL}/api/v1/players?search={query}&page=0&per_page=100")body = res.json()return quart.Response(response=json.dumps(body), status=200)@app.get("/teams")
async def get_teams():res = requests.get("{HOST_URL}/api/v1/teams?page=0&per_page=100")body = res.json()return quart.Response(response=json.dumps(body), status=200)@app.get("/games")
async def get_games():query_params = [("page", "0")]limit = request.args.get("limit")query_params.append(("per_page", limit or "100"))start_date = request.args.get("start_date")if start_date:query_params.append(("start_date", start_date))end_date = request.args.get("end_date")if end_date:query_params.append(("end_date", end_date))seasons = request.args.getlist("seasons")for season in seasons:query_params.append(("seasons[]", str(season)))team_ids = request.args.getlist("team_ids")for team_id in team_ids:query_params.append(("team_ids[]", str(team_id)))res = requests.get(f"{HOST_URL}/api/v1/games?{urllib.parse.urlencode(query_params)}")body = res.json()return quart.Response(response=json.dumps(body), status=200)@app.get("/stats")
async def get_stats():query_params = [("page", "0")]limit = request.args.get("limit")query_params.append(("per_page", limit or "100"))start_date = request.args.get("start_date")if start_date:query_params.append(("start_date", start_date))end_date = request.args.get("end_date")if end_date:query_params.append(("end_date", end_date))player_ids = request.args.getlist("player_ids")for player_id in player_ids:query_params.append(("player_ids[]", str(player_id)))game_ids = request.args.getlist("game_ids")for game_id in game_ids:query_params.append(("game_ids[]", str(game_id)))res = requests.get(f"{HOST_URL}/api/v1/stats?{urllib.parse.urlencode(query_params)}")body = res.json()return quart.Response(response=json.dumps(body), status=200)@app.get("/season_averages")
async def get_season_averages():query_params = []season = request.args.get("season")if season:query_params.append(("season", str(season)))player_ids = request.args.getlist("player_ids")for player_id in player_ids:query_params.append(("player_ids[]", str(player_id)))res = requests.get(f"{HOST_URL}/api/v1/season_averages?{urllib.parse.urlencode(query_params)}")body = res.json()return quart.Response(response=json.dumps(body), status=200)@app.get("/logo.png")
async def plugin_logo():filename = 'logo.png'return await quart.send_file(filename, mimetype='image/png')@app.get("/.well-known/ai-plugin.json")
async def plugin_manifest():host = request.headers['Host']with open("ai-plugin.json") as f:text = f.read()# This is a trick we do to populate the PLUGIN_HOSTNAME constant in the manifesttext = text.replace("PLUGIN_HOSTNAME", f"https://{host}")return quart.Response(text, mimetype="text/json")@app.get("/openapi.yaml")
async def openapi_spec():host = request.headers['Host']with open("openapi.yaml") as f:text = f.read()# This is a trick we do to populate the PLUGIN_HOSTNAME constant in the OpenAPI spectext = text.replace("PLUGIN_HOSTNAME", f"https://{host}")return quart.Response(text, mimetype="text/yaml")def main():app.run(debug=True, host="0.0.0.0", port=5001)if __name__ == "__main__":main()

Last, we define our OpenAPI specification:
最后,我们定义OpenAPI规范:

openapi: 3.0.1
info:title: Sport Statsdescription: Get current and historical stats for sport players and games.version: 'v1'
servers:- url: PLUGIN_HOSTNAME
paths:/players:get:operationId: getPlayerssummary: Retrieves all players from all seasons whose names match the query string.parameters:- in: queryname: queryschema:type: stringdescription: Used to filter players based on their name. For example, ?query=davis will return players that have 'davis' in their first or last name.responses:"200":description: OK/teams:get:operationId: getTeamssummary: Retrieves all teams for the current season.responses:"200":description: OK/games:get:operationId: getGamessummary: Retrieves all games that match the filters specified by the args. Display results using markdown tables.parameters:- in: queryname: limitschema:type: stringdescription: The max number of results to return.- in: queryname: seasonsschema:type: arrayitems:type: stringdescription: Filter by seasons. Seasons are represented by the year they began. For example, 2018 represents season 2018-2019.- in: queryname: team_idsschema:type: arrayitems:type: stringdescription: Filter by team ids. Team ids can be determined using the getTeams function.- in: queryname: start_dateschema:type: stringdescription: A single date in 'YYYY-MM-DD' format. This is used to select games that occur on or after this date.- in: queryname: end_dateschema:type: stringdescription: A single date in 'YYYY-MM-DD' format. This is used to select games that occur on or before this date.responses:"200":description: OK/stats:get:operationId: getStatssummary: Retrieves stats that match the filters specified by the args. Display results using markdown tables.parameters:- in: queryname: limitschema:type: stringdescription: The max number of results to return.- in: queryname: player_idsschema:type: arrayitems:type: stringdescription: Filter by player ids. Player ids can be determined using the getPlayers function.- in: queryname: game_idsschema:type: arrayitems:type: stringdescription: Filter by game ids. Game ids can be determined using the getGames function.- in: queryname: start_dateschema:type: stringdescription: A single date in 'YYYY-MM-DD' format. This is used to select games that occur on or after this date.- in: queryname: end_dateschema:type: stringdescription: A single date in 'YYYY-MM-DD' format. This is used to select games that occur on or before this date.responses:"200":description: OK/season_averages:get:operationId: getSeasonAveragessummary: Retrieves regular season averages for the given players. Display results using markdown tables.parameters:- in: queryname: seasonschema:type: stringdescription: Defaults to the current season. A season is represented by the year it began. For example, 2018 represents season 2018-2019.- in: queryname: player_idsschema:type: arrayitems:type: stringdescription: Filter by player ids. Player ids can be determined using the getPlayers function.responses:"200":description: OK

Learn how to build a semantic search and retrieval plugin 了解如何构建语义搜索和检索插件

The ChatGPT retrieval plugin is a more fully featured code example. The scope of the plugin is large, so we encourage you to read through the code to see what a more advanced plugin looks like.
ChatGPT检索插件是一个功能更全的代码示例。这个插件的范围很大,所以我们鼓励你通读代码,看看更高级的插件是什么样子的。

The retrieval plugin includes: 检索插件包括:

  • Support for multiple vector databases providers
    支持多个矢量数据库提供程序
  • All 4 different authentication methods
    所有4种不同的身份验证方法
  • Multiple different API features 多种不同的API功能

其它资料下载

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

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

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

一个简单的星座运势查询APP

先看效果图如下&#xff1a; 这是一个简单的星座运势查看的APP。 先来看欢迎界面&#xff0c;欢迎界面很简单&#xff0c;只要是一个简单的动画播放效果&#xff0c;然后对动画播放设置监听&#xff0c;当动画播放结束后自动跳转到主界面。欢迎界面主要代码如下&#xff1a; p…

运气指数测试软件,测一测最近的运势如何,有什么测试运势的软件

说到测一测最近的运势如何&#xff0c;大家都了解&#xff0c;有人问求测算运程&#xff0c;最近不太顺利&#xff0c;另外&#xff0c;还有人想问最近运势不太好&#xff0c;帮帮测里的大师能化解吗&#xff0c;这是怎么回事&#xff1f;其实有好家伙测试运势的软件吗&#xf…

chatgpt赋能python:Python排队:提高效率、优化流程的神器

Python排队&#xff1a;提高效率、优化流程的神器 随着科技的不断进步&#xff0c;排队已经成为了现代生活中不可避免的一部分。在各个行业中&#xff0c;排队都是必须考虑的问题&#xff0c;包括餐馆、医院、机场和银行等等。针对排队问题&#xff0c;我们可以使用Python编程…

与Bard竞争,OpenAI急了 官宣:ChatGPT用户无需排队,直接可用上联网和插件功能...

OpenAI和谷歌&#xff0c;已经打得急红了眼&#xff0c;ChatGPT Plus用户&#xff0c;下周就可以体验联网和插件功能&#xff0c;无需再排队。鲨疯了&#xff0c;真的鲨疯了&#xff01;来自&#xff1a;新智元排版&#xff1a;深度学习自然语言处理 进NLP群—>加入NLP交流群…

2021ICPC澳门站部分题解

链接 A 构造一个生成函数就完了&#xff0c;正好有一个板子&#xff0c;贴一下完事。社会主义重拳出击&#xff0c;没想到区域赛会出这种题。澳门的前六个题是签到、模拟、最小异或生成树、分治ntt、构造、dag上sg函数。跪了。和大陆的区域赛真不一样&#xff0c;大陆属实小清…

澳门科技大学计算机研究生就业,澳门科技大学硕士申请难度(2021年)

原标题&#xff1a;澳门科技大学硕士申请难度(2021年) 澳门科技大学成立于2000年&#xff0c;隶属于澳门科技大学基金会&#xff0c;是澳门回归中国后成立的第一所私立大学&#xff0c;也是目前澳门特别行政区规模最大的大学。2009年美国《时代周刊》评选大中华区100名校&#…

澳门大学计算机qs排名,澳门大学世界QS排名

澳门大学世界QS排名 发表时间&#xff1a;2019-09-27 作者&#xff1a;211大学网 澳门大学(Universidade de Macau / University of Macau)&#xff0c;简称澳大&#xff0c;是澳门一所现代大学&#xff0c;是澳门一所获AACSB认证的大学。 澳门大学前身为1981年3月28日成立的东…

大模型开发(四):OpenAI API调用方法

全文共8500余字&#xff0c;预计阅读时间约17~30分钟 | 满满干货(附代码示例)&#xff0c;建议收藏&#xff01; 代码下载点这里 一、获取OpenAI的API keys 前提&#xff1a;拥有OpenAI账户&#xff0c;并可以魔法上网 如果涉及账户或魔法上网问题&#xff0c;请看本文末尾的…

ChatGPT技术将给智能硬件带来更多新机会

近期&#xff0c;由人工智能实验室OpenAI发布的对话式大型语言模型ChatGPT在各大中外媒体平台掀起了一阵狂热之风。短短2个月时间&#xff0c;其用户量就达到一亿用户&#xff0c;注册用户之多导致服务器一度瘫痪。 ChatGPT到底是什么呢&#xff1f;ChatGPT是一种基于GPT-3&…

使用ChatGPT完成程序开发——目标:不写一行代码完成图像识别并点击

本文作为一个使用AI开发的思路&#xff0c;让更多的人可以利用AI完成一些简单的程序&#xff0c;文中使用的是国内镜像GTP3.5 源码: GitHub - kasimshi/testCV: AI编写的OpenCV图像识别例子 GTP镜像: 知汇 对AI描述我们要做的功能&#xff0c;让它给给初步的思路和方向 作为新…

如何在WhatsApp中更改聊天背景

By default, WhatsApp has a pretty weird and childish background for your chat messages. The good news is that you can change it. Here’s how. 默认情况下&#xff0c;WhatsApp的聊天消息背景非常古怪而幼稚。 好消息是您可以更改它。 这是如何做。 We’re using an …

如何抠图换背景?介绍两个抠图换背景的方法

如何抠图换背景&#xff1f;在我们的日常生活中&#xff0c;总是会需要使用到抠图技巧&#xff0c;现在已经进入冬天&#xff0c;有一些特殊情况以及天气寒冷&#xff0c;我们可能很少出门拍照。这个时候如果我们想要在朋友圈发一些新图的话&#xff0c;其实完全可以借助于抠图…

怎样改证件照的背景颜色?两种方法教你换背景色

怎么改证件照的背景色呢&#xff1f;证件照大家在日常中经常会使用到&#xff0c;这也是我们每个人必备的一种证件。但是在使用的过程中&#xff0c;相信很多小伙伴遇到过自己的证件照背景色与要求的颜色不符的情况&#xff0c;因为通常情况下不会有这种情况&#xff0c;所以我…

如何抠图换背景?教你几个抠图换背景的方法

如何抠图换背景&#xff1f;金秋十月&#xff0c;天气逐渐转凉&#xff0c;正是外出游玩的好时节。秋天很适合和银杏拍照&#xff0c;但是由于各种各样的因素&#xff0c;我们可能无法亲自去拍摄和银杏的照片&#xff0c;这个时候我们完全可以借助一些技术手段来帮助自己制作这…

怎么给照片换背景颜色?分享几种非常简单的操作方法

照片的背景颜色怎么更换呢&#xff1f;如果我们想要发布一张自拍照并想要突出自己的服装&#xff0c;可以更改背景颜色&#xff0c;使服装更加突出&#xff0c;更受关注。还有很多小伙伴的证件照背景颜色不符合要求&#xff0c;需要更换背景色&#xff0c;但是怎么才能做到呢&a…

照片怎么换背景底色?这几种换背景颜色方法很方便

照片的背景颜色怎么更换呢&#xff1f;更改照片的背景颜色可以制造出很多不同的效果。例如&#xff0c;将照片的背景颜色改为黑色或白色可以带来高度对比的效果&#xff0c;而将背景颜色改为柔和的粉色或淡蓝色则可以制造出柔和、浪漫的感觉。然而很多小伙伴不清楚怎么给照片换…

怎么给图片换背景?点开收货一些新方法

平时我们有些照片拍出来可能任务比较好看而背景拍的不是那么理想&#xff0c;那么对于这种照片如果删除重新拍一张会有些可惜&#xff0c;其实我们可以给照片中的人物抠图出来更换背景就可以解决啦&#xff0c;那么怎么给图片换背景呢&#xff1f;今天来给小伙伴们分享两个好方…

照片怎么换背景?这几个方法或许能帮到你

大学上就业指导课的时候&#xff0c;老师让我们制作一个自己的简历&#xff0c;并要求了头像需要是蓝底的一寸照。课后&#xff0c;在制作简历的过程中&#xff0c;我并没有被简历的内容给难住&#xff0c;而是被如何获得一个蓝底的证件照给拖了后腿。这时候&#xff0c;我的舍…

android应用更换背景图片方法

android应用更换背景图片方法&#xff1a; 这学期刚接触安卓&#xff0c;挺菜的&#xff0c;做一个同事通讯录的时候在换app背景图片的时候不知道咋弄了&#xff0c;到处找怎么换背景图片&#xff0c;后面摸索了一下弄出来了&#xff0c;分享一下步骤。 1、 在项目目录里找到dr…

Centos重置密码

操作系统版本&#xff1a;Centos 7.4 修改普通用户密码 [rootwjy ~]# passwd admin #后输入两次密码即可【此处用得是root用户修改得】修改root密码 [rootwjy ~]# passwd root #后输入两次密码即可 [rootwjy ~]# passwd #修改root密码也可以这样忘记root密码&#xff0c;需…