apps/chat/src/utils/app/models.ts (20 lines of code) (raw):
import { EntityType } from '@/src/types/common';
import { DialAIEntityModel } from '@/src/types/models';
export const doesModelAllowSystemPrompt = (
model: DialAIEntityModel | undefined,
) => !!model?.features?.systemPrompt;
export const doesModelAllowTemperature = (
model: DialAIEntityModel | undefined,
) => !!model?.features?.temperature;
export const doesModelAllowAddons = (model: DialAIEntityModel | undefined) =>
!!model?.features?.addons;
export const doesModelHaveSettings = (model: DialAIEntityModel | undefined) => {
return (
model &&
model.type !== EntityType.Application && // custom settings in future
(model.type === EntityType.Assistant ||
doesModelAllowSystemPrompt(model) ||
doesModelAllowTemperature(model) ||
doesModelAllowAddons(model))
);
};