mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
👮 fix(enforceModelSpec): handle nested objects (#2681)
This commit is contained in:
parent
c83d9d61d4
commit
89899164ed
3 changed files with 71 additions and 4 deletions
|
|
@ -42,6 +42,15 @@ async function buildEndpointOption(req, res, next) {
|
|||
return handleError(res, { text: 'Model spec mismatch' });
|
||||
}
|
||||
|
||||
if (
|
||||
currentModelSpec.preset.endpoint !== EModelEndpoint.gptPlugins &&
|
||||
currentModelSpec.preset.tools
|
||||
) {
|
||||
return handleError(res, {
|
||||
text: `Only the "${EModelEndpoint.gptPlugins}" endpoint can have tools defined in the preset`,
|
||||
});
|
||||
}
|
||||
|
||||
const isValidModelSpec = enforceModelSpec(currentModelSpec, parsedBody);
|
||||
if (!isValidModelSpec) {
|
||||
return handleError(res, { text: 'Model spec mismatch' });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue