Follower Agent πΆπ½ββοΈ
The FollowerAgent
is inherited from the AppAgent
and is responsible for following the user's instructions to perform specific tasks within the application. The FollowerAgent
is designed to execute a series of actions based on the user's guidance. It is particularly useful for software testing, when clear instructions are provided to validate the application's behavior.
Different from the AppAgent
The FollowerAgent
shares most of the functionalities with the AppAgent
, but it is designed to follow the step-by-step instructions provided by the user, instead of does its own reasoning to determine the next action.
Usage
The FollowerAgent
is available in follower
mode. You can find more details in the documentation. It also uses differnt Session
and Processor
to handle the user's instructions. The step-wise instructions are provided by the user in the in a json file, which is then parsed by the FollowerAgent
to execute the actions. An example of the json file is shown below:
{
"task": "Type in a bold text of 'Test For Fun'",
"steps":
[
"1.type in 'Test For Fun'",
"2.select the text of 'Test For Fun'",
"3.click on the bold"
],
"object": "draft.docx"
}
Reference
Bases: AppAgent
The FollowerAgent class the manager of a FollowedAgent that follows the step-by-step instructions for action execution within an application. It is a subclass of the AppAgent, which completes the action execution within the application.
Initialize the FollowAgent.
Parameters: |
|
---|
Source code in agents/agent/follower_agent.py
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 |
|
get_prompter(is_visual, main_prompt, example_prompt, api_prompt, app_info_prompt, app_root_name='')
Get the prompter for the follower agent.
Parameters: |
|
---|
Returns: |
|
---|
Source code in agents/agent/follower_agent.py
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 |
|
message_constructor(dynamic_examples, dynamic_tips, dynamic_knowledge, image_list, control_info, prev_subtask, plan, request, subtask, host_message, current_state, state_diff, include_last_screenshot)
Construct the prompt message for the FollowAgent.
Parameters: |
|
---|
Returns: |
|
---|
Source code in agents/agent/follower_agent.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|