@@ -985,42 +985,52 @@ Text: ${attachment.text}
985
985
formattedCharacterMessageExamples
986
986
)
987
987
: "" ,
988
- messageDirections :
988
+ messageDirections :
989
+ this . character ?. style ?. all ?. length > 0 ||
990
+ this . character ?. style ?. chat . length > 0
991
+ ? addHeader (
992
+ "# Message Directions for " + this . character . name ,
993
+ ( ( ) => {
994
+ const all = this . character ?. style ?. all || [ ] ;
995
+ const chat = this . character ?. style ?. chat || [ ] ;
996
+ return [ ...all , ...chat ] . join ( "\n" ) ;
997
+ } ) ( )
998
+ )
999
+ : "" ,
1000
+
1001
+ postDirections :
989
1002
this . character ?. style ?. all ?. length > 0 ||
990
- this . character ?. style ?. chat . length > 0
1003
+ this . character ?. style ?. post . length > 0
991
1004
? addHeader (
992
- "# Message Directions for " + this . character . name ,
993
- ( ( ) => {
994
- const all = this . character ?. style ?. all || [ ] ;
995
- const chat = this . character ?. style ?. chat || [ ] ;
996
- const shuffled = [ ...all , ...chat ] . sort (
997
- ( ) => 0.5 - Math . random ( )
998
- ) ;
999
- const allSliced = shuffled . slice (
1000
- 0 ,
1001
- conversationLength / 2
1002
- ) ;
1003
- return allSliced . concat ( allSliced ) . join ( "\n" ) ;
1004
- } ) ( )
1005
- )
1005
+ "# Post Directions for " + this . character . name ,
1006
+ ( ( ) => {
1007
+ const all = this . character ?. style ?. all || [ ] ;
1008
+ const post = this . character ?. style ?. post || [ ] ;
1009
+ return [ ...all , ...post ] . join ( "\n" ) ;
1010
+ } ) ( )
1011
+ )
1006
1012
: "" ,
1013
+
1014
+ //old logic left in for reference
1015
+ //food for thought. how could we dynamically decide what parts of the character to add to the prompt other than random? rag? prompt the llm to decide?
1016
+ /*
1007
1017
postDirections:
1008
1018
this.character?.style?.all?.length > 0 ||
1009
1019
this.character?.style?.post.length > 0
1010
1020
? addHeader(
1011
- "# Post Directions for " + this . character . name ,
1012
- ( ( ) => {
1013
- const all = this . character ?. style ?. all || [ ] ;
1014
- const post = this . character ?. style ?. post || [ ] ;
1015
- const shuffled = [ ...all , ...post ] . sort (
1016
- ( ) => 0.5 - Math . random ( )
1017
- ) ;
1018
- return shuffled
1019
- . slice ( 0 , conversationLength / 2 )
1020
- . join ( "\n" ) ;
1021
- } ) ( )
1022
- )
1023
- : "" ,
1021
+ "# Post Directions for " + this.character.name,
1022
+ (() => {
1023
+ const all = this.character?.style?.all || [];
1024
+ const post = this.character?.style?.post || [];
1025
+ const shuffled = [...all, ...post].sort(
1026
+ () => 0.5 - Math.random()
1027
+ );
1028
+ return shuffled
1029
+ .slice(0, conversationLength / 2)
1030
+ .join("\n");
1031
+ })()
1032
+ )
1033
+ : "",*/
1024
1034
// Agent runtime stuff
1025
1035
senderName,
1026
1036
actors :
0 commit comments