This might be exactly what you’re looking for.
- Use GPT-3.5 to generate a search engine query for a message
- Use a SERP API to search Google / Bing for relevant websites using the search query generated above
- Pass the top results URLs to this API as well as the user’s original message
- API returns relevant chunks of text from the URLs that you insert into prompt
- ChatGPT answers based on the retrieved text.
See here for example, suppose we provided the URL of this news article and the user’s message shown in the screenshot:
It provides the answer in the first chunk of text returned ‘Gurman expects an early 2024 launch for the larger Pro laptops — perhaps in late January or early February’
The integration of that example would be
- 'Generate a relevant search query to find the answer to the user’s question: ‘when will the M3 macbook pro be released’ → GPT returns ‘m3 macbook pro release date’ as the search query
- We search Google using this search query and the Tom’s Guide article is the first one returned
- Pass that URL to the API
- API uses the message and the URL to return the relevant text
- We insert the top 3 or so chunks into the prompt.
Demo here: Demos | Not Quite Unicorns
Hope it helps and it’s free!