Tachi67 commited on
Commit
8479bee
·
1 Parent(s): bf3ac04

Update ControllerFlow_ExtLib.py

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