renamed flows to aiflows
Browse files- HumanStandardInputFlow.py +8 -8
- README.md +2 -2
- demo.yaml +3 -3
- run.py +5 -5
HumanStandardInputFlow.py
CHANGED
|
@@ -2,15 +2,15 @@ from copy import deepcopy
|
|
| 2 |
from typing import Dict, Any
|
| 3 |
|
| 4 |
import hydra
|
| 5 |
-
from
|
| 6 |
|
| 7 |
-
from
|
| 8 |
-
from
|
| 9 |
|
| 10 |
-
from
|
| 11 |
|
| 12 |
# logging.set_verbosity_debug() # ToDo: Has no effect on the logger for __name__. Level is warn, and info is not printed
|
| 13 |
-
log = logging.get_logger(f"
|
| 14 |
|
| 15 |
|
| 16 |
class HumanStandardInputFlow(AtomicFlow):
|
|
@@ -29,9 +29,9 @@ class HumanStandardInputFlow(AtomicFlow):
|
|
| 29 |
- `end_of_input_string` (str): The string that the user/human should enter to indicate that the input is finished.
|
| 30 |
This parameter is only used if "request_multi_line_input_flag" is True. Default: "EOI"
|
| 31 |
|
| 32 |
-
- `query_message_prompt_template` (JinjaPrompt): The prompt template used to generate the query message. By default its of type
|
| 33 |
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
|
| 34 |
-
|
| 35 |
|
| 36 |
- The other parameters are inherited from the default configuration of AtomicFlow (see AtomicFlow)
|
| 37 |
|
|
@@ -56,7 +56,7 @@ class HumanStandardInputFlow(AtomicFlow):
|
|
| 56 |
"end_of_input_string": "EOI",
|
| 57 |
"description": "Reads input from the user's standard input.",
|
| 58 |
"query_message_prompt_template": {
|
| 59 |
-
"_target_": "
|
| 60 |
"template": "",
|
| 61 |
"input_variables": [],
|
| 62 |
"partial_variables": {},
|
|
|
|
| 2 |
from typing import Dict, Any
|
| 3 |
|
| 4 |
import hydra
|
| 5 |
+
from aiflows.prompt_template import JinjaPrompt
|
| 6 |
|
| 7 |
+
from aiflows.base_flows import AtomicFlow
|
| 8 |
+
from aiflows.messages import UpdateMessage_Generic
|
| 9 |
|
| 10 |
+
from aiflows.utils import logging
|
| 11 |
|
| 12 |
# logging.set_verbosity_debug() # ToDo: Has no effect on the logger for __name__. Level is warn, and info is not printed
|
| 13 |
+
log = logging.get_logger(f"aiflows.{__name__}") # ToDo: Is there a better fix?
|
| 14 |
|
| 15 |
|
| 16 |
class HumanStandardInputFlow(AtomicFlow):
|
|
|
|
| 29 |
- `end_of_input_string` (str): The string that the user/human should enter to indicate that the input is finished.
|
| 30 |
This parameter is only used if "request_multi_line_input_flag" is True. Default: "EOI"
|
| 31 |
|
| 32 |
+
- `query_message_prompt_template` (JinjaPrompt): The prompt template used to generate the query message. By default its of type aiflows.prompt_template.JinjaPrompt.
|
| 33 |
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
|
| 34 |
+
aiflows.prompt_template.jinja2_prompts.JinjaPrompt.
|
| 35 |
|
| 36 |
- The other parameters are inherited from the default configuration of AtomicFlow (see AtomicFlow)
|
| 37 |
|
|
|
|
| 56 |
"end_of_input_string": "EOI",
|
| 57 |
"description": "Reads input from the user's standard input.",
|
| 58 |
"query_message_prompt_template": {
|
| 59 |
+
"_target_": "aiflows.prompt_template.JinjaPrompt",
|
| 60 |
"template": "",
|
| 61 |
"input_variables": [],
|
| 62 |
"partial_variables": {},
|
README.md
CHANGED
|
@@ -36,9 +36,9 @@ If False, the user/human is requested to enter a single-line input. Default: No
|
|
| 36 |
- `end_of_input_string` (str): The string that the user/human should enter to indicate that the input is finished.
|
| 37 |
This parameter is only used if "request_multi_line_input_flag" is True. Default: "EOI"
|
| 38 |
|
| 39 |
-
- `query_message_prompt_template` (JinjaPrompt): The prompt template used to generate the query message. By default its of type
|
| 40 |
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
|
| 41 |
-
|
| 42 |
|
| 43 |
- The other parameters are inherited from the default configuration of AtomicFlow (see AtomicFlow)
|
| 44 |
|
|
|
|
| 36 |
- `end_of_input_string` (str): The string that the user/human should enter to indicate that the input is finished.
|
| 37 |
This parameter is only used if "request_multi_line_input_flag" is True. Default: "EOI"
|
| 38 |
|
| 39 |
+
- `query_message_prompt_template` (JinjaPrompt): The prompt template used to generate the query message. By default its of type aiflows.prompt_template.JinjaPrompt.
|
| 40 |
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
|
| 41 |
+
aiflows.prompt_template.jinja2_prompts.JinjaPrompt.
|
| 42 |
|
| 43 |
- The other parameters are inherited from the default configuration of AtomicFlow (see AtomicFlow)
|
| 44 |
|
demo.yaml
CHANGED
|
@@ -1,13 +1,13 @@
|
|
| 1 |
input_interface:
|
| 2 |
-
_target_:
|
| 3 |
flow:
|
| 4 |
-
_target_: aiflows.HumanStandardInputFlowModule.HumanStandardInputFlow.instantiate_from_default_config
|
| 5 |
name: "HumanStandardInputFlow"
|
| 6 |
description: "A demo of the HumanStandardInputFlow."
|
| 7 |
request_multi_line_input_flag: True
|
| 8 |
end_of_input_string: EOI
|
| 9 |
query_message_prompt_template:
|
| 10 |
-
_target_:
|
| 11 |
template: |2-
|
| 12 |
Please enter your input.
|
| 13 |
|
|
|
|
| 1 |
input_interface:
|
| 2 |
+
_target_: aiflows.interfaces.KeyInterface
|
| 3 |
flow:
|
| 4 |
+
_target_: flow_modules.aiflows.HumanStandardInputFlowModule.HumanStandardInputFlow.instantiate_from_default_config
|
| 5 |
name: "HumanStandardInputFlow"
|
| 6 |
description: "A demo of the HumanStandardInputFlow."
|
| 7 |
request_multi_line_input_flag: True
|
| 8 |
end_of_input_string: EOI
|
| 9 |
query_message_prompt_template:
|
| 10 |
+
_target_: aiflows.prompt_template.JinjaPrompt
|
| 11 |
template: |2-
|
| 12 |
Please enter your input.
|
| 13 |
|
run.py
CHANGED
|
@@ -3,11 +3,11 @@ import os
|
|
| 3 |
import hydra
|
| 4 |
|
| 5 |
|
| 6 |
-
from
|
| 7 |
-
from
|
| 8 |
|
| 9 |
-
from
|
| 10 |
-
from
|
| 11 |
|
| 12 |
CACHING_PARAMETERS.do_caching = False # Set to True to enable caching
|
| 13 |
# clear_cache() # Uncomment this line to clear the cache
|
|
@@ -17,7 +17,7 @@ logging.set_verbosity_debug()
|
|
| 17 |
dependencies = [
|
| 18 |
{"url": "aiflows/HumanStandardInputFlowModule", "revision": os.getcwd()},
|
| 19 |
]
|
| 20 |
-
from
|
| 21 |
flow_verse.sync_dependencies(dependencies)
|
| 22 |
|
| 23 |
if __name__ == "__main__":
|
|
|
|
| 3 |
import hydra
|
| 4 |
|
| 5 |
|
| 6 |
+
from aiflows.flow_launchers import FlowLauncher
|
| 7 |
+
from aiflows.utils.general_helpers import read_yaml_file
|
| 8 |
|
| 9 |
+
from aiflows import logging
|
| 10 |
+
from aiflows.flow_cache import CACHING_PARAMETERS
|
| 11 |
|
| 12 |
CACHING_PARAMETERS.do_caching = False # Set to True to enable caching
|
| 13 |
# clear_cache() # Uncomment this line to clear the cache
|
|
|
|
| 17 |
dependencies = [
|
| 18 |
{"url": "aiflows/HumanStandardInputFlowModule", "revision": os.getcwd()},
|
| 19 |
]
|
| 20 |
+
from aiflows import flow_verse
|
| 21 |
flow_verse.sync_dependencies(dependencies)
|
| 22 |
|
| 23 |
if __name__ == "__main__":
|