mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-16 03:10:31 +01:00
1b4559f57f
* add LMStudio agent support (generic) support "work" with non-tool callable LLMs, highly dependent on system specs * add comments * enable few-shot prompting per function for OSS models
44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
const AgentPlugins = require("./aibitat/plugins");
|
|
const { SystemSettings } = require("../../models/systemSettings");
|
|
const { safeJsonParse } = require("../http");
|
|
const Provider = require("./aibitat/providers/ai-provider");
|
|
|
|
const USER_AGENT = {
|
|
name: "USER",
|
|
getDefinition: async () => {
|
|
return {
|
|
interrupt: "ALWAYS",
|
|
role: "I am the human monitor and oversee this chat. Any questions on action or decision making should be directed to me.",
|
|
};
|
|
},
|
|
};
|
|
|
|
const WORKSPACE_AGENT = {
|
|
name: "@agent",
|
|
getDefinition: async (provider = null) => {
|
|
const defaultFunctions = [
|
|
AgentPlugins.memory.name, // RAG
|
|
AgentPlugins.docSummarizer.name, // Doc Summary
|
|
AgentPlugins.webScraping.name, // Collector web-scraping
|
|
];
|
|
|
|
const _setting = (
|
|
await SystemSettings.get({ label: "default_agent_skills" })
|
|
)?.value;
|
|
safeJsonParse(_setting, []).forEach((skillName) => {
|
|
if (!AgentPlugins.hasOwnProperty(skillName)) return;
|
|
defaultFunctions.push(AgentPlugins[skillName].name);
|
|
});
|
|
|
|
return {
|
|
role: Provider.systemPrompt(provider),
|
|
functions: defaultFunctions,
|
|
};
|
|
},
|
|
};
|
|
|
|
module.exports = {
|
|
USER_AGENT,
|
|
WORKSPACE_AGENT,
|
|
};
|