Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Anything Llm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
Mintplex Labs
Anything Llm
Commits
b557a289
Unverified
Commit
b557a289
authored
6 months ago
by
Timothy Carambat
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Support `@agent` custom skills (#2280)
* Support `@agent` custom skills * move import
parent
297b8aaf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server/utils/agents/ephemeral.js
+23
-0
23 additions, 0 deletions
server/utils/agents/ephemeral.js
with
23 additions
and
0 deletions
server/utils/agents/ephemeral.js
+
23
−
0
View file @
b557a289
const
AIbitat
=
require
(
"
./aibitat
"
);
const
AIbitat
=
require
(
"
./aibitat
"
);
const
AgentPlugins
=
require
(
"
./aibitat/plugins
"
);
const
AgentPlugins
=
require
(
"
./aibitat/plugins
"
);
const
ImportedPlugin
=
require
(
"
./imported
"
);
const
{
httpSocket
}
=
require
(
"
./aibitat/plugins/http-socket.js
"
);
const
{
httpSocket
}
=
require
(
"
./aibitat/plugins/http-socket.js
"
);
const
{
WorkspaceChats
}
=
require
(
"
../../models/workspaceChats
"
);
const
{
WorkspaceChats
}
=
require
(
"
../../models/workspaceChats
"
);
const
{
safeJsonParse
}
=
require
(
"
../http
"
);
const
{
safeJsonParse
}
=
require
(
"
../http
"
);
...
@@ -160,6 +161,27 @@ class EphemeralAgentHandler extends AgentHandler {
...
@@ -160,6 +161,27 @@ class EphemeralAgentHandler extends AgentHandler {
continue
;
continue
;
}
}
// Load imported plugin. This is marked by `@@` in the array of functions to load.
// and is the @@hubID of the plugin.
if
(
name
.
startsWith
(
"
@@
"
))
{
const
hubId
=
name
.
replace
(
"
@@
"
,
""
);
const
valid
=
ImportedPlugin
.
validateImportedPluginHandler
(
hubId
);
if
(
!
valid
)
{
this
.
log
(
`Imported plugin by hubId
${
hubId
}
not found in plugin directory. Skipping inclusion to agent cluster.`
);
continue
;
}
const
plugin
=
ImportedPlugin
.
loadPluginByHubId
(
hubId
);
const
callOpts
=
plugin
.
parseCallOptions
();
this
.
aibitat
.
use
(
plugin
.
plugin
(
callOpts
));
this
.
log
(
`Attached
${
plugin
.
name
}
(
${
hubId
}
) imported plugin to Agent cluster`
);
continue
;
}
// Load single-stage plugin.
// Load single-stage plugin.
if
(
!
AgentPlugins
.
hasOwnProperty
(
name
))
{
if
(
!
AgentPlugins
.
hasOwnProperty
(
name
))
{
this
.
log
(
this
.
log
(
...
@@ -192,6 +214,7 @@ class EphemeralAgentHandler extends AgentHandler {
...
@@ -192,6 +214,7 @@ class EphemeralAgentHandler extends AgentHandler {
AgentPlugins
.
docSummarizer
.
name
,
AgentPlugins
.
docSummarizer
.
name
,
AgentPlugins
.
webScraping
.
name
,
AgentPlugins
.
webScraping
.
name
,
...(
await
agentSkillsFromSystemSettings
()),
...(
await
agentSkillsFromSystemSettings
()),
...(
await
ImportedPlugin
.
activeImportedPlugins
()),
];
];
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment