quickcommand.askAI支持流式响应,支持使用默认api配置

This commit is contained in:
fofolee
2025-02-21 11:31:45 +08:00
parent 0090442101
commit 1e5a4c1ff5
7 changed files with 143 additions and 265 deletions

View File

@@ -8,6 +8,8 @@ const axios = require("axios");
const marked = require("marked");
const { chat, getModels } = require("./ai");
const { dbStorage } = utools;
window.getModelsFromAiApi = getModels;
const systemDialog = require("./dialog/service");
@@ -197,6 +199,9 @@ const quickcommand = {
},
askAI: async function (content, apiConfig, options) {
if (window.lodashM.isEmpty(apiConfig)) {
apiConfig = dbStorage.getItem("cfg_aiConfigs")?.[0] || {};
}
return await chat(content, apiConfig, options);
},