mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-23 10:46:12 +01:00
✨ feat: Add badge support to model specifications with TBadge type and schema
This commit is contained in:
parent
acafdb54c2
commit
b50406ab9e
2 changed files with 26 additions and 5 deletions
|
|
@ -8,6 +8,11 @@ import {
|
|||
authTypeSchema,
|
||||
} from './schemas';
|
||||
|
||||
export type TBadge = {
|
||||
text: string;
|
||||
color: string;
|
||||
};
|
||||
|
||||
export type TModelSpec = {
|
||||
name: string;
|
||||
label: string;
|
||||
|
|
@ -19,11 +24,15 @@ export type TModelSpec = {
|
|||
showIconInHeader?: boolean;
|
||||
iconURL?: string | EModelEndpoint; // Allow using project-included icons
|
||||
authType?: AuthType;
|
||||
groups?: Array<string>; // List of group ObjectIds allowed to access this model
|
||||
// badgeIcon?: string; // URL to badge icon for visual categorization
|
||||
// badgeTooltip?: string; // Tooltip text for the badge
|
||||
groups?: string[];
|
||||
badges?: TBadge[];
|
||||
};
|
||||
|
||||
export const tBadgeSchema = z.object({
|
||||
text: z.string(),
|
||||
color: z.string(),
|
||||
});
|
||||
|
||||
export const tModelSpecSchema = z.object({
|
||||
name: z.string(),
|
||||
label: z.string(),
|
||||
|
|
@ -36,8 +45,7 @@ export const tModelSpecSchema = z.object({
|
|||
iconURL: z.union([z.string(), eModelEndpointSchema]).optional(),
|
||||
authType: authTypeSchema.optional(),
|
||||
groups: z.array(z.string()).optional(),
|
||||
// badgeIcon: z.string().url('Must be a valid URL').optional(),
|
||||
// badgeTooltip: z.string().optional(),
|
||||
badges: z.array(tBadgeSchema).optional(),
|
||||
});
|
||||
|
||||
export const specsConfigSchema = z.object({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue