4 ms·
I added search to my LLMs years ago with the python DuckDuckGo package. However I found that Google gives better results, so I switched to that. (I forget exac
by andai 1y ago
I added search to my LLMs years ago with the python DuckDuckGo package.
However I found that Google gives better results, so I switched to that. (I forget exactly but I had to set up something in a Google dev console for that.)
I think the DDG one is unofficial, and the Google one has limits (so it probably wouldn't work well for deep research type stuff).
I mostly just pipe it into LLM apis. I found that "shove the first few Google results into GPT, followed by my question" gave me very good results most of the time.
It of course also works with Ollama, but I don't have a very good GPU, so it gets really slow for me on long contexts.
- ivape 1y agoHow do you meaningfully use it without using scraping APIs? Aren't the official apis severely limited?
- selcuka 1y agoGoogle Programmable Search Engine [1] is pretty good if your needs are within their usage limits. [1] https://programmablesearchengine.google.com/about/ https://programmablesearchengine.google.com/about/
- andai 1y agoThat's the one I use, yeah! You set it up here: https://programmablesearchengine.google.com/controlpanel/create https://programmablesearchengine.google.com/controlpanel/cre... And then it's just a GET: import os import json from req import get url = "https://customsearch.googleapis.com/customsearch/v1" def search(query): data = { "q": query, "cx": os.getenv('GOOGLE_SEARCH_API_KEY'), "key": os.getenv('GOOGLE_SEARCH_API_ID') } results_json = get(url, data) results = json.loads(results_json) results = results["items"] return results