Update PlanWriterCtrlFlow.py
Browse files- PlanWriterCtrlFlow.py +7 -0
PlanWriterCtrlFlow.py
CHANGED
|
@@ -73,6 +73,13 @@ class PlanWriterCtrlFlow(ChatAtomicFlow):
|
|
| 73 |
|
| 74 |
def run(self, input_data: Dict[str, Any]) -> Dict[str, Any]:
|
| 75 |
self._update_prompts_and_input(input_data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
api_output = super().run(input_data)["api_output"].strip()
|
| 77 |
try:
|
| 78 |
response = json.loads(api_output)
|
|
|
|
| 73 |
|
| 74 |
def run(self, input_data: Dict[str, Any]) -> Dict[str, Any]:
|
| 75 |
self._update_prompts_and_input(input_data)
|
| 76 |
+
|
| 77 |
+
# ~~~when conversation is initialized, append the updated system prompts to the chat history ~~~
|
| 78 |
+
if self._is_conversation_initialized():
|
| 79 |
+
updated_system_message_content = self._get_message(self.system_message_prompt_template, input_data)
|
| 80 |
+
self._state_update_add_chat_message(content=updated_system_message_content,
|
| 81 |
+
role=self.flow_config["system_name"])
|
| 82 |
+
|
| 83 |
api_output = super().run(input_data)["api_output"].strip()
|
| 84 |
try:
|
| 85 |
response = json.loads(api_output)
|