Proper Doc
Browse files12345678910 unmodified lines2021222324252692 unmodified lines11912012112212312412512612712812913013113213313413513640 unmodified lines17717817918018118218318418518618718818919019119219319428 unmodified lines22322422522622722822956 unmodified lines28628728828929029129253 unmodified lines346347348349350351352353354355356357358359360361362363364365366367368369370---license: mit---# Table of Contents* [ControllerAtomicFlow](#ControllerAtomicFlow)* [Command](#ControllerAtomicFlow.Command)* [ControllerAtomicFlow](#ControllerAtomicFlow.ControllerAtomicFlow)10 unmodified lines* [search\_page\_titles](#wikipediaAPI.WikipediaAPIWrapper.search_page_titles)* [ControllerExecutorFlow](#ControllerExecutorFlow)* [ControllerExecutorFlow](#ControllerExecutorFlow.ControllerExecutorFlow)* [detect\_finish\_or\_continue](#ControllerExecutorFlow.ControllerExecutorFlow.detect_finish_or_continue)<a id="ControllerAtomicFlow"></a>92 unmodified lines#### run```pythondef run(input_data: Dict[str, Any]) -> Dict[str, Any]```This method runs the flow. Note that the response of the LLM is in the JSON format, but it's not a hard constraint (it can hallucinate and return an invalid JSON)**Arguments**:- `input_data` (`Dict[str, Any]`): The input data of the flow.**Returns**:`Dict[str, Any]`: The output data of the flow (thought, reasoning, criticism, command, command_args)<a id="__init__"></a>40 unmodified lines#### run```pythondef run(input_data: Dict[str, Any]) -> Dict[str, Any]```Runs the WikiSearch Atomic Flow. It's used to execute a Wikipedia search and get page summaries.**Arguments**:- `input_data` (`Dict[str, Any]`): The input data dictionary**Returns**:`Dict[str, Any]`: The output data dictionary<a id="wikipediaAPI"></a>28 unmodified lines#### validate\_environment```python@root_validator()def validate_environment(cls, values: Dict) -> Dict```56 unmodified lines## ControllerExecutorFlow Objects```pythonclass ControllerExecutorFlow(CircularFlow)```This class implements a ControllerExecutorFlow. It's composed of a ControllerAtomicFlow and an ExecutorFlow.53 unmodified lines- `flow_config`: The configuration of the flow (see Configuration Parameters).- `subflows`: A list of subflows. Required when instantiating the subflow programmatically (it replaces subflows_config from flow_config).<a id="ControllerExecutorFlow.ControllerExecutorFlow.detect_finish_or_continue"></a>#### detect\_finish\_or\_continue```python@CircularFlow.output_msg_payload_processordef detect_finish_or_continue(output_payload: Dict[str, Any],src_flow: ControllerAtomicFlow) -> Dict[str, Any]```This method is called when the ExecutorAtomicFlow receives a message from the ControllerAtomicFlow. It checks if the flow should finish or continue.**Arguments**:- `output_payload` (`Dict[str, Any]`): The output payload of the ControllerAtomicFlow.- `src_flow` (`ControllerAtomicFlow`): The ControllerAtomicFlow.**Returns**:The output payload of the ControllerAtomicFlow.12345678910 unmodified lines2021222324252627282930313233343536373892 unmodified lines13113213313413513613713813914014114214314440 unmodified lines18518618718818919019119219319419519619719828 unmodified lines22722822923023123223356 unmodified lines29029129229329429529653 unmodified lines350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430---license: mit---# Table of Contents* [run](#run)* [ControllerAtomicFlow](#ControllerAtomicFlow)* [Command](#ControllerAtomicFlow.Command)* [ControllerAtomicFlow](#ControllerAtomicFlow.ControllerAtomicFlow)10 unmodified lines* [search\_page\_titles](#wikipediaAPI.WikipediaAPIWrapper.search_page_titles)* [ControllerExecutorFlow](#ControllerExecutorFlow)* [ControllerExecutorFlow](#ControllerExecutorFlow.ControllerExecutorFlow)* [generate\_reply](#ControllerExecutorFlow.ControllerExecutorFlow.generate_reply)* [get\_next\_state](#ControllerExecutorFlow.ControllerExecutorFlow.get_next_state)* [set\_up\_flow\_state](#ControllerExecutorFlow.ControllerExecutorFlow.set_up_flow_state)* [call\_controller](#ControllerExecutorFlow.ControllerExecutorFlow.call_controller)* [call\_executor](#ControllerExecutorFlow.ControllerExecutorFlow.call_executor)* [register\_data\_to\_state](#ControllerExecutorFlow.ControllerExecutorFlow.register_data_to_state)* [run](#ControllerExecutorFlow.ControllerExecutorFlow.run)<a id="run"></a># runA simple script to run a Flow that can be used for development and debugging.<a id="ControllerAtomicFlow"></a>92 unmodified lines#### run```pythondef run(input_message: FlowMessage)```This method runs the flow. Note that the response of the LLM is in the JSON format, but it's not a hard constraint (it can hallucinate and return an invalid JSON)**Arguments**:- `input_message` (`FlowMessage`): The input data of the flow.<a id="__init__"></a>40 unmodified lines#### run```pythondef run(input_message: FlowMessage)```Runs the WikiSearch Atomic Flow. It's used to execute a Wikipedia search and get page summaries.**Arguments**:- `input_message` (`FlowMessage`): The input message<a id="wikipediaAPI"></a>28 unmodified lines#### validate\_environment```python@root_validator(pre=True)def validate_environment(cls, values: Dict) -> Dict```56 unmodified lines## ControllerExecutorFlow Objects```pythonclass ControllerExecutorFlow(CompositeFlow)```This class implements a ControllerExecutorFlow. It's composed of a ControllerAtomicFlow and an ExecutorFlow.53 unmodified lines- `flow_config`: The configuration of the flow (see Configuration Parameters).- `subflows`: A list of subflows. Required when instantiating the subflow programmatically (it replaces subflows_config from flow_config).<a id="ControllerExecutorFlow.ControllerExecutorFlow.generate_reply"></a>#### generate\_reply```pythondef generate_reply()```This method generates the reply of the flow. It's called when the flow is finished.<a id="ControllerExecutorFlow.ControllerExecutorFlow.get_next_state"></a>#### get\_next\_state```pythondef get_next_state()```<a id="ControllerExecutorFlow.ControllerExecutorFlow.set_up_flow_state"></a>#### set\_up\_flow\_state```pythondef set_up_flow_state()```Sets up the flow state.<a id="ControllerExecutorFlow.ControllerExecutorFlow.call_controller"></a>#### call\_controller```pythondef call_controller()```Calls the controller: the flow that decides which command to call next.<a id="ControllerExecutorFlow.ControllerExecutorFlow.call_executor"></a>#### call\_executor```pythondef call_executor()```Calls the flow that executes the command instructed by the ControllerAtomicFlow.<a id="ControllerExecutorFlow.ControllerExecutorFlow.register_data_to_state"></a>#### register\_data\_to\_state```pythondef register_data_to_state(input_message)```This method registers the input message data to the flow state. It's everytime a new input message is received.**Arguments**:- `input_message` (`FlowMessage`): The input message<a id="ControllerExecutorFlow.ControllerExecutorFlow.run"></a>#### run```pythondef run(input_message: FlowMessage)```Runs the WikiSearch Atomic Flow. It's used to execute a Wikipedia search and get page summaries.**Arguments**:- `input_message` (`FlowMessage`): The input message
README.md+87-27