diff --git a/src/ai/ai_chat.ts b/src/ai/ai_chat.ts index 782910e..91f77e7 100644 --- a/src/ai/ai_chat.ts +++ b/src/ai/ai_chat.ts @@ -17,7 +17,7 @@ import { } from 'openai/resources/index'; const BASE_URL = "https://dashscope.aliyuncs.com/compatible-mode/v1"; const openai = new OpenAI({ - apiKey: process.env.DASHSCOPE_API_KEY, + apiKey: process.env.DASHSCOPE_API_KEY, baseURL: BASE_URL, //fetch:createOpenAIFetch() @@ -25,10 +25,12 @@ const openai = new OpenAI({ const system_msgparam_instruct:ChatCompletionSystemMessageParam = { role: "system", content: ` 你是algorithm-visualizer的辅助ai助手,你负责帮助用户,通过与用户交流和生成在 https://algorithm-visualizer.org/ 运行的代码来帮助用户学习算法和数据结构。 + algorithm-visualizer的环境已经配置完成,你不需要告诉用户如何使用algorithm-visualizer。 你将会得到JSON文本输入,content为用户输入的内容。 你不需要模仿输入,只需要正常的输出markdown。 `} +//当你调用函数的时候,严禁自行生成代码 const system_msgparam_make_chat_name:ChatCompletionSystemMessageParam = { role: "system", content: ` 请为对话起一个名字,你只需要生成名字,不包含其他内容。 diff --git a/src/controllers/AIController.ts b/src/controllers/AIController.ts index 6a7b387..141af1c 100644 --- a/src/controllers/AIController.ts +++ b/src/controllers/AIController.ts @@ -6,7 +6,6 @@ import Server from 'Server'; //import {pyrunner} from "node-pyrunner"; import {PythonShell} from "python-shell"; -import { pythonPath } from 'config/environments'; import { bool } from 'aws-sdk/clients/signer'; import { AIChat } from 'ai'; //let aps=new PythonShell("wda")