Skip to content

Commit 962a9a1

Browse files
danny-avilajustinmdickey
authored andcommitted
🐛 fix: Avatar Type Definitions in Agent/Assistant Schemas (danny-avila#6235)
* fix: Simplify avatar type definition in agent and assistant schemas * fix: Update regex to correctly match OpenAI model identifiers
1 parent 477faeb commit 962a9a1

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

api/server/services/ModelService.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const fetchOpenAIModels = async (opts, _models = []) => {
166166
}
167167

168168
if (baseURL === openaiBaseURL) {
169-
const regex = /(text-davinci-003|gpt-|o\d+-)/;
169+
const regex = /(text-davinci-003|gpt-|o\d+)/;
170170
const excludeRegex = /audio|realtime/;
171171
models = models.filter((model) => regex.test(model) && !excludeRegex.test(model));
172172
const instructModels = models.filter((model) => model.includes('instruct'));

packages/data-schemas/src/schema/agent.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import { Schema, Document, Types } from 'mongoose';
2-
3-
// @ts-ignore
42
export interface IAgent extends Omit<Document, 'model'> {
53
id: string;
64
name?: string;
@@ -47,10 +45,7 @@ const agentSchema = new Schema<IAgent>(
4745
type: String,
4846
},
4947
avatar: {
50-
type: {
51-
filepath: String,
52-
source: String,
53-
},
48+
type: Schema.Types.Mixed,
5449
default: undefined,
5550
},
5651
provider: {

packages/data-schemas/src/schema/assistant.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ const assistantSchema = new Schema<IAssistant>(
2727
required: true,
2828
},
2929
avatar: {
30-
type: {
31-
filepath: String,
32-
source: String,
33-
},
30+
type: Schema.Types.Mixed,
3431
default: undefined,
3532
},
3633
conversation_starters: {

0 commit comments

Comments
 (0)