输入“/”快速插入内容

如何利用 AI 帮助孩子爱上查字典

2024年9月10日修改
嘿,大家好呀,我是景淮,一个在加拿大的朋友,每天陪你一起玩转 AI。
今天终于腾出时间,更新了一下之前的一个 GPTs :儿童汉语词典
具体内容可以参考下下面的文章
GPTs Action 实战:儿童汉语词典
因为今年 3,4 月份的时候 AirCode 的服务器停止运行了,所以这个 GPTs 也就同时停止使用啦~
当时把 API 架在 AirCode 的服务器上了。今天终于抽出空,自己写了 API 接口还有弄了下服务器,把需要使用的 API 放在了对应的我自己的服务器上。
所以也就借着这个机会把,这个部署的过程和代码记录和分享一下。
本文会根据以下内容顺序进行:
ChatGPT GPTs 使用链接和一些问题
扣子搭建逻辑图
使用扣子重新搭建
总结
一、ChatGPT GPTs 使用链接
因为这篇之前写过了,关于 GPTs 的搭建内容我就不再重述了,大家感兴趣的可以直接查看下之前的内容。
我把我重新配置的 Action 和 提示词重新分享一下,大家可以看看参考下。
一)Action
代码块
openapi: 3.1.0
info:
title: Chinese Characters API
description: API for querying Chinese characters, their stroke orders, and generating stroke order images.
version: 1.0.5
servers:
- url: https://jinghuaiapi.fun
description: Main API server
paths:
/characters:
get:
operationId: queryChineseCharacters
summary: Query Chinese characters
description: Retrieve information about Chinese characters based on criteria like pinyin, strokes, radical, or combined radical and strokes.
parameters:
- in: query
name: pinyin
schema:
type: string
description: Pinyin of the character, optionally with tone number.
required: false
- in: query
name: strokes
schema:
type: integer
description: Number of strokes excluding the radical.
required: false
- in: query
name: radical
schema:
type: string
description: The radical of the character.
required: false
- in: query
name: rs
schema:
type: string
description: Combined radical and strokes, formatted as 'radical,strokes'. For example, '60,4' where '60' is the radical and '4' is the stroke count.
required: false
responses:
"200":
description: Successful response with character data
content:
application/json:
schema:
type: array
items:
type: string
description: List of characters or character details
"400":
description: Bad request due to invalid query parameters
"500":
description: Internal server error
/character/{char}:
get:
operationId: getStrokeOrder
summary: Get stroke order of a Chinese character
description: Retrieve the stroke order details for a specific Chinese character.
parameters:
- in: path
name: char
schema:
type: string
required: true
description: The Chinese character for which to retrieve stroke order information.
responses:
"200":
description: Successful response with stroke order data
content:
application/json:
schema:
type: array
items:
type: object
properties:
shape:
type: string
description: The shape of the stroke.
type:
type: string
description: The type of stroke.
foldCount:
type: string
description: The number of folds in the stroke.
name:
type: string
description: The name of the stroke.
letter:
type: string
description: The letter associated with the stroke.
description: List of stroke order details for the character
"500":
description: Internal server error
/generate-png:
post:
operationId: generatePngImages
summary: Generate stroke order PNG images for a Chinese character
description: Generate and return PNG images showing the stroke order for a given Chinese character.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
text:
type: string
description: The Chinese character for which to generate stroke order images.
required:
- text
responses:
"200":
description: Successful response with URLs of generated PNG images
content:
application/json:
schema:
type: array
items:
type: object
properties:
pngUrl:
type: string
description: URL of the generated PNG image.
"400":
description: Bad request due to missing or invalid 'text' parameter
"500":
description: Internal server error