renamed flows to aiflows
Browse filesFiles changed (9)
33 unmodified lines343536373839404142434445464748495033 unmodified lines- `commands` (List[Dict[str,Any]]): A list of commands that the controller can call. Default: []- `finish` (Dict[str,Any]): The configuration of the finish command. Default parameters: No default parameters.- `system_message_prompt_template` (Dict[str, Any]): The prompt template used to generate the system message.By default, it's type is flows.prompt_template.JinjaPrompt. It's default parameters are:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["commands"]. Note that the commands are the commands of the executor(subflows of branching flow) and are actually to the system prompt template via the `_build_commands_manual` function of this class.- `human_message_prompt_template` (Dict[str, Any]): The prompt template of the human/user message (message used everytime the except the first time in).It's passed as the user message to the LLM. By default its of type flows.prompt_template.JinjaPrompt and has the following parameters:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["observation"]- init_human_message_prompt_template` (Dict[str, Any]): The prompt template of the human/user message used to initialize the conversation(first time in). It is used to generate the human message. It's passed as the user message to the LLM.By default its of type flows.prompt_template.JinjaPrompt and has the following parameters:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["goal"]- All other parameters are inherited from the default configuration of ChatAtomicFlow (see Flowcard, i.e. README.md, of ChatAtomicFlowModule).33 unmodified lines343536373839404142434445464748495033 unmodified lines- `commands` (List[Dict[str,Any]]): A list of commands that the controller can call. Default: []- `finish` (Dict[str,Any]): The configuration of the finish command. Default parameters: No default parameters.- `system_message_prompt_template` (Dict[str, Any]): The prompt template used to generate the system message.By default, it's type is aiflows.prompt_template.JinjaPrompt. It's default parameters are:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["commands"]. Note that the commands are the commands of the executor(subflows of branching flow) and are actually to the system prompt template via the `_build_commands_manual` function of this class.- `human_message_prompt_template` (Dict[str, Any]): The prompt template of the human/user message (message used everytime the except the first time in).It's passed as the user message to the LLM. By default its of type aiflows.prompt_template.JinjaPrompt and has the following parameters:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["observation"]- init_human_message_prompt_template` (Dict[str, Any]): The prompt template of the human/user message used to initialize the conversation(first time in). It is used to generate the human message. It's passed as the user message to the LLM.By default its of type aiflows.prompt_template.JinjaPrompt and has the following parameters:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["goal"]- All other parameters are inherited from the default configuration of ChatAtomicFlow (see Flowcard, i.e. README.md, of ChatAtomicFlowModule).
27 unmodified lines2829303132333434 unmodified lines697071727374751 unmodified line7778798081828327 unmodified lines######################################################## ToDo: Some parts of the prompt don't make sense -- update themsystem_message_prompt_template:_target_: flows.prompt_template.JinjaPrompttemplate: |2-You are a smart AI assistant.34 unmodified linesinput_variables: ["commands"]human_message_prompt_template:_target_: flows.prompt_template.JinjaPrompttemplate: |2-Here is the response to your last action:{{observation}}1 unmodified line- "observation"init_human_message_prompt_template:_target_: flows.prompt_template.JinjaPrompttemplate: |2-Here is the goal you need to achieve:{{goal}}27 unmodified lines2829303132333434 unmodified lines697071727374751 unmodified line7778798081828327 unmodified lines######################################################## ToDo: Some parts of the prompt don't make sense -- update themsystem_message_prompt_template:_target_: aiflows.prompt_template.JinjaPrompttemplate: |2-You are a smart AI assistant.34 unmodified linesinput_variables: ["commands"]human_message_prompt_template:_target_: aiflows.prompt_template.JinjaPrompttemplate: |2-Here is the response to your last action:{{observation}}1 unmodified line- "observation"init_human_message_prompt_template:_target_: aiflows.prompt_template.JinjaPrompttemplate: |2-Here is the goal you need to achieve:{{goal}}
1234567from typing import Dict, Anyfrom flows.base_flows import CircularFlowfrom flows.utils import loggingfrom .ControllerAtomicFlow import ControllerAtomicFlow1234567from typing import Dict, Anyfrom aiflows.base_flows import CircularFlowfrom aiflows.utils import loggingfrom .ControllerAtomicFlow import ControllerAtomicFlow
11 unmodified lines121314151617185 unmodified lines242526272829305 unmodified lines3637383940414243441 unmodified line464748495051525354555657585911 unmodified lines### Subflows specificationsubflows_config:Controller:_target_: aiflows.ControllerAtomicFlow.instantiate_from_default_configfinish:description: "Signal that the objective has been satisfied, and returns the answer to the user."input_args: ["answer"]5 unmodified linesExecutor:_target_: flows.base_flows.BranchingFlow.instantiate_from_default_config# E.g.,# subflows_config:# wiki_search:5 unmodified linestopology:- goal: "Select the next action and prepare the input for the executor."input_interface:_target_: flows.interfaces.KeyInterfaceadditional_transformations:- _target_: flows.data_transformations.KeyMatchInputflow: Controlleroutput_interface:_target_: ControllerExecutorFlow.detect_finish_or_continue1 unmodified line- goal: "Execute the action specified by the Controller."input_interface:_target_: flows.interfaces.KeyInterfacekeys_to_rename:command: branchcommand_args: branch_input_datakeys_to_select: ["branch", "branch_input_data"]flow: Executoroutput_interface:_target_: flows.interfaces.KeyInterfacekeys_to_rename:branch_output_data: observationkeys_to_select: ["observation"]11 unmodified lines121314151617185 unmodified lines242526272829305 unmodified lines3637383940414243441 unmodified line464748495051525354555657585911 unmodified lines### Subflows specificationsubflows_config:Controller:_target_: flow_modules.aiflows.ControllerAtomicFlow.instantiate_from_default_configfinish:description: "Signal that the objective has been satisfied, and returns the answer to the user."input_args: ["answer"]5 unmodified linesExecutor:_target_: aiflows.base_flows.BranchingFlow.instantiate_from_default_config# E.g.,# subflows_config:# wiki_search:5 unmodified linestopology:- goal: "Select the next action and prepare the input for the executor."input_interface:_target_: aiflows.interfaces.KeyInterfaceadditional_transformations:- _target_: aiflows.data_transformations.KeyMatchInputflow: Controlleroutput_interface:_target_: ControllerExecutorFlow.detect_finish_or_continue1 unmodified line- goal: "Execute the action specified by the Controller."input_interface:_target_: aiflows.interfaces.KeyInterfacekeys_to_rename:command: branchcommand_args: branch_input_datakeys_to_select: ["branch", "branch_input_data"]flow: Executoroutput_interface:_target_: aiflows.interfaces.KeyInterfacekeys_to_rename:branch_output_data: observationkeys_to_select: ["observation"]
61 unmodified lines626364656667686970717273747576777861 unmodified lines- `commands` (List[Dict[str,Any]]): A list of commands that the controller can call. Default: []- `finish` (Dict[str,Any]): The configuration of the finish command. Default parameters: No default parameters.- `system_message_prompt_template` (Dict[str, Any]): The prompt template used to generate the system message.By default, it's type is flows.prompt_template.JinjaPrompt. It's default parameters are:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["commands"]. Note that the commands are the commands of the executor(subflows of branching flow) and are actually to the system prompt template via the `_build_commands_manual` function of this class.- `human_message_prompt_template` (Dict[str, Any]): The prompt template of the human/user message (message used everytime the except the first time in).It's passed as the user message to the LLM. By default its of type flows.prompt_template.JinjaPrompt and has the following parameters:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["observation"]- init_human_message_prompt_template` (Dict[str, Any]): The prompt template of the human/user message used to initialize the conversation(first time in). It is used to generate the human message. It's passed as the user message to the LLM.By default its of type flows.prompt_template.JinjaPrompt and has the following parameters:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["goal"]- All other parameters are inherited from the default configuration of ChatAtomicFlow (see Flowcard, i.e. README.md, of ChatAtomicFlowModule).61 unmodified lines626364656667686970717273747576777861 unmodified lines- `commands` (List[Dict[str,Any]]): A list of commands that the controller can call. Default: []- `finish` (Dict[str,Any]): The configuration of the finish command. Default parameters: No default parameters.- `system_message_prompt_template` (Dict[str, Any]): The prompt template used to generate the system message.By default, it's type is aiflows.prompt_template.JinjaPrompt. It's default parameters are:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["commands"]. Note that the commands are the commands of the executor(subflows of branching flow) and are actually to the system prompt template via the `_build_commands_manual` function of this class.- `human_message_prompt_template` (Dict[str, Any]): The prompt template of the human/user message (message used everytime the except the first time in).It's passed as the user message to the LLM. By default its of type aiflows.prompt_template.JinjaPrompt and has the following parameters:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["observation"]- init_human_message_prompt_template` (Dict[str, Any]): The prompt template of the human/user message used to initialize the conversation(first time in). It is used to generate the human message. It's passed as the user message to the LLM.By default its of type aiflows.prompt_template.JinjaPrompt and has the following parameters:- `template` (str): The template of the prompt. Default: see ControllerAtomicFlow.yaml for the default template.- `input_variables` (List[str]): The input variables of the prompt. Default: ["goal"]- All other parameters are inherited from the default configuration of ChatAtomicFlow (see Flowcard, i.e. README.md, of ChatAtomicFlowModule).
1 unmodified line23456789101 unmodified linefrom typing import List, Dict, Optional, Anyfrom flows.base_flows import AtomicFlowfrom flows.utils import loggingfrom .wikipediaAPI import WikipediaAPIWrapperlog = logging.get_logger(__name__)1 unmodified line23456789101 unmodified linefrom typing import List, Dict, Optional, Anyfrom aiflows.base_flows import AtomicFlowfrom aiflows.utils import loggingfrom .wikipediaAPI import WikipediaAPIWrapperlog = logging.get_logger(__name__)
1 unmodified line23456781 unmodified linedependencies = [{"url": "aiflows/ChatFlowModule", "revision": "main"},]from flows import flow_verseflow_verse.sync_dependencies(dependencies)# ~~~1 unmodified line23456781 unmodified linedependencies = [{"url": "aiflows/ChatFlowModule", "revision": "main"},]from aiflows import flow_verseflow_verse.sync_dependencies(dependencies)# ~~~
12345678910112 unmodified lines1415161718192021222324252627flow:_target_: aiflows.ControllerExecutorFlowModule.ControllerExecutorFlow.instantiate_from_default_configmax_rounds: 30### Subflows specificationsubflows_config:Controller:_target_: aiflows.ControllerExecutorFlowModule.ControllerAtomicFlow.instantiate_from_default_configcommands:wiki_search:description: "Performs a search on Wikipedia."2 unmodified linesdescription: "Signal that the objective has been satisfied, and returns the answer to the user."input_args: [ "answer" ]backend:_target_: flows.backends.llm_lite.LiteLLMBackendapi_infos: ???model_name:openai: "gpt-3.5-turbo"azure: "azure/gpt-4"Executor:_target_: flows.base_flows.BranchingFlow.instantiate_from_default_configsubflows_config:wiki_search:_target_: aiflows.ControllerExecutorFlowModule.WikiSearchAtomicFlow.instantiate_from_default_config12345678910112 unmodified lines1415161718192021222324252627flow:_target_: flow_modules.aiflows.ControllerExecutorFlowModule.ControllerExecutorFlow.instantiate_from_default_configmax_rounds: 30### Subflows specificationsubflows_config:Controller:_target_: flow_modules.aiflows.ControllerExecutorFlowModule.ControllerAtomicFlow.instantiate_from_default_configcommands:wiki_search:description: "Performs a search on Wikipedia."2 unmodified linesdescription: "Signal that the objective has been satisfied, and returns the answer to the user."input_args: [ "answer" ]backend:_target_: aiflows.backends.llm_lite.LiteLLMBackendapi_infos: ???model_name:openai: "gpt-3.5-turbo"azure: "azure/gpt-4"Executor:_target_: aiflows.base_flows.BranchingFlow.instantiate_from_default_configsubflows_config:wiki_search:_target_: flow_modules.aiflows.ControllerExecutorFlowModule.WikiSearchAtomicFlow.instantiate_from_default_config
1 unmodified line2345678910111213143 unmodified lines181920212223241 unmodified lineimport hydraimport flowsfrom flows.flow_launchers import FlowLauncherfrom flows.backends.api_info import ApiInfofrom flows.utils.general_helpers import read_yaml_filefrom flows import loggingfrom flows.flow_cache import CACHING_PARAMETERS, clear_cacheCACHING_PARAMETERS.do_caching = False # Set to True in order to disable caching# clear_cache() # Uncomment this line to clear the cache3 unmodified linesdependencies = [{"url": "aiflows/ControllerExecutorFlowModule", "revision": os.getcwd()},]from flows import flow_verseflow_verse.sync_dependencies(dependencies)1 unmodified line2345678910111213143 unmodified lines181920212223241 unmodified lineimport hydraimport aiflowsfrom aiflows.flow_launchers import FlowLauncherfrom aiflows.backends.api_info import ApiInfofrom aiflows.utils.general_helpers import read_yaml_filefrom aiflows import loggingfrom aiflows.flow_cache import CACHING_PARAMETERS, clear_cacheCACHING_PARAMETERS.do_caching = False # Set to True in order to disable caching# clear_cache() # Uncomment this line to clear the cache3 unmodified linesdependencies = [{"url": "aiflows/ControllerExecutorFlowModule", "revision": os.getcwd()},]from aiflows import flow_verseflow_verse.sync_dependencies(dependencies)
ControllerAtomicFlow.py+3-3
ControllerAtomicFlow.yaml+3-3
ControllerExecutorFlow.py+2-2
ControllerExecutorFlow.yaml+6-6
README.md+3-3
WikiSearchAtomicFlow.py+2-2
__init__.py+1-1
demo.yaml+5-5
run.py+7-7