refactor: tool classification and calling logic

This commit is contained in:
Danny Avila 2025-12-08 14:57:14 -05:00
parent c7ddaaf298
commit d4bdb3be00
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
6 changed files with 26 additions and 17 deletions

View file

@ -1,6 +1,7 @@
const { nanoid } = require('nanoid');
const { sendEvent, GenerationJobManager } = require('@librechat/api');
const { Constants } = require('@librechat/agents');
const { logger } = require('@librechat/data-schemas');
const { sendEvent, GenerationJobManager } = require('@librechat/api');
const { Tools, StepTypes, FileContext, ErrorTypes } = require('librechat-data-provider');
const {
EnvVar,
@ -441,10 +442,10 @@ function createToolEndCallback({ req, res, artifactPromises, streamId = null })
return;
}
{
if (output.name !== Tools.execute_code) {
return;
}
const isCodeTool =
output.name === Tools.execute_code || output.name === Constants.PROGRAMMATIC_TOOL_CALLING;
if (!isCodeTool) {
return;
}
if (!output.artifact.files) {