-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
251 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { cwd } from 'process'; | ||
import { AiBot } from './coze.mjs'; | ||
|
||
const BOT_ID = '7369473402367361041'; // GPT-4 模型 | ||
const TOKEN = process.env.COZE_TOKEN_ADM; | ||
|
||
const prompt_article = ` | ||
今天又是努力工作的一天,帮我写一篇今天的日记,10 字左右 | ||
`; | ||
|
||
///// 主流程开始 ///// | ||
|
||
const bot = new AiBot(BOT_ID, TOKEN); | ||
// 主指令 | ||
const answer = await bot.chat(prompt_article); | ||
|
||
console.log(answer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { AiBot } from './coze.mjs'; | ||
|
||
const BOT_ID = '7369473402367361041'; // GPT-4 模型 | ||
const TOKEN = process.env.COZE_TOKEN_ADM; | ||
|
||
// 一个游戏,测试 AI 上下文能力 | ||
const prompt_game = ` | ||
现在我们玩一个游戏: | ||
当我发送一个数字,你应该将这个数字+1,并将结果发给我。 | ||
当我发送 "Next",你应该继续+1,并将结果发给我。 | ||
当再次接收到数字后,游戏重新开始。 | ||
严格按照游戏规则回复,不要回复其他内容。 | ||
首先我给你一个数字是 1 | ||
`; | ||
|
||
///// 主流程开始 ///// | ||
|
||
const bot = new AiBot(BOT_ID, TOKEN); | ||
// 主指令 | ||
await bot.chat(prompt_game); | ||
await bot.chat('Next'); | ||
await bot.chat('Next'); | ||
await bot.chat('Next'); | ||
await bot.chat('Next'); |
Oops, something went wrong.