Skip to content

Commit

Permalink
fix: Added if statement to check that the model is included
Browse files Browse the repository at this point in the history
  • Loading branch information
TroyceGowdy committed Nov 1, 2024
1 parent 8ea80f6 commit 1494b82
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/aux-records/AIController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,12 +612,14 @@ export class AIController {

if (allowedFeatures.ai.chat.allowedModels) {
const allowedModels = allowedFeatures.ai.chat.allowedModels;
return {
success: false,
errorCode: 'not_authorized',
errorMessage:
'The subscription does not permit the given model for AI Chat features.',
};
if (!allowedModels.includes(model)) {
return {
success: false,
errorCode: 'not_authorized',
errorMessage:
'The subscription does not permit the given model for AI Chat features.',
};
}
}

let maxTokens: number = undefined;
Expand Down

0 comments on commit 1494b82

Please sign in to comment.