hdresearch/nolita

Clean up API separation

matildepark opened this issue · 1 comments

With the introduction of the Page class pre-2.0 launch we need to clean up our APIs overall. Our current separation in 1.0 is sort of unintuitive, objective-only, prohibits working with navigation outside the tab context, etc...

By moving toward a Page-centric navigation loop you can map over results from previous sessions, have multiple tabs open in a browser instance. Basically it's more ergonomic, cleanly separated. You can do direct scripting, NLP navigation, and objective-oriented navigation, all centred around our agent.

Our ideal is the following:

Agent

  • chatcompletion wrapper with custom prompts

Logger

  • consumed by Browser, adds callbacks to action steps

Browser

  • spawn a browser to do NLP commands
  • spawns Pages

Page

  • created by Browser, also wraps Puppeteer pages if directly imported!
  • needs to encapsulate objective-oriented navigation
  • will subsume AgentBrowser, below

AgentBrowser (removed, incorporated into Page)

  • objective stuff
  • followRoute? not documented by us yet

Subtasks

  • document new APIs on README.md, nolita.ai
  • add paired breaking changes on hdresearch/create and the bin folder