mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-14 10:30:10 +01:00
15cf921616
* Support SQL Agent skill * add MSSQL agent connector * Add frontend to agent skills remove FAKE_DB mock reset skills to pickup child-skill dynamically * add prompt examples for tools on untooled * add better logging on SQL agents * Wipe toolruns on each chat relay so tools can be used within the same session * update comments
50 lines
1.6 KiB
JavaScript
50 lines
1.6 KiB
JavaScript
module.exports.SqlAgentListDatabase = {
|
|
name: "sql-list-databases",
|
|
plugin: function () {
|
|
const { listSQLConnections } = require("./SQLConnectors");
|
|
return {
|
|
name: "sql-list-databases",
|
|
setup(aibitat) {
|
|
aibitat.function({
|
|
super: aibitat,
|
|
name: this.name,
|
|
description:
|
|
"List all available databases via `list_databases` you currently have access to. Returns a unique string identifier `database_id` that can be used for future calls.",
|
|
examples: [
|
|
{
|
|
prompt: "What databases can you access?",
|
|
call: JSON.stringify({}),
|
|
},
|
|
{
|
|
prompt: "What databases can you tell me about?",
|
|
call: JSON.stringify({}),
|
|
},
|
|
{
|
|
prompt: "Is there a database named erp-logs you can access?",
|
|
call: JSON.stringify({}),
|
|
},
|
|
],
|
|
parameters: {
|
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
type: "object",
|
|
properties: {},
|
|
additionalProperties: false,
|
|
},
|
|
handler: async function () {
|
|
this.super.handlerProps.log(`Using the sql-list-databases tool.`);
|
|
this.super.introspect(
|
|
`${this.caller}: Checking what are the available databases.`
|
|
);
|
|
|
|
const connections = (await listSQLConnections()).map((conn) => {
|
|
const { connectionString, ...rest } = conn;
|
|
return rest;
|
|
});
|
|
return JSON.stringify(connections);
|
|
},
|
|
});
|
|
},
|
|
};
|
|
},
|
|
};
|