mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🐛 fix: Avatar Type Definitions in Agent/Assistant Schemas (#6235)
* fix: Simplify avatar type definition in agent and assistant schemas * fix: Update regex to correctly match OpenAI model identifiers
This commit is contained in:
parent
dc8d5dee6a
commit
a846e898a2
3 changed files with 3 additions and 11 deletions
|
|
@ -166,7 +166,7 @@ const fetchOpenAIModels = async (opts, _models = []) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (baseURL === openaiBaseURL) {
|
if (baseURL === openaiBaseURL) {
|
||||||
const regex = /(text-davinci-003|gpt-|o\d+-)/;
|
const regex = /(text-davinci-003|gpt-|o\d+)/;
|
||||||
const excludeRegex = /audio|realtime/;
|
const excludeRegex = /audio|realtime/;
|
||||||
models = models.filter((model) => regex.test(model) && !excludeRegex.test(model));
|
models = models.filter((model) => regex.test(model) && !excludeRegex.test(model));
|
||||||
const instructModels = models.filter((model) => model.includes('instruct'));
|
const instructModels = models.filter((model) => model.includes('instruct'));
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,4 @@
|
||||||
import { Schema, Document, Types } from 'mongoose';
|
import { Schema, Document, Types } from 'mongoose';
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
export interface IAgent extends Omit<Document, 'model'> {
|
export interface IAgent extends Omit<Document, 'model'> {
|
||||||
id: string;
|
id: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
@ -47,10 +45,7 @@ const agentSchema = new Schema<IAgent>(
|
||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
avatar: {
|
avatar: {
|
||||||
type: {
|
type: Schema.Types.Mixed,
|
||||||
filepath: String,
|
|
||||||
source: String,
|
|
||||||
},
|
|
||||||
default: undefined,
|
default: undefined,
|
||||||
},
|
},
|
||||||
provider: {
|
provider: {
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,7 @@ const assistantSchema = new Schema<IAssistant>(
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
avatar: {
|
avatar: {
|
||||||
type: {
|
type: Schema.Types.Mixed,
|
||||||
filepath: String,
|
|
||||||
source: String,
|
|
||||||
},
|
|
||||||
default: undefined,
|
default: undefined,
|
||||||
},
|
},
|
||||||
conversation_starters: {
|
conversation_starters: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue