Add initial support for web browsing (#237)
* basic poc for web search
* * Hide feature when serpapi_key is not defined
* handle error case where serpapi failed
* only use user queries for generating the query
* Update src/lib/buildPrompt.ts
Co-authored-by: Eliott C. <coyotte508@gmail.com>
* Update src/routes/+layout.server.ts
Co-authored-by: Eliott C. <coyotte508@gmail.com>
* refactored getQueryFromPrompt
* add jsdom to package.json
* begin work on fetching webpage content
* Update .env
Co-authored-by: Eliott C. <coyotte508@gmail.com>
* prettier fix
* Add feature for scraping webpages
* refactored search functionality
- now gets triggered from a separate endpoint
- results are stored in db
- results can be displayed in their own endpoint
* Added a stream to send updates from backend on web-search endpoint
* made stream more reliable
* Add front-end to web search feature
* made sure the web results button appears on newly posted messages
* close modal when message is done generating
* removed log statements
* Add button to open modal on loading messages too
* replace modal by collapsable menu
* make sure shared conversations also show search details
* Use spinner for collapse menu
* Fix alignment of "stop generating" button
* Fix loading indicators
- spinner only shows when web search is searching
- text loader shows after the web search is done
* fix loading icon when web search is disabled
* Update search messages & clean up summary string
* Fix alignment of timeline
* Use existing switch
* Add a background to tooltip & center it
* fix like making search messages disappear
* use correct spinner
* fix state issues
* lint
* fix bug with empty search messages
* fix like bug ?
* fix modal bug
* error handling
* fix like bug
* slice scraped text so it fits in context
* misc UI
* bottom buttons
simplify and fix
* made sure snap scrolling also works on web search updates
* loader
* margin
* remove unused function
* linter
* quickfix duplicate websearch
---------
Co-authored-by: Eliott C. <coyotte508@gmail.com>
Co-authored-by: Victor Mustar <victor.mustar@gmail.com>