Tachi67 commited on
Commit
9bd62d1
·
1 Parent(s): 90e1389

Update Controller_CoderFlow.py

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