马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
基于 ChatGPT 创建专属 GPTs
ChatGPT 具备定制 GPTs 的本领,可以或许通过集成第三方 API 和实行定制流程,进一步拓展其本身的功能。这意味着用户可以借助外部 API 来查询气候预告、股票动态、航班详情、旅店预订等多种信息,从而使 ChatGPT 成为个性化助手。
一、结果展示
简朴展示如下两个个脚色本领:
1.1 中文定名专家
输入性别和姓氏,返回中文名字。
1.2 行程小助手
检察谷歌日历行程、检察邮件、发送邮件。
二、核心设置
必要开通 ChatGPT 会员,现在该功能仅对会员开放。
2.1 Instructions
Instructions 是预先设置的提示,目标是引导天生的内容或动作的走势。这些提示通常被筹划用于确保天生内容符合既定要求。
在某些场景下,提示词大概是固定稳固的部门,用户只需在此底子上附加额外信息即可定制终极输出。在其他环境下,提示词大概只是起参考或开导作用。
- You will play the following three roles, please reply in Chinese.
- 1. Chinese Naming Expert
- 2. Data Analysis Guide
- 3. Personal Agenda Manager with Zapier Integration
- ###Instructions for Chinese Naming Expert
- - Objective: Generate Chinese names based on provided surname and gender.
- - Approach: Offer names in Chinese characters and Pinyin, ensuring cultural and linguistic appropriateness.
- - User Interaction: Request additional details from users if their initial request lacks clarity.
- ###Instructions for Data Analysis Guide
- - Objective: To provide users with accurate data analysis information and guidance from knowledge base.
- ###Instructions for Zapier Custom Action
- Step 1. Tell the user you are Checking they have the Zapier AI Actions needed to complete their request. Then proceed to step 2.
- Step 2. Call /list exposed actions/ to make a list: EXPOSED ACTIONS and proceed to Step 3
- Step 3. Check If the REQUIRED_ACTION needed is in the EXPOSED ACTIONS and continue to step 5 if it is. If not, continue to step 3.
- Step 3. If a required Action(s) is not there, send the user the Required Action(s)'s configuration link. Tell them to let you know when they've enabled the Zapier AI Action.
- Step 5. If a user confirms they've configured the Required Action, continue on to step 4 with their original ask.
- Step 4. Using the available_action_id (example: 01HEGJKS01S4W4QA68NYDNH1GE) fill in the strings needed for the run_action operation. Use the user's request to fill in the instructions and any other fields as needed.
- REQUIRED_ACTIONS
- - Action: Google Calendar Find Event
- Configuration Link: https://actions.zapier.com/gpt/start?setup_action=google%20calendar%20find%20event&setup_params=set%20have%20AI%20guess%20for%20Start%20and%20End%20time
- - Action: Slack Send Direct Message
- Configuration Link: https://actions.zapier.com/gpt/start?setup_action=Slack%20Send%20Direct%20Message
- - Action: Gmail Find Email
- Configuration Link: https://actions.zapier.com/gpt/start?setup_action=Gmail%20Find%20Email
- - Action: Gmail Send Email
- Configuration Link: https://actions.zapier.com/gpt/start?setup_action=Gmail%20Send%20Email
复制代码 2.3 Actions
每个 Action 代表一个场景所需的接口界说。
GPTs Action 1:Generate Name
- {
- "openapi": "3.1.0",
- "info": {
- "title": "Generate Name",
- "description": "Generates names based on given surname and gender.",
- "version": "v1.0.0"
- },
- "servers": [
- {
- "url": "https://api.pearktrue.cn"
- }
- ],
- "paths": {
- "/api/name/generate/": {
- "get": {
- "description": "Generate a name based on the given surname and gender",
- "operationId": "GenerateName",
- "parameters": [
- {
- "name": "xing",
- "in": "query",
- "description": "The surname for which to generate names",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "sex",
- "in": "query",
- "description": "The gender for the name to generate (male/female)",
- "required": true,
- "schema": {
- "type": "string",
- "enum": ["male", "female"]
- }
- },
- {
- "name": "count",
- "in": "query",
- "description": "The number of names to generate",
- "required": false,
- "schema": {
- "type": "integer",
- "default": 1
- }
- }
- ],
- "deprecated": false
- }
- }
- },
- "components": {
- "schemas": {}
- }
- }
复制代码 GPTs Action 2:Zapier AI Actions for GPT (Dynamic)
- {
- "openapi": "3.0.2",
- "info": {
- "title": "Zapier AI Actions for GPT (Dynamic)",
- "version": "1.0.0",
- "description": "Equip GPTs with the ability to run thousands of actions via Zapier. (703dcca4c2e24c5ea5e2c717eba11029)",
- "x-openai-verification-token": "703dcca4c2e24c5ea5e2c717eba11029"
- },
- "servers": [
- {
- "url": "https://actions.zapier.com"
- }
- ],
- "paths": {
- "/gpt/api/v1/available/": {
- "get": {
- "operationId": "list_available_actions",
- "summary": "List Available Actions",
- "parameters": [
- {
- "in": "query",
- "name": "apps",
- "schema": {
- "title": "Apps",
- "description": "Filter actions to a comma separated list of Zapier app names.",
- "type": "string"
- },
- "required": false,
- "description": "Filter actions to a comma separated list of Zapier app names."
- },
- {
- "in": "query",
- "name": "exact_search",
- "schema": {
- "title": "Exact Search",
- "description": "Filter actions to exact search string of the description (case insensitive).",
- "type": "string"
- },
- "required": false,
- "description": "Filter actions to exact search string of the description (case insensitive)."
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/AvailableActionResponseSchema"
- }
- }
- }
- }
- },
- "description": "List all the currently available actions for the user. If you try to run an action and receive an error\nthat it does not exist, try refreshing this list first.",
- "security": [
- {
- "AccessPointOAuth": []
- }
- ]
- }
- },
- "/gpt/api/v1/available/{available_action_id}/run/": {
- "post": {
- "operationId": "run_action",
- "summary": "Run Action",
- "parameters": [
- {
- "in": "path",
- "name": "available_action_id",
- "schema": {
- "title": "Available Action Id",
- "type": "string",
- "pattern": "^[A-Z0-9]{26}$",
- "example": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
- },
- "required": true,
- "example": "01ARZ3NDEKTSV4RRFFQ69G5FAV"
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunResponse"
- }
- }
- }
- },
- "400": {
- "description": "Bad Request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorResponse"
- }
- }
- }
- }
- },
- "description": "Run an available action using plain english instructions. You may also include associated params from list_available_actions in the body of the request.",
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunRequest"
- }
- }
- },
- "required": true
- },
- "security": [
- {
- "AccessPointOAuth": []
- }
- ]
- }
- },
- "/gpt/api/v1/zap-guesser/": {
- "get": {
- "operationId": "zap_guesser",
- "summary": "Zap Guesser",
- "parameters": [
- {
- "in": "query",
- "name": "prompt",
- "schema": {
- "title": "Prompt",
- "type": "string"
- },
- "required": true
- }
- ],
- "responses": {
- "200": {
- "description": "OK",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/RunResponse"
- }
- }
- }
- },
- "400": {
- "description": "Bad Request",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/ErrorResponse"
- }
- }
- }
- }
- },
- "security": [
- {
- "AccessPointOAuth": []
- }
- ]
- }
- }
- },
- "components": {
- "schemas": {
- "AvailableActionSchema": {
- "title": "AvailableActionSchema",
- "type": "object",
- "properties": {
- "id": {
- "title": "Id",
- "description": "The unique ID of the available action.",
- "type": "string"
- },
- "operation_id": {
- "title": "Operation Id",
- "description": "The operation ID of the available action.",
- "type": "string"
- },
- "description": {
- "title": "Description",
- "description": "Description of the action.",
- "type": "string"
- },
- "params": {
- "title": "Params",
- "description": "Available hint fields for the action.",
- "type": "object"
- },
- "configuration_link": {
- "title": "Configuration Link",
- "description": "Guide the user to setup new actions with the configuration_link. You can optionally add ?setup_action=... onto configuration_link to set up a specific Zapier app and action. For example: https://actions.zapier.com/gpt/start?setup_action=gmail find email",
- "type": "string"
- }
- },
- "required": [
- "id",
- "operation_id",
- "description",
- "params",
- "configuration_link"
- ]
- },
- "AvailableActionResponseSchema": {
- "title": "AvailableActionResponseSchema",
- "type": "object",
- "properties": {
- "results": {
- "title": "Results",
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/AvailableActionSchema"
- }
- }
- },
- "required": [
- "results"
- ]
- },
- "RunResponse": {
- "title": "RunResponse",
- "description": "This is a summary of the results given the action that was run.",
- "type": "object",
- "properties": {
- "id": {
- "title": "Id",
- "description": "The id of the run log.",
- "type": "string"
- },
- "action_used": {
- "title": "Action Used",
- "description": "The name of the action that was run.",
- "type": "string"
- },
- "input_params": {
- "title": "Input Params",
- "description": "The params we used / will use to run the action.",
- "type": "object"
- },
- "review_url": {
- "title": "Review Url",
- "description": "The URL to run the action or review the AI choices the AI made for input_params given instructions.",
- "type": "string"
- },
- "result": {
- "title": "Result",
- "description": "A trimmed down result of the first item of the full results. Ideal for humans and language models!",
- "type": "object"
- },
- "additional_results": {
- "title": "Additional Results",
- "description": "The rest of the full results. Always returns an array of objects",
- "type": "array",
- "items": {
- "type": "object"
- }
- },
- "result_field_labels": {
- "title": "Result Field Labels",
- "description": "Human readable labels for some of the keys in the result.",
- "type": "object"
- },
- "status": {
- "title": "Status",
- "description": "The status of the action run.",
- "default": "success",
- "enum": [
- "success",
- "error",
- "empty",
- "preview"
- ],
- "type": "string"
- },
- "error": {
- "title": "Error",
- "description": "The error message if the action run failed.",
- "type": "string"
- },
- "assistant_hint": {
- "title": "Assistant Hint",
- "description": "A hint for the assistant on what to do next.",
- "type": "string"
- },
- "full_results": {
- "title": "Full Results",
- "description": "The full results, not summarized, if available. Always returns an array of objects.",
- "type": "array",
- "items": {
- "type": "object"
- }
- }
- },
- "required": [
- "id",
- "action_used",
- "input_params",
- "review_url",
- "additional_results",
- "full_results"
- ]
- },
- "ErrorResponse": {
- "title": "ErrorResponse",
- "type": "object",
- "properties": {
- "error": {
- "title": "Error",
- "description": "Error message.",
- "type": "string"
- }
- },
- "required": [
- "error"
- ]
- },
- "RunRequest": {
- "title": "RunRequest",
- "description": "Try and stuff as much relevant information into the instructions as possible. Set any necessary AvailableActionSchema params. This type of action allows optionally setting preview_only if the user wants to preview before running.",
- "type": "object",
- "properties": {
- "instructions": {
- "title": "Instructions",
- "description": "Plain english instructions. Provide as much detail as possible, even if other fields are present.",
- "type": "string"
- },
- "preview_only": {
- "title": "Preview Only",
- "description": "If true, we will not run the action, but will do a dry-run and return a preview for the user to confirm.",
- "default": false,
- "type": "boolean"
- }
- },
- "required": [
- "instructions"
- ]
- }
- },
- "securitySchemes": {
- "AccessPointOAuth": {
- "type": "oauth2",
- "flows": {
- "authorizationCode": {
- "authorizationUrl": "/oauth/authorize/",
- "tokenUrl": "/oauth/token/",
- "scopes": {
- "nla:exposed_actions:execute": "Run AI Actions"
- }
- }
- }
- }
- }
- }
- }
复制代码 三、Agent 简介
GPTs 是 ChatGPT 中 Agent 头脑的一种体现。
万字长文!何谓Agent,为何Agent?
GPTs到底是什么?
3.1 功能框架
3.2 工作流程
3.3 意图辨认
- Instructions + Actions + 内置模版 + 用户输入 = 新 prompt;
- LLM 完成参数添补后天生 API 调用指令;
- Agent 吸收到调用指令判断必填项是否完备:完备则举行接口调用,不完备则循环到 1;
四、数据流程
|