FIX: forced tools wasn't set correctly when tool has no options. (#1231)

* wip: more dynamic availableForcedTools

* FIX: forced tools wasn't set correctly when tool has no options.

---------

Co-authored-by: Roman Rizzi <[email protected]>
This commit is contained in:
Joffrey JAFFEUX
2025-03-31 10:45:03 -03:00
committed by GitHub
co-authored by Roman Rizzi
parent f43137e067
commit 28fa723472
3 changed files with 16 additions and 8 deletions
@@ -77,7 +77,11 @@ export default class AiPersona extends RestModel {
flattenedToolStructure(data) {
return (data.tools || []).map((tName) => {
return [tName, data.toolOptions[tName], data.forcedTools.includes(tName)];
return [
tName,
data.toolOptions[tName] || {},
data.forcedTools.includes(tName),
];
});
}