@@ -85,6 +85,11 @@ export class BgentRuntime {
85
85
*/
86
86
model = "gpt-3.5-turbo-0125" ;
87
87
88
+ /**
89
+ * The model to use for embedding.
90
+ */
91
+ embeddingModel = "text-embedding-3-large" ;
92
+
88
93
/**
89
94
* Store messages that are sent and received by the agent.
90
95
*/
@@ -129,6 +134,7 @@ export class BgentRuntime {
129
134
* @param opts.evaluators - Optional custom evaluators.
130
135
* @param opts.providers - Optional context providers.
131
136
* @param opts.model - The model to use for completion.
137
+ * @param opts.embeddingModel - The model to use for embedding.
132
138
*/
133
139
constructor ( opts : {
134
140
recentMessageCount ?: number ; // number of messages to hold in the recent message cache
@@ -140,13 +146,15 @@ export class BgentRuntime {
140
146
evaluators ?: Evaluator [ ] ; // Optional custom evaluators
141
147
providers ?: Provider [ ] ;
142
148
model ?: string ; // The model to use for completion
149
+ embeddingModel ?: string ; // The model to use for embedding
143
150
} ) {
144
151
this . #recentMessageCount =
145
152
opts . recentMessageCount ?? this . #recentMessageCount;
146
153
this . debugMode = opts . debugMode ?? false ;
147
154
this . supabase = opts . supabase ;
148
155
this . serverUrl = opts . serverUrl ?? this . serverUrl ;
149
156
this . model = opts . model ?? this . model ;
157
+ this . embeddingModel = opts . embeddingModel ?? this . embeddingModel ;
150
158
if ( ! this . serverUrl ) {
151
159
console . warn ( "No serverUrl provided, defaulting to localhost" ) ;
152
160
}
@@ -269,7 +277,7 @@ export class BgentRuntime {
269
277
* @returns The embedding of the input.
270
278
*/
271
279
async embed ( input : string ) {
272
- const embeddingModel = "text-embedding-3-large" ;
280
+ const embeddingModel = this . embeddingModel ;
273
281
const requestOptions = {
274
282
method : "POST" ,
275
283
headers : {
0 commit comments