推测性多动作执行
UFO² 引入了一项名为推测性多动作执行的新功能。此功能允许代理将几个预测步骤捆绑到一个 LLM 调用中,然后实时验证这些步骤。与单独推断每个步骤相比,这种方法可以使查询次数减少高达 51%。代理将首先预测一批可能的动作,然后通过一次性验证它们与实时的 UIA 状态。我们在下图中说明了推测性多动作执行
配置
要激活推测性多动作执行,您需要在 config_dev.yaml
文件中将 ACTION_SEQUENCE
设置为 True
。
ACTION_SEQUENCE: True
参考资料
推测性多动作执行的实现位于 ufo/agents/processors/actions.py
文件中。以下类用于推测性多动作执行
agents/processors/actions.py
中的源代码
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
after_status
property
获取状态。
返回 |
|
---|
args
property
获取参数。
返回 |
|
---|
command_string
property
生成函数调用字符串。
返回 |
|
---|
control_label
property
获取控件标签。
返回 |
|
---|
control_log
property
writable
获取控制日志。
返回 |
|
---|
control_text
property
获取控制文本。
返回 |
|
---|
function
property
获取函数名称。
返回 |
|
---|
results
property
writable
获取结果。
返回 |
|
---|
action_flow(puppeteer, control_dict, application_window)
执行动作流。
参数 |
|
---|
返回 |
|
---|
agents/processors/actions.py
中的源代码
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
|
count_repeat_times(previous_actions)
获取前一个动作中相同动作的次数。
参数 |
|
---|
返回 |
|
---|
agents/processors/actions.py
中的源代码
172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
execute(puppeteer)
执行动作。
参数 |
|
---|
agents/processors/actions.py
中的源代码
234 235 236 237 238 239 |
|
get_operation_point_list()
获取动作的操作点。
返回 |
|
---|
agents/processors/actions.py
中的源代码
364 365 366 367 368 369 370 371 372 373 374 375 |
|
is_same_action(action_to_compare)
检查两个动作是否相同。
参数 |
|
---|
返回 |
|
---|
agents/processors/actions.py
中的源代码
159 160 161 162 163 164 165 166 167 168 169 170 |
|
print_result()
打印动作执行结果。
agents/processors/actions.py
中的源代码
342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
|
to_dict(previous_actions)
将动作转换为字典。
参数 |
|
---|
返回 |
|
---|
agents/processors/actions.py
中的源代码
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
to_string(previous_actions)
将动作转换为字符串。
参数 |
|
---|
返回 |
|
---|
agents/processors/actions.py
中的源代码
211 212 213 214 215 216 217 |
|