Proper Doc
Browse files123445678910 unmodified lines202122232324252627282930313233343536373892 unmodified lines13113213312213413513613713813914012913013113213314114214314440 unmodified lines18518618718018818919019119219319418718818919019119519619719828 unmodified lines22722822922623023123223356 unmodified lines29029129228929329429529653 unmodified lines350351352349353354355356357358359360361362351363364365366367354355356357368369370360371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414364365415416367417418419420421422423424425426427428369429430---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) * [detect\_finish\_or\_continue](#ControllerExecutorFlow.ControllerExecutorFlow.detect_finish_or_continue) * [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>
# run
A 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_data: Dict[str, Any]) -> Dict[str, Any]def 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_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)- `input_message` (`FlowMessage`): The input data of the flow.
<a id="__init__"></a>
40 unmodified lines#### run
```pythondef run(input_data: Dict[str, Any]) -> Dict[str, Any]def run(input_message: FlowMessage)```
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- `input_message` (`FlowMessage`): The input message
<a id="wikipediaAPI"></a>
28 unmodified lines#### validate\_environment
```python@root_validator()@root_validator(pre=True)def validate_environment(cls, values: Dict) -> Dict```
56 unmodified lines## ControllerExecutorFlow Objects
```pythonclass ControllerExecutorFlow(CircularFlow)class 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.detect_finish_or_continue"></a><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.
#### detect\_finish\_or\_continue<a id="ControllerExecutorFlow.ControllerExecutorFlow.get_next_state"></a>
#### get\_next\_state
```python@CircularFlow.output_msg_payload_processordef detect_finish_or_continue( output_payload: Dict[str, Any], src_flow: ControllerAtomicFlow) -> Dict[str, Any]def get_next_state()```
This method is called when the ExecutorAtomicFlow receives a message from the ControllerAtomicFlow. It checks if the flow should finish or continue.
<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**:
- `output_payload` (`Dict[str, Any]`): The output payload of the ControllerAtomicFlow.- `src_flow` (`ControllerAtomicFlow`): The ControllerAtomicFlow.- `input_message` (`FlowMessage`): The input message
**Returns**:<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**:
The output payload of the ControllerAtomicFlow.- `input_message` (`FlowMessage`): The input message
README.md+87-27