renamed flows to aiflows
Browse filesFiles changed (9)
33 unmodified lines343536373738394041424243444546474748495033 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: 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 flows.prompt_template.JinjaPrompt and has the following parameters: 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 flows.prompt_template.JinjaPrompt and has the following parameters: 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 lines282930313132333434 unmodified lines69707172727374751 unmodified line777879808081828327 unmodified lines######################################################## ToDo: Some parts of the prompt don't make sense -- update themsystem_message_prompt_template: _target_: flows.prompt_template.JinjaPrompt _target_: aiflows.prompt_template.JinjaPrompt template: |2- You are a smart AI assistant. 34 unmodified lines input_variables: ["commands"]
human_message_prompt_template: _target_: flows.prompt_template.JinjaPrompt _target_: aiflows.prompt_template.JinjaPrompt template: |2- Here is the response to your last action: {{observation}}1 unmodified line - "observation"
init_human_message_prompt_template: _target_: flows.prompt_template.JinjaPrompt _target_: aiflows.prompt_template.JinjaPrompt template: |2- Here is the goal you need to achieve: {{goal}}123434567from typing import Dict, Any
from flows.base_flows import CircularFlowfrom flows.utils import loggingfrom aiflows.base_flows import CircularFlowfrom aiflows.utils import logging
from .ControllerAtomicFlow import ControllerAtomicFlow
11 unmodified lines12131415151617185 unmodified lines24252627272829305 unmodified lines36373839394041414243441 unmodified line4647484949505152535455565657585911 unmodified lines### Subflows specificationsubflows_config: Controller: _target_: aiflows.ControllerAtomicFlow.instantiate_from_default_config _target_: flow_modules.aiflows.ControllerAtomicFlow.instantiate_from_default_config finish: description: "Signal that the objective has been satisfied, and returns the answer to the user." input_args: ["answer"]5 unmodified lines
Executor: _target_: flows.base_flows.BranchingFlow.instantiate_from_default_config _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_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface additional_transformations: - _target_: flows.data_transformations.KeyMatchInput - _target_: aiflows.data_transformations.KeyMatchInput flow: Controller output_interface: _target_: ControllerExecutorFlow.detect_finish_or_continue1 unmodified line
- goal: "Execute the action specified by the Controller." input_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_rename: command: branch command_args: branch_input_data keys_to_select: ["branch", "branch_input_data"] flow: Executor output_interface: _target_: flows.interfaces.KeyInterface _target_: aiflows.interfaces.KeyInterface keys_to_rename: branch_output_data: observation keys_to_select: ["observation"]61 unmodified lines626364656566676869707071727374757576777861 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: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 flows.prompt_template.JinjaPrompt and has the following parameters: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 flows.prompt_template.JinjaPrompt and has the following parameters: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 line2345567789101 unmodified line
from typing import List, Dict, Optional, Any
from flows.base_flows import AtomicFlowfrom aiflows.base_flows import AtomicFlow
from flows.utils import loggingfrom aiflows.utils import loggingfrom .wikipediaAPI import WikipediaAPIWrapper
log = logging.get_logger(__name__)1 unmodified line234556781 unmodified linedependencies = [ {"url": "aiflows/ChatFlowModule", "revision": "main"},]from flows import flow_versefrom aiflows import flow_verse
flow_verse.sync_dependencies(dependencies)# ~~~1223456788910112 unmodified lines1415161717181920212223242425262727flow: _target_: aiflows.ControllerExecutorFlowModule.ControllerExecutorFlow.instantiate_from_default_config _target_: flow_modules.aiflows.ControllerExecutorFlowModule.ControllerExecutorFlow.instantiate_from_default_config max_rounds: 30
### Subflows specification subflows_config: Controller: _target_: aiflows.ControllerExecutorFlowModule.ControllerAtomicFlow.instantiate_from_default_config _target_: flow_modules.aiflows.ControllerExecutorFlowModule.ControllerAtomicFlow.instantiate_from_default_config commands: wiki_search: description: "Performs a search on Wikipedia."2 unmodified lines description: "Signal that the objective has been satisfied, and returns the answer to the user." input_args: [ "answer" ] backend: _target_: flows.backends.llm_lite.LiteLLMBackend _target_: aiflows.backends.llm_lite.LiteLLMBackend api_infos: ??? model_name: openai: "gpt-3.5-turbo" azure: "azure/gpt-4"
Executor: _target_: flows.base_flows.BranchingFlow.instantiate_from_default_config _target_: aiflows.base_flows.BranchingFlow.instantiate_from_default_config subflows_config: wiki_search: _target_: aiflows.ControllerExecutorFlowModule.WikiSearchAtomicFlow.instantiate_from_default_config _target_: flow_modules.aiflows.ControllerExecutorFlowModule.WikiSearchAtomicFlow.instantiate_from_default_config1 unmodified line234567856789101110111213143 unmodified lines18192021212223241 unmodified line
import hydra
import flowsfrom flows.flow_launchers import FlowLauncherfrom flows.backends.api_info import ApiInfofrom flows.utils.general_helpers import read_yaml_fileimport aiflowsfrom aiflows.flow_launchers import FlowLauncherfrom aiflows.backends.api_info import ApiInfofrom aiflows.utils.general_helpers import read_yaml_file
from flows import loggingfrom flows.flow_cache import CACHING_PARAMETERS, clear_cachefrom aiflows import loggingfrom aiflows.flow_cache import CACHING_PARAMETERS, clear_cache
CACHING_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_versefrom aiflows import flow_verse
flow_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