Skip to content

search_engine.md #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 46 additions & 26 deletions docs/Installation/search_engine.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,53 @@
# search Engine setup
# Search Engine Setup for Devika

To use the search engine capabilities of Devika, you need to set up the search engine API keys. Currently, Devika supports Bing, Google and DuckDuckGo search engines. If you want to use duckduckgo, you don't need to set up any API keys.
Devika supports three search engines: **Bing**, **Google**, and **DuckDuckGo**. While **DuckDuckGo** does not require any API keys, **Bing** and **Google** do. Follow the steps below to set up the API keys for Bing and Google.

For Bing and Google search engines, you need to set up the API keys. Here's how you can do it:
## 1. Bing Search API Setup

## Bing Search API
- Create Azure account. You can create a free account [here](https://azure.microsoft.com/en-us/free/).
- Go to the [Bing Search API](https://www.microsoft.com/en-us/bing/apis/bing-web-search-api) website.
- click on the `Try now` button.
- Sign in/sign up with your Azure account.
- Create a new resource group (if you don't have any).
![alt text](images/bing.png)
- click on the `Review and create` button.
- if everything is fine, click on the `Create` button.
### Step 1: Create an Azure Account
- Visit the [Azure website](https://azure.microsoft.com/en-us/free/) and create a free account.

### Step 2: Access the Bing Search API
- Go to the [Bing Search API](https://www.microsoft.com/en-us/bing/apis/bing-web-search-api) page.
- Click on the `Try now` button.
- Sign in or sign up using your Azure account.

### Step 3: Create a Resource Group
- If you don't have a resource group, create one during the setup process.

### Step 4: Create a Bing Search API Resource
- Fill in the necessary details for your Bing Search API resource.
- Click on the `Review and create` button.
- If everything is correct, click on the `Create` button.

### Step 5: Retrieve Your API Keys and Endpoint
- Once the resource is created, go to the `Keys and Endpoint` tab.
![alt text](images/bing-1.png)
- Copy either `Key1` or `Key2` and paste it into the `API_KEYS` field with the name `BING` in the `config.toml` file located in the root directory of Devika, or you can set it via the UI.
- ![Keys and Endpoint](images/bing-1.png)
- Copy either `Key1` or `Key2`.
- Paste the key into the `API_KEYS` field with the name `BING` in the `config.toml` file located in the root directory of Devika, or you can set it via the UI.
- Copy the `Endpoint` and paste it into the `API_Endpoints` field with the name `BING` in the `config.toml` file located in the root directory of Devika, or you can set it via the UI.

## 2. Google Search API Setup

### Step 1: Create a Google Cloud Project
- If you don't have one, create a Google Cloud Project via the [Google Cloud Console](https://console.cloud.google.com/).

### Step 2: Enable the Custom Search API
- Visit the [Google Custom Search API Documentation](https://developers.google.com/custom-search/v1/overview).
- Click on `Get a Key`.
- Select your project or create a new one.
- ![Create Project](images/google.png)
- This will enable the Custom Search API for your project and generate an API key.

### Step 3: Retrieve Your API Key
- Copy the API key.
- Paste it in the `API_KEYS` field with the name `GOOGLE_SEARCH` in the `config.toml` file located in the root directory of Devika, or you can set it via the UI.

### Step 4: Create a Custom Search Engine
- Go to the [Google Custom Search Engine](https://programmablesearchengine.google.com/controlpanel/all) website.
- Click on the `Add` button to create a new search engine.
- ![Create Search Engine](images/google-2.png)
- After creating the engine, copy the `Search Engine ID`.
- Paste it in the `API_Endpoints` field with the name `GOOGLE_SEARCH_ENGINE_ID` in the `config.toml` file located in the root directory of Devika, or you can set it via the UI.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention that you can update via UI. not to change config.toml

```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this extra backticks


## Google Search API
- if don't have then create GCP account [Google Cloud Console](https://console.cloud.google.com/).
- visit [Here](https://developers.google.com/custom-search/v1/overview) is the official documentation.
- click on `Get a Key`.
- select the project you have or create a new project. click on next.
![alt text](images/google.png)
- it enable the Custom Search API for the project and create the API key.
- Copy the API key and paste it in the API_KEYS field with the name `GOOGLE_SEARCH` in the `config.toml` file in the root directory of Devika or you can set it via UI.
- for the search engine id, go to the [Google Custom Search Engine](https://programmablesearchengine.google.com/controlpanel/all) website.
- click on the `Add` button.
![alt text](images/google-2.png)
- After creating the engine. Copy the `Search Engine ID` and paste it in the API_Endpoints field with the name `GOOGLE_SEARCH_ENGINE_ID` in the `config.toml` file in the root directory of Devika or you can set it via UI.