@@ -29,6 +29,7 @@ import {
29
29
ICacheManager ,
30
30
IDatabaseAdapter ,
31
31
IMemoryManager ,
32
+ KnowledgeItem ,
32
33
ModelClass ,
33
34
ModelProviderName ,
34
35
Plugin ,
@@ -952,10 +953,14 @@ Text: ${attachment.text}
952
953
. join ( " " ) ;
953
954
}
954
955
956
+
957
+ const knowledegeData = await knowledge . get ( this , message ) ;
958
+
955
959
const formattedKnowledge = formatKnowledge (
956
- await knowledge . get ( this , message )
960
+ knowledegeData
957
961
) ;
958
962
963
+
959
964
const initialState = {
960
965
agentId : this . agentId ,
961
966
agentName,
@@ -971,6 +976,7 @@ Text: ${attachment.text}
971
976
]
972
977
: "" ,
973
978
knowledge : formattedKnowledge ,
979
+ knowledgeData : knowledegeData ,
974
980
// Recent interactions between the sender and receiver, formatted as messages
975
981
recentMessageInteractions : formattedMessageInteractions ,
976
982
// Recent interactions between the sender and receiver, formatted as posts
@@ -1097,7 +1103,7 @@ Text: ${attachment.text}
1097
1103
? addHeader ( "# Attachments" , formattedAttachments )
1098
1104
: "" ,
1099
1105
...additionalKeys ,
1100
- } ;
1106
+ } as State ;
1101
1107
1102
1108
const actionPromises = this . actions . map ( async ( action : Action ) => {
1103
1109
const result = await action . validate ( this , message , initialState ) ;
@@ -1235,6 +1241,6 @@ Text: ${attachment.text}
1235
1241
}
1236
1242
}
1237
1243
1238
- const formatKnowledge = ( knowledge : string [ ] ) => {
1239
- return knowledge . map ( ( knowledge ) => `- ${ knowledge } ` ) . join ( "\n" ) ;
1244
+ const formatKnowledge = ( knowledge : KnowledgeItem [ ] ) => {
1245
+ return knowledge . map ( ( knowledge ) => `- ${ knowledge . content . text } ` ) . join ( "\n" ) ;
1240
1246
} ;
0 commit comments