File size: 3,378 Bytes
bf61a22
 
 
5683a92
8cb7e14
5683a92
535564d
5683a92
 
 
8cb7e14
5683a92
8cb7e14
5683a92
8cb7e14
535564d
 
 
 
 
 
5683a92
8cb7e14
5683a92
8cb7e14
5683a92
 
 
8cb7e14
5683a92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4ff0435
5683a92
4ff0435
5683a92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535564d
5683a92
 
 
 
 
 
535564d
8cb7e14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
license: mit
---
# Table of Contents

* [HumanStandardInputFlow](#HumanStandardInputFlow)
  * [log](#HumanStandardInputFlow.log)
  * [HumanStandardInputFlow](#HumanStandardInputFlow.HumanStandardInputFlow)
    * [instantiate\_from\_config](#HumanStandardInputFlow.HumanStandardInputFlow.instantiate_from_config)
    * [run](#HumanStandardInputFlow.HumanStandardInputFlow.run)

<a id="HumanStandardInputFlow"></a>

# HumanStandardInputFlow

<a id="HumanStandardInputFlow.log"></a>

#### log

ToDo: Is there a better fix?

<a id="HumanStandardInputFlow.HumanStandardInputFlow"></a>

## HumanStandardInputFlow Objects

```python
class HumanStandardInputFlow(AtomicFlow)
```

This class implements a HumanStandardInputFlow. It's used to read input from the user/human. Typically used to get feedback from the user/human.

*Configuration Parameters*:

- `name` (str): The name of the flow.

- `description` (str): A description of the flow. This description is used to generate the help message of the flow.
Default: "Reads input from the user's standard input."

- `request_multi_line_input_flag` (bool): If True, the user/human is requested to enter a multi-line input.
If False, the user/human is requested to enter a single-line input. Default: No defaul, this parameter is required.

- `end_of_input_string` (str): The string that the user/human should enter to indicate that the input is finished.
This parameter is only used if "request_multi_line_input_flag" is True. Default: "EOI"

- `query_message_prompt_template` (JinjaPrompt): The prompt template used to generate the query message. By default its of type aiflows.prompt_template.JinjaPrompt.
None of the parameters of the prompt are defined by default and therefore need to be defined if one wants to use the init_human_message_prompt_template. Default parameters are defined in
aiflows.prompt_template.jinja2_prompts.JinjaPrompt.

- The other parameters are inherited from the default configuration of AtomicFlow (see AtomicFlow)

*input_interface*:

- No Input Interface. By default, the input interface expects no input. But if inputs are expected from the query_message_prompt_template,then the input interface should contain the keys specified in the input_variables of the query_message_prompt_template.

*output_interface*:

- `human_input` (str): The message inputed from the user/human.

**Arguments**:

- `query_message_prompt_template` (`JinjaPrompt`): The prompt template used to generate the query message. Expected if the class is instantiated programmatically.
- `\**kwargs` (`Dict[str, Any]`): The keyword arguments passed to the AtomicFlow constructor. Use to create the flow_config. Includes request_multi_line_input_flag, end_of_input_string, input_keys, description of Configuration Parameters.

<a id="HumanStandardInputFlow.HumanStandardInputFlow.instantiate_from_config"></a>

#### instantiate\_from\_config

```python
@classmethod
def instantiate_from_config(cls, config)
```

Instantiates the flow from a config file.

**Arguments**:

- `config` (`Dict[str, Any]`): The configuration of the flow.

<a id="HumanStandardInputFlow.HumanStandardInputFlow.run"></a>

#### run

```python
def run(input_message: FlowMessage)
```

Runs the HumanStandardInputFlow. It's used to read input from the user/human's standard input.

**Arguments**:

- `input_message` (`FlowMessage`): The input message