devika
devika copied to clipboard
Feature: Integrate Alternative Search API
Hey there 😊,
Currently, devika relies on a Bing search API key, which poses several challenges:
- Azure account requirement.
- Need for a credit card to create an Azure account.
- Potential costs associated with using the search API.
To improve accessibility aswell as flexibility, it should be considered integrating another search API. There are numerous options available, and implementing an alternative shouldn't be too complex. I might even give it a shot myself as a proof of concept later on.
Thanks, and have a great day👍!
I've implemented a proof of concept for using the Google Custom Search API . Here's some sample code to give you an idea of how it works:
from googleapiclient.discovery import build
# Initialize the Google Custom Search client
self.service = build("customsearch", "v1", developerKey=self.google_api_key)
# Search for a query
def search(self, query):
res = self.service.cse().list(q=query, cx=self.google_cse_id).execute()
self.results = res['items']
return res['items']
# Get the first link from the search results
def get_first_link(self):
return self.results[0]["link"]
I'm planning to make a pull request in the next few days that includes a full implementation, as well as a switch in the TOML configuration file to choose between Google and Bing. I can't submit a pull request right now because Devika isn't working on the machine I'm using, so I can't fully test everything before submitting.
Hello Perhaps it would be possible to use the https://github.com/karust/openserp.git project. Knowing that it is installable via docker too.
Hey @0skxr , this #201 would fix it.