File tree 5 files changed +9
-30
lines changed
client-discord/src/actions
plugin-bootstrap/src/actions
5 files changed +9
-30
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ Note that {{agentName}} is capable of reading/seeing/hearing various forms of me
46
46
47
47
{{actions}}
48
48
49
- # Instructions: Write the next message for {{agentName}}. Ignore "action".
49
+ # Instructions: Write the next message for {{agentName}}.
50
50
` + messageCompletionFooter ;
51
51
52
52
export interface SimliClientConfig {
Original file line number Diff line number Diff line change @@ -233,15 +233,11 @@ const summarizeAction = {
233
233
unique : false ,
234
234
} ) ;
235
235
236
- console . log ( "memories" , memories ) ;
237
-
238
236
const actors = await getActorDetails ( {
239
237
runtime : runtime as IAgentRuntime ,
240
238
roomId,
241
239
} ) ;
242
240
243
- console . log ( "actors" , actors ) ;
244
-
245
241
const actorMap = new Map ( actors . map ( ( actor ) => [ actor . id , actor ] ) ) ;
246
242
247
243
const formattedMemories = memories
@@ -261,21 +257,17 @@ const summarizeAction = {
261
257
const chunkSize = model . settings . maxContextLength - 1000 ;
262
258
263
259
const chunks = await splitChunks (
264
- runtime ,
265
260
formattedMemories ,
266
261
chunkSize ,
267
- 0 ,
268
- "gpt-4o-mini"
262
+ 0
269
263
) ;
270
264
271
- console . log ( "chunks " , chunks . length ) ;
272
265
const datestr = new Date ( ) . toUTCString ( ) . replace ( / : / g, "-" ) ;
273
266
274
267
state . memoriesWithAttachments = formattedMemories ;
275
268
state . objective = objective ;
276
269
277
270
for ( let i = 0 ; i < chunks . length ; i ++ ) {
278
- console . log ( "chunk" , i ) ;
279
271
const chunk = chunks [ i ] ;
280
272
state . currentSummary = currentSummary ;
281
273
state . currentChunk = chunk ;
Original file line number Diff line number Diff line change @@ -389,24 +389,14 @@ export async function generateShouldRespond({
389
389
* @returns Promise resolving to array of text chunks with bleed sections
390
390
*/
391
391
export async function splitChunks (
392
- runtime ,
393
392
content : string ,
394
393
chunkSize : number ,
395
394
bleed : number = 100 ,
396
- modelClass : string
397
395
) : Promise < string [ ] > {
398
- const model = models [ runtime . modelProvider ] ;
399
- console . log ( "model" , model ) ;
400
-
401
- console . log ( "model.model.embedding" , model . model . embedding ) ;
402
-
403
- if ( ! model . model . embedding ) {
404
- throw new Error ( "Model does not support embedding" ) ;
405
- }
406
-
407
396
const encoding = tiktoken . encoding_for_model (
408
- model . model . embedding as TiktokenModel
397
+ "gpt-4o-mini"
409
398
) ;
399
+
410
400
const tokens = encoding . encode ( content ) ;
411
401
const chunks : string [ ] = [ ] ;
412
402
const textDecoder = new TextDecoder ( ) ;
Original file line number Diff line number Diff line change @@ -344,11 +344,9 @@ export class AgentRuntime implements IAgentRuntime {
344
344
} ,
345
345
} ) ;
346
346
const fragments = await splitChunks (
347
- this ,
348
347
knowledgeItem ,
349
348
1200 ,
350
- 200 ,
351
- "fast"
349
+ 200
352
350
) ;
353
351
for ( const fragment of fragments ) {
354
352
const embedding = await embed ( this , fragment ) ;
@@ -900,10 +898,9 @@ Text: ${attachment.text}
900
898
const memories = await runtime . knowledgeManager . searchMemoriesByEmbedding (
901
899
embedding ,
902
900
{
903
- roomId : message . roomId ,
904
- agentId : runtime . agentId ,
905
- match_threshold : 0.95 ,
906
- count : 1 ,
901
+ roomId : message . agentId ,
902
+ agentId : message . agentId ,
903
+ count : 3 ,
907
904
}
908
905
) ;
909
906
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ Note that {{agentName}} is capable of reading/seeing/hearing various forms of me
45
45
46
46
{{actions}}
47
47
48
- # Instructions: Write the next message for {{agentName}}. Ignore "action".
48
+ # Instructions: Write the next message for {{agentName}}.
49
49
` + messageCompletionFooter ;
50
50
51
51
export const shouldContinueTemplate =
You can’t perform that action at this time.
0 commit comments