mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-14 22:54:32 +08:00
quickcommand.askAI支持流式响应,支持使用默认api配置
This commit is contained in:
@@ -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);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user