Tachi67 commited on
Commit
531832b
·
1 Parent(s): e75262a

Update Controller_JarvisFlow.py

Browse files
Files changed (1) hide show
  1. Controller_JarvisFlow.py +8 -0
Controller_JarvisFlow.py CHANGED
@@ -100,6 +100,14 @@ class Controller_JarvisFlow(ChatAtomicFlow):
100
 
101
  def run(self, input_data: Dict[str, Any]) -> Dict[str, Any]:
102
  self._update_prompts_and_input(input_data)
 
 
 
 
 
 
 
 
103
  api_output = super().run(input_data)["api_output"].strip()
104
  try:
105
  response = json.loads(api_output)
 
100
 
101
  def run(self, input_data: Dict[str, Any]) -> Dict[str, Any]:
102
  self._update_prompts_and_input(input_data)
103
+
104
+ # ~~~when conversation is initialized, append the updated system prompts to the chat history ~~~
105
+ if self._is_conversation_initialized():
106
+ updated_system_message_content = self._get_message(self.system_message_prompt_template, input_data)
107
+ self._state_update_add_chat_message(content=updated_system_message_content,
108
+ role=self.flow_config["system_name"])
109
+
110
+
111
  api_output = super().run(input_data)["api_output"].strip()
112
  try:
113
  response = json.loads(api_output)