microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
34.69k stars 5.01k forks source link

WebSurfer changes - incl move to lazy init. #4092

Closed afourney closed 1 week ago

afourney commented 2 weeks ago

Why are these changes needed?

Related issue number

Checks

afourney commented 2 weeks ago

why remove the arguments from init (_lazy_init), there are many scenarios where you launch the browser outside of websurfer and pass it as argument (e.g., webby)

The parameters are added to the constructor. If we want to instantiate it outside and pass a reference, we should do that in the constructor too (in which case things are easier and we don't need lazy init at all)

Lazy init exists because the playwright code is async, and cannot be called from the constructor.... so we wait to do it on the first message

husseinmozannar commented 1 week ago

Now I get it, working on top of this PR for my changes, thanks