Skip to content

Commit 1995aed

Browse files
committed
Unify Sonar Chromium Browser showcase page structure to match standard format
1 parent b2f5249 commit 1995aed

File tree

1 file changed

+58
-45
lines changed

1 file changed

+58
-45
lines changed
Lines changed: 58 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,77 @@
11
---
2-
| title | description | sidebar_position | keywords |
3-
|-------------------------------|-----------------------------------------------------------------------------------------------|------------------|----------------------------------------------------------------|
4-
| Sonar Chromium Browser | Chromium browser with native Perplexity Sonar API integration: omnibox answers & context-menu summarization | 9 | sonar, chromium, omnibox, context-menu, summarize, hackathon, api |
5-
2+
title: Sonar Chromium Browser | Native Search Omnibox and Context Menu
3+
description: Chromium browser patch with native Perplexity Sonar API integration providing omnibox answers and context-menu summarization
4+
sidebar_position: 15
5+
keywords: [sonar, chromium, omnibox, context-menu, summarize, hackathon, api, browser, integration]
66
---
77

8-
## 🚀 Project: Sonar Chromium Browser
98

10-
**GitHub Repo:** [KoushikBaagh/sonar-chromium-browser](https://github.com/KoushikBaagh/perplexity-hackathon-chromium)
9+
**Sonar Chromium Browser** is a Chromium browser patch that natively integrates Perplexity's Sonar API to provide AI-powered functionality directly in the browser. Users can type `sonar <query>` in the omnibox for instant AI answers or select text and right-click "Summarize with Sonar" for quick summaries, streamlining research and browsing workflows.
10+
11+
## Features
12+
13+
* **Omnibox AI Answers** with `sonar <query>` syntax for instant responses
14+
* **Context-menu Summarization** for selected text with one-click access
15+
* **Native Browser Integration** using Chromium's omnibox and context-menu APIs
16+
* **Dual Model Support** using Sonar Pro for omnibox and Sonar for summaries
17+
* **Debounced Input Handling** for efficient API usage
18+
* **Custom Browser Build** demonstrating AI integration patterns
1119

12-
**Chromium Gerrit Repo:** [KoushikBaagh/google-gerrit-repo](https://chromium-review.googlesource.com/c/chromium/src/+/6778540)
20+
## Prerequisites
1321

14-
### 📖 Project Overview
22+
* Ubuntu 22.04 (WSL2 recommended)
23+
* Chromium source code checkout
24+
* Perplexity API key
25+
* 16GB+ RAM for Chromium build
26+
* Git and standard build tools
1527

16-
This Chrome browser patch integrates Perplexity’s Sonar API directly into Chromium, enabling:
28+
## Installation
1729

18-
- **Omnibox Answers:** Type `sonar your question` in the address bar to get instant AI responses as autocomplete suggestions.
19-
- **Context-menu Summarization:** Select any text on a page, right-click **Summarize with Sonar**, and view a concise summary in a new tab.
30+
```bash
31+
# Clone the repository
32+
git clone https://github.com/KoushikBaagh/perplexity-hackathon-chromium.git
33+
cd perplexity-hackathon-chromium
2034

21-
### 🎥 Demonstration Video
35+
# Apply patches to Chromium source
36+
# Follow the README for detailed Chromium setup instructions
37+
```
2238

23-
[![Watch the demo](https://img.youtube.com/vi/nFhciodeQ-c/0.jpg)](https://youtu.be/nFhciodeQ-c)
39+
## Configuration
2440

25-
### 🔍 What This Does
41+
Update API keys in the modified files:
42+
```cpp
43+
// In sonar_autocomplete_provider.cc and render_view_context_menu.cc
44+
const std::string API_KEY = "your_perplexity_api_key_here";
45+
```
2646

27-
1. **Sonar-Powered Omnibox Answers**
47+
## Usage
2848

29-
- Detects the `sonar` keyword in the omnibox
30-
- Debounces input and queries the Sonar API
31-
- Renders the AI’s answer inline as a high-relevance suggestion
49+
1. **Build Chromium** with applied patches following the repository instructions
50+
2. **Launch the custom browser** with AI integration
51+
3. **Use Omnibox AI**: Type `sonar what is quantum tunneling?` in address bar
52+
4. **Use Context Summarization**: Select text, right-click "Summarize with Sonar"
3253

33-
2. **Context-menu “Summarize with Sonar”**
34-
- Activates when text is selected
35-
- Sends selection to Sonar API with a “Please summarize” prompt
36-
- Opens a new `data:` URL tab showing original text + summary
54+
## Code Explanation
3755

38-
### 🛠 Key Features & Use Cases
56+
* **Omnibox Integration**: Custom autocomplete provider hooking into Chromium's omnibox API
57+
* **Context Menu**: Modified render view context menu for text summarization
58+
* **API Integration**: Direct Perplexity Sonar API calls with debounced input handling
59+
* **Model Selection**: Sonar Pro for omnibox queries, Sonar for text summarization
60+
* **Browser Architecture**: Demonstrates Chromium extension points for AI features
61+
* **Build Process**: Custom Chromium build with AI patches applied
3962

40-
- **Instant Research:** Get definitions, explanations, and summaries without leaving your tab.
41-
- **Developer Productivity:** Quickly test API integrations inside the browser.
42-
- **Custom Browser Builds:** See how to hook into Chromium’s omnibox and context menus.
63+
## Demo Video
4364

44-
### ⚙️ How It Uses Perplexity Sonar
65+
<iframe
66+
className="w-full aspect-video rounded-xl"
67+
src="https://www.youtube.com/embed/nFhciodeQ-c"
68+
title="YouTube video player"
69+
frameBorder="0"
70+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
71+
allowFullScreen
72+
></iframe>
4573

46-
```js
47-
// Omnibox query (model=sonar-pro)
48-
await client.chat.completions.create({
49-
model: "sonar-pro",
50-
messages: [
51-
{ role: "system", content: "Be precise and concise." },
52-
{ role: "user", content: "What is quantum tunneling?" },
53-
],
54-
});
74+
## Links
5575

56-
// Context-menu summarization (model=sonar)
57-
await client.chat.completions.create({
58-
model: "sonar",
59-
messages: [
60-
{ role: "system", content: "Summarize the following text concisely." },
61-
{ role: "user", content: selectedText },
62-
],
63-
});
64-
```
76+
- [GitHub Repository](https://github.com/KoushikBaagh/perplexity-hackathon-chromium)
77+
- [Chromium Gerrit Repository](https://chromium-review.googlesource.com/c/chromium/src/+/6778540)

0 commit comments

Comments
 (0)