目录

browser-use-webui源代码-读书日记

目录

browser-use webui源代码 读书日记

进入main https://i-blog.csdnimg.cn/direct/cc38a569e4ae47d197875ea38d95d3ec.png

看到run agent了,gr.row里面没东西

https://i-blog.csdnimg.cn/direct/f577efad085949efa5f59a34aeb1dbe5.png

https://i-blog.csdnimg.cn/direct/4283aa0dbc9f45a8987869852bc8234d.png

找run agent按钮对应代码,run button变量查找引用

https://i-blog.csdnimg.cn/direct/7b01e88c081b494eb9bc80e9150a4aac.png

进入run with stream

https://i-blog.csdnimg.cn/direct/3da6c558447c4ec6bdcf0888121baf53.png

进入run browser agent

https://i-blog.csdnimg.cn/direct/ba61dbc0f747480ba0ad3cc4a6ba67a5.png

进入 run custom agent 转到定义

https://i-blog.csdnimg.cn/direct/7aec4d91eddd42bfaf0bc2f0f18fedb9.png

https://i-blog.csdnimg.cn/direct/a758ad8b8c37458b90bf89b73967e279.png

用到browser use了

https://i-blog.csdnimg.cn/direct/e185d3f07e2b4d36b202edf7c736f3f9.png

找不到 playwright的使用了,直接搜索playwright,发现browser有用到playwright的browser

https://i-blog.csdnimg.cn/direct/c80c165cb00e4ccba4abbea822e7d432.png

接之前controller

controller service 里有click eliment,有一种selenium的美    registry.action

controller这个类就是个selenium工具库,找一下agent是怎么调用controller的

https://i-blog.csdnimg.cn/direct/f898d279871d403580abe64896f05f43.png

customagent传入controller

https://i-blog.csdnimg.cn/direct/ed178ade6e90418281f85656a0c01efe.png

customagent继承于agent   ‘log response方法前已经得到了动作

https://i-blog.csdnimg.cn/direct/cb038d65018942fb91c7063f82663ec1.png

查找引用 get_next_action

https://i-blog.csdnimg.cn/direct/b2783133fb984c1d9039e9c13b374c29.png

大模型消息处理应该就是用到这个with_structured_output,找他的输入agentoutput

https://i-blog.csdnimg.cn/direct/3360b90885614865a202b121057f9d5d.png

连接上controller的action了,应该就是这个了

https://i-blog.csdnimg.cn/direct/1e7be6d0c96d46b6b71d5b5bf41f02f7.png


agent.run转到实现

https://i-blog.csdnimg.cn/direct/d1a0d0d9fa76495aae91880b2ea176e2.png

run用到了controller的multi act方法

https://i-blog.csdnimg.cn/direct/c3ceacd7464d4b4cb20dbf086ef54e9b.png

multi act用到了act方法

https://i-blog.csdnimg.cn/direct/fe8bca05158a4329af443c6885cf4cc2.png

act执行行动execute action

https://i-blog.csdnimg.cn/direct/7c956ceb66024927b9f35d35f15ee7a4.png

接下来就是找action:actionmodel是哪里来的

https://i-blog.csdnimg.cn/direct/8da2b4b9d13e4e24b60e52dffc23528d.png