changed naming of messaging methods
Browse filesFiles changed (4)
135 unmodified lines136137138139139140141142143144144145135 unmodified lines response = json.loads(api_output) reply = self._package_output_message( reply = self.package_output_message( input_message=input_message, response=response ) self.reply_to_message(reply = reply, to = input_message) self.send_message(reply, is_reply = True)88 unmodified lines8990919292939495969697989923 unmodified lines12312412512612612712812913013113113213313413513613713813913714014114214314414214514614714814915015188 unmodified lines def generate_reply(self): """ This method generates the reply of the flow. It's called when the flow is finished. """ reply = self._package_output_message( reply = self.package_output_message( input_message = self.flow_state["input_message"], response = self.reply_interface(self.flow_state) ) self.reply_to_message(reply,to=self.flow_state["input_message"]) self.send_message(reply,is_reply = True) def get_next_flow_to_call(self): 23 unmodified lines else: input_interface = self.input_interface_controller message = self._package_input_message( message = self.package_input_message( data = input_interface(self.flow_state), dst_flow = "Controller" ) self.subflows["Controller"].send_message_async(message, pipe_to= self.flow_config["flow_ref"]) self.subflows["Controller"].get_reply( message, self.get_instance_id(), ) def call_executor(self): #call executor executor_branch_to_call = self.flow_state["command"] message = self._package_input_message( message = self.package_input_message( data = self.flow_state["command_args"], dst_flow = executor_branch_to_call ) self.subflows[executor_branch_to_call].send_message_async(message, pipe_to= self.flow_config["flow_ref"]) self.subflows[executor_branch_to_call].get_reply( message, self.get_instance_id(), ) def register_data_to_state(self, input_message):68 unmodified lines697071727273747576777768 unmodified lines # Log the update to the flow messages list observation = search_response["wiki_content"] if search_response["wiki_content"] else search_response["relevant_pages"] reply = self._package_output_message( reply = self.package_output_message( input_message = input_message, response = {"wiki_content": observation}, ) self.reply_to_message(reply=reply, to=input_message) self.send_message(reply, is_reply = True)92 unmodified lines93949596969798999910010110292 unmodified lines )
#option2: use the proxy_flow #input_message = proxy_flow._package_input_message(data = data) #input_message = proxy_flow.package_input_message(data = data) #7. ~~~ Run inference ~~~ future = proxy_flow.send_message_blocking(input_message) future = proxy_flow.get_reply_future(input_message) #uncomment this line if you would like to get the full message back #reply_message = future.get_message()ControllerAtomicFlow.py+3-2
ControllerExecutorFlow.py+12-6
WikiSearchAtomicFlow.py+2-2
run.py+2-2