|
Download README.md from aiflows/ChatInteractiveFlowModule: direct link, hf CLI and curl.
- Browser
- Download file 4.91 kB
-
https://huggingface.co/aiflows/ChatInteractiveFlowModule/resolve/main/README.md
- Command line
-
hf download hf://aiflows/ChatInteractiveFlowModule/README.md
-
curl -L -o README.md https://huggingface.co/aiflows/ChatInteractiveFlowModule/resolve/main/README.md
4.91 kB
| license: mit | |
| # Table of Contents | |
| * [ChatHumanFlowModule](#ChatHumanFlowModule) | |
| * [ChatHumanFlowModule](#ChatHumanFlowModule.ChatHumanFlowModule) | |
| * [set\_up\_flow\_state](#ChatHumanFlowModule.ChatHumanFlowModule.set_up_flow_state) | |
| * [type](#ChatHumanFlowModule.ChatHumanFlowModule.type) | |
| * [max\_rounds\_reached](#ChatHumanFlowModule.ChatHumanFlowModule.max_rounds_reached) | |
| * [generate\_reply](#ChatHumanFlowModule.ChatHumanFlowModule.generate_reply) | |
| * [call\_to\_user](#ChatHumanFlowModule.ChatHumanFlowModule.call_to_user) | |
| * [call\_to\_assistant](#ChatHumanFlowModule.ChatHumanFlowModule.call_to_assistant) | |
| * [run](#ChatHumanFlowModule.ChatHumanFlowModule.run) | |
| <a id="ChatHumanFlowModule"></a> | |
| # ChatHumanFlowModule | |
| <a id="ChatHumanFlowModule.ChatHumanFlowModule"></a> | |
| ## ChatHumanFlowModule Objects | |
| ```python | |
| class ChatHumanFlowModule(CompositeFlow) | |
| ``` | |
| This class implements a Chat Human Flow Module. It is a flow that consists of two sub-flows that are executed circularly. It Contains the following subflows: | |
| - A User Flow: A flow makes queries to the Assistant Flow. E.g. The user asks the assistant (LLM) a question. | |
| - A Assistant Flow: A flow that responds to queries made by the User Flow. E.g. The assistant (LLM) answers the user's question. | |
| To end the interaction, the user must type "\<END\>" | |
| An illustration of the flow is as follows: | |
| |------> User Flow -----------> | | |
| ^ | | |
| | | | |
| | v | |
| |<------ Assistant Flow <-------| | |
| *Configuration Parameters*: | |
| - `name` (str): The name of the flow. Default: "ChatHumanFlowModule" | |
| - `description` (str): A description of the flow. This description is used to generate the help message of the flow. | |
| Default: "Flow that enables chatting between a ChatAtomicFlow and a user providing the input." | |
| - `max_rounds` (int): The maximum number of rounds the flow can run for. Default: None, which means that there is no limit on the number of rounds. | |
| - `early_exit_key` (str): The key that is used to exit the flow. Default: "end_of_interaction" | |
| - `subflows_config` (Dict[str,Any]): A dictionary of subflows configurations. Default: | |
| - `Assistant Flow`: The configuration of the Assistant Flow. By default, it a ChatAtomicFlow. It default parmaters are defined in ChatAtomicFlowModule. | |
| - `User Flow`: The configuration of the User Flow. By default, it a HumanStandardInputFlow. It default parmaters are defined in HumanStandardInputFlowModule. | |
| - `topology` (str): (List[Dict[str,Any]]): The topology of the flow which is "circular". | |
| By default, the topology is the one shown in the illustration above (the topology is also described in ChatHumanFlowModule.yaml). | |
| *Input Interface*: | |
| - None. By default, the input interface doesn't expect any input. | |
| *Output Interface*: | |
| - `end_of_interaction` (bool): Whether the interaction is finished or not. | |
| **Arguments**: | |
| - `\**kwargs` (`Dict[str, Any]`): Arguments to be passed to the parent class CircularFlow constructor. | |
| <a id="ChatHumanFlowModule.ChatHumanFlowModule.set_up_flow_state"></a> | |
| #### set\_up\_flow\_state | |
| ```python | |
| def set_up_flow_state() | |
| ``` | |
| This method sets up the flow state. It is called when the flow is executed. | |
| <a id="ChatHumanFlowModule.ChatHumanFlowModule.type"></a> | |
| #### type | |
| ```python | |
| @classmethod | |
| def type(cls) | |
| ``` | |
| This method returns the type of the flow. | |
| <a id="ChatHumanFlowModule.ChatHumanFlowModule.max_rounds_reached"></a> | |
| #### max\_rounds\_reached | |
| ```python | |
| def max_rounds_reached() | |
| ``` | |
| This method checks if the maximum number of rounds has been reached. If the maximum number of rounds has been reached, it returns True. Otherwise, it returns False. | |
| <a id="ChatHumanFlowModule.ChatHumanFlowModule.generate_reply"></a> | |
| #### generate\_reply | |
| ```python | |
| def generate_reply() | |
| ``` | |
| This method generates the reply message. It is called when the interaction is finished. | |
| **Arguments**: | |
| - `input_message` (`FlowMessage`): The input message to the flow. | |
| <a id="ChatHumanFlowModule.ChatHumanFlowModule.call_to_user"></a> | |
| #### call\_to\_user | |
| ```python | |
| def call_to_user(input_message) | |
| ``` | |
| This method calls the User Flow. (Human) | |
| **Arguments**: | |
| - `input_message` (`FlowMessage`): The input message to the flow. | |
| <a id="ChatHumanFlowModule.ChatHumanFlowModule.call_to_assistant"></a> | |
| #### call\_to\_assistant | |
| ```python | |
| def call_to_assistant(input_message) | |
| ``` | |
| This method calls the Assistant Flow. | |
| **Arguments**: | |
| - `input_message` (`FlowMessage`): The input message to the flow. | |
| <a id="ChatHumanFlowModule.ChatHumanFlowModule.run"></a> | |
| #### run | |
| ```python | |
| def run(input_message: FlowMessage) | |
| ``` | |
| This method runs the flow. It is the main method of the flow and it is called when the flow is executed. | |
| **Arguments**: | |
| - `input_message` (`FlowMessage`): The input message to the flow. | |