mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-13 05:58:51 +01:00
🦥 feat: Add Deferred Tools as Agents Capability (#11295)
This commit is contained in:
parent
70a218ff82
commit
9cb9f42f52
8 changed files with 819 additions and 79 deletions
|
|
@ -409,8 +409,14 @@ async function loadAgentTools({
|
|||
const checkCapability = (capability) => {
|
||||
const enabled = enabledCapabilities.has(capability);
|
||||
if (!enabled) {
|
||||
const isToolCapability = [
|
||||
AgentCapabilities.file_search,
|
||||
AgentCapabilities.execute_code,
|
||||
AgentCapabilities.web_search,
|
||||
].includes(capability);
|
||||
const suffix = isToolCapability ? ' despite configured tool.' : '.';
|
||||
logger.warn(
|
||||
`Capability "${capability}" disabled${capability === AgentCapabilities.tools ? '.' : ' despite configured tool.'} User: ${req.user.id} | Agent: ${agent.id}`,
|
||||
`Capability "${capability}" disabled${suffix} User: ${req.user.id} | Agent: ${agent.id}`,
|
||||
);
|
||||
}
|
||||
return enabled;
|
||||
|
|
@ -519,11 +525,13 @@ async function loadAgentTools({
|
|||
}, {});
|
||||
|
||||
/** Build tool registry from MCP tools and create PTC/tool search tools if configured */
|
||||
const deferredToolsEnabled = checkCapability(AgentCapabilities.deferred_tools);
|
||||
const { toolRegistry, additionalTools, hasDeferredTools } = await buildToolClassification({
|
||||
loadedTools,
|
||||
userId: req.user.id,
|
||||
agentId: agent.id,
|
||||
agentToolOptions: agent.tool_options,
|
||||
deferredToolsEnabled,
|
||||
loadAuthValues,
|
||||
});
|
||||
agentTools.push(...additionalTools);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue