-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from IdeaLeap/dev
migrate openai-node to v4.0.1
- Loading branch information
Showing
31 changed files
with
1,504 additions
and
904 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
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 |
---|---|---|
|
@@ -16,4 +16,4 @@ module.exports = { | |
], | ||
setupFiles: ["dotenv/config"], | ||
testTimeout: 20_000, | ||
}; | ||
}; |
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 @@ | ||
export * from "./teacherAgents/index.js"; |
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 |
---|---|---|
@@ -1,17 +1,29 @@ | ||
import { BaseAgent } from "../agent.js"; | ||
import fetch from "node-fetch"; | ||
const data = (await ( | ||
await fetch( | ||
"https://idealeap-1254110372.cos.ap-shanghai.myqcloud.com/Other/agent.json", | ||
) | ||
).json()) as { agents: any[] }; | ||
const agent = new BaseAgent(data.agents[0].params); | ||
const res = await agent.call( | ||
`你好,非常欢迎你来到我身边~我是xxx,我会把最美好的一面呈现给你!`, | ||
); | ||
if (!res.success) { | ||
console.error(res.message); | ||
} else { | ||
console.log(res.data); | ||
} | ||
debugger; | ||
import { BaseAgent } from "@idealeap/gwt"; | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const fetch = require("node-fetch"); | ||
test("参数从远程载入", async () => { | ||
const data = (await ( | ||
await fetch("https://cos.idealeap.cn/Other/agent.json") | ||
).json()) as { agents: any[] }; | ||
const agent = new BaseAgent(data.agents[0].params); | ||
const res = await agent.call({ | ||
request: `你好,非常欢迎你来到我身边~我是xxx,我会把最美好的一面呈现给你!`, | ||
prompts: data.agents[0].params.prompts, | ||
struct: data.agents[0].params.struct, | ||
}); | ||
if (!res.success) { | ||
console.error(res.message); | ||
} else { | ||
console.log(res.data); | ||
} | ||
debugger; | ||
|
||
// system : You are an article polishing teacher, the main task is polishing PPT speech draft.I'll give you a speech, you need to polish it up. Ensure the consistency, logic and grammatical correctness of the speech. Please use Encouraging language to fully reflect the brief nature of the PPT presentation. Whatever I offer, I must answer in Chinese. After answering, please make an objective evaluation of the results. The rating items are [audience_understandability,logicality]Finally, according to the score and results, the next improvement suggestions are given. | ||
|
||
// user: | ||
// 你好,非常欢迎你来到我身边~我是xxx,我会把最美好的一面呈现给你! | ||
|
||
// assistant: {"name":"result_evaluation","arguments":"{\n \"polished_result\": \"你好,非常欢迎你来到我身边!我是xxx,我将为你展示我最美好的一面!\",\n \"audience_understandability\": 90,\n \"logicality\": 90,\n \"suggestion\": \"no suggestion\"\n } "} | ||
|
||
// {polished_result: '你好,非常欢迎你来到我身边!我是xxx,我将为你展示我最美好的一面!', audience_understandability: 90, logicality: 90, suggestion: 'no suggestion'} | ||
}); |
This file was deleted.
Oops, something went wrong.
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 @@ | ||
export * from "./agent.js"; |
Oops, something went wrong.