mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 10:50:14 +01:00
👤 feat: User ID in Model Query; chore: cleanup ModelService (#1753)
* feat: send the LibreChat user ID as a query param when fetching the list of models * chore: update bun * chore: change bun command for building data-provider * refactor: prefer use of `getCustomConfig` to access custom config, also move to `server/services/Config` * refactor: make endpoints/custom option for the config optional, add userIdQuery, and use modelQueries log store in ModelService * refactor(ModelService): use env variables at runtime, use default models from data-provider, and add tests * docs: add `userIdQuery` * fix(ci): import changed
This commit is contained in:
parent
d06e5d2e02
commit
ff057152e2
17 changed files with 339 additions and 83 deletions
|
|
@ -15,6 +15,7 @@ export const endpointSchema = z.object({
|
|||
models: z.object({
|
||||
default: z.array(z.string()).min(1),
|
||||
fetch: z.boolean().optional(),
|
||||
userIdQuery: z.boolean().optional(),
|
||||
}),
|
||||
titleConvo: z.boolean().optional(),
|
||||
titleMethod: z.union([z.literal('completion'), z.literal('functions')]).optional(),
|
||||
|
|
@ -40,7 +41,8 @@ export const configSchema = z.object({
|
|||
.object({
|
||||
custom: z.array(endpointSchema.partial()),
|
||||
})
|
||||
.strict(),
|
||||
.strict()
|
||||
.optional(),
|
||||
});
|
||||
|
||||
export type TCustomConfig = z.infer<typeof configSchema>;
|
||||
|
|
@ -177,6 +179,10 @@ export enum CacheKeys {
|
|||
* Key for the model config cache.
|
||||
*/
|
||||
MODELS_CONFIG = 'modelsConfig',
|
||||
/**
|
||||
* Key for the model queries cache.
|
||||
*/
|
||||
MODEL_QUERIES = 'modelQueries',
|
||||
/**
|
||||
* Key for the default endpoint config cache.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue