mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🔧 fix: Agent Capability Checks & DocumentDB Compatibility for Agent Resource Removal (#6726)
* fix: tool capability checks in loadAgentTools function * fix: enhance atomicity in removing agent resource files and add concurrency tests, improve documentdb compatibility
This commit is contained in:
parent
953e9732d9
commit
cff392e578
3 changed files with 165 additions and 41 deletions
|
|
@ -473,10 +473,10 @@ async function loadAgentTools({ req, res, agent, tool_resources, openAIApiKey })
|
|||
const areToolsEnabled = checkCapability(AgentCapabilities.tools);
|
||||
|
||||
const _agentTools = agent.tools?.filter((tool) => {
|
||||
if (tool === Tools.file_search && !checkCapability(AgentCapabilities.file_search)) {
|
||||
return false;
|
||||
} else if (tool === Tools.execute_code && !checkCapability(AgentCapabilities.execute_code)) {
|
||||
return false;
|
||||
if (tool === Tools.file_search) {
|
||||
return checkCapability(AgentCapabilities.file_search);
|
||||
} else if (tool === Tools.execute_code) {
|
||||
return checkCapability(AgentCapabilities.execute_code);
|
||||
} else if (!areToolsEnabled && !tool.includes(actionDelimiter)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue