quivr/frontend/lib/helpers/defineMaxTokens.ts
ChloeMouret e9ebeef72a
feat: gpt4 is not available for brains if there is no given openAiKey (#850)
* rename defineMaxToken

* use gpt-3.5-turbo instead of gpt-3.5-turbo-0613

* gpt4 not available if no open ai key
2023-08-07 16:35:23 +02:00

16 lines
390 B
TypeScript

import { Model, PaidModels } from "../context/BrainConfigProvider/types";
export const defineMaxTokens = (model: Model | PaidModels): number => {
//At the moment is evaluating only models from OpenAI
switch (model) {
case "gpt-3.5-turbo":
return 500;
case "gpt-3.5-turbo-16k":
return 2000;
case "gpt-4":
return 1000;
default:
return 250;
}
};