Skip to content

Conversation

@esafwan
Copy link
Contributor

@esafwan esafwan commented Nov 3, 2025

Important: Merge after merging liteLLM PR.

Add Google Search Tool

Adds Google Programmable Search Engine (PSE) support as a tool via LiteLLM.

  • Implements Google Search tool in SDK tools
  • Integrates with LiteLLM unified provider
  • Adds configuration and error handling
### How to Add and Configure Google Search API Key in Frappe

#### Step 1: Add Keys in Site Config

The Google Search tool uses credentials stored in `site_config.json`. You need to add:

* `google_pse_api_key` → your Google Programmable Search API key
* `google_pse_engine_id` → your Google Custom Search Engine ID


~~~json
{
  "google_pse_api_key": "YOUR_API_KEY_HERE",
  "google_pse_engine_id": "YOUR_ENGINE_ID_HERE"
}
~~~

#### Step 2: Get Your Google API Credentials

1. Go to [[Google Cloud Console](https://console.cloud.google.com/)](https://console.cloud.google.com/)
2. Create/select a project
3. Enable **Custom Search API**
4. Under **APIs & Services → Credentials**, create an API key → this is `google_pse_api_key`
5. Visit [[Programmable Search Engine](https://programmablesearchengine.google.com/)](https://programmablesearchengine.google.com/)
6. Create or open your search engine
7. Copy the **Search Engine ID** → this is `google_pse_engine_id`

Once added, the tool automatically detects these values from `site_config` — no restart required.

Integrates Google Search as a new tool for agents, allowing them to perform web searches. This includes adding the tool to the AgentToolFunction doctype, defining its parameters, and implementing the handler function using LiteLLM.
@esafwan esafwan force-pushed the add-google-search-tool branch 2 times, most recently from dc6e64e to 2f340fc Compare November 5, 2025 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant