@@ -10,6 +10,7 @@ public class ChatProcessContext
1010 public Guid CharacterId { get ; private set ; }
1111 public string UserMessage { get ; private set ; } = string . Empty ;
1212 public string MemoryStore { get ; private set ; } = string . Empty ;
13+ public DateTime UserRequestAt { get ; private set ; } = DateTime . Now ;
1314 public bool UseTTS { get ; private set ; } = true ;
1415
1516 public CharacterDto ? Character { get ; private set ; }
@@ -19,11 +20,6 @@ public class ChatProcessContext
1920 public string Response { get ; private set ; } = string . Empty ;
2021 public double Cost { get ; private set ; }
2122 public List < ChatMessageSegment > Segments { get ; private set ; } = new List < ChatMessageSegment > ( ) ;
22-
23- public string FullText => string . Join ( " " , Segments . Where ( s => s . HasText ) . Select ( s => s . Text ) ) ;
24- public bool HasAudio => Segments . Any ( s => s . HasAudio ) ;
25- public bool HasText => Segments . Any ( s => s . HasText ) ;
26-
2723
2824 public ChatProcessContext ( ChatRequestCommand command )
2925 {
@@ -32,6 +28,7 @@ public ChatProcessContext(ChatRequestCommand command)
3228 UserMessage = command . UserPrompt ;
3329 MemoryStore = command . UserId . ToString ( ) ;
3430 UseTTS = command . UseTTS ;
31+ UserRequestAt = command . UserRequestAt ;
3532 }
3633
3734 public ChatProcessContext (
@@ -67,9 +64,7 @@ public IEnumerable<string> ParseConversationHistory(int count = 5)
6764 {
6865 if ( ConversationHistory == null ) return Enumerable . Empty < string > ( ) ;
6966
70- return ConversationHistory
71- . Take ( count )
72- . Select ( h => $ "{ h . Role } : { h . Content } ") ;
67+ return ConversationHistory . Take ( count ) . Select ( h => $ "{ h . Role } : { h . Content } ") ;
7368 }
7469 }
7570}
0 commit comments