diff --git a/src/utils/api.js b/src/utils/api.js index 9740efd0deb64b040b7e94651ae8c7bf55e7b557..b9828021e837e2094715a8816868d598c1c37a60 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -11,13 +11,7 @@ import { is_empty, checkWin, is_black, is_white } from "./index" * @return {[number, number]} 返回机器人回合要落子的坐标 */ export async function robotPlay(board, player, win_size) { - /** - * 发送请求,InsCode 已经集成了 GPT 能力 - * 在 vite.config.js 中已通过环境变量写入了 apiKey(该 key 是动态写入使用者的,在 IDE 中是作者,发布到社区是运行该作品的用户) - * 发布到社区后,将消耗运行者的额度 - * 注意:如果部署应用,任何人通过部署后的域名访问应用时,都将消耗部署者的额度 - */ - const content = `这是一个五子棋游戏,${JSON.stringify(board)},下一步只能在"${is_empty}"的位置中选择,下一步"${player}"要下到哪,请不要返回多余的文字,只返回数组,比如["x", "y"]。` + const content = `这是一个五子棋游戏,${JSON.stringify(board)},只能在"${is_empty}"中选择下一步的位置,"${player}"要下到哪?请不要返回多余的文字,只返回数组,比如["x", "y"]。` const body = { messages: [ { diff --git a/src/utils/index.js b/src/utils/index.js index 67705edf01af41871e08f6ef4e254d5ba25d60a5..9b0c9b039384e2f7c15ae7a3dc4745ab56380924 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -56,7 +56,7 @@ export function checkWin({ row, col, board, player, win_size, direction }) { return false; // 未出现五连珠 } -// 机器人下棋 +// TODO: 机器人下棋 export function robotPlay(board, player, win_size) { // 深度复制一份棋盘 const _board = JSON.parse(JSON.stringify(board))