Skip to content

Commit 13adec2

Browse files
committed
Added showcase for Sonar Chromium Browser
1 parent 786aa6d commit 13adec2

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
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+
6+
---
7+
8+
## 🚀 Project: Sonar Chromium Browser
9+
10+
**GitHub Repo:** [KoushikBaagh/perplexity-hackathon-chromium](https://github.com/KoushikBaagh/perplexity-hackathon-chromium)
11+
12+
### 📖 Project Overview
13+
14+
This Chrome browser patch integrates Perplexity’s Sonar API directly into Chromium, enabling:
15+
16+
- **Omnibox Answers:** Type `sonar your question` in the address bar to get instant AI responses as autocomplete suggestions.
17+
- **Context-menu Summarization:** Select any text on a page, right-click **Summarize with Sonar**, and view a concise summary in a new tab.
18+
19+
<Screenshot
20+
width={600}
21+
caption="Omnibox answers & context-menu summarization in action"
22+
/>
23+
24+
### 🎥 Demonstration Video
25+
26+
[![Watch the demo](https://img.youtube.com/vi/nFhciodeQ-c/0.jpg)](https://youtu.be/nFhciodeQ-c)
27+
28+
### 🔍 What This Does
29+
30+
1. **Sonar-Powered Omnibox Answers**
31+
32+
- Detects the `sonar` keyword in the omnibox
33+
- Debounces input and queries the Sonar API
34+
- Renders the AI’s answer inline as a high-relevance suggestion
35+
36+
2. **Context-menu “Summarize with Sonar”**
37+
- Activates when text is selected
38+
- Sends selection to Sonar API with a “Please summarize” prompt
39+
- Opens a new `data:` URL tab showing original text + summary
40+
41+
### 🛠 Key Features & Use Cases
42+
43+
- **Instant Research:** Get definitions, explanations, and summaries without leaving your tab.
44+
- **Developer Productivity:** Quickly test API integrations inside the browser.
45+
- **Custom Browser Builds:** See how to hook into Chromium’s omnibox and context menus.
46+
47+
### ⚙️ How It Uses Perplexity Sonar
48+
49+
```js
50+
// Omnibox query (model=sonar-pro)
51+
await client.chat.completions.create({
52+
model: "sonar-pro",
53+
messages: [
54+
{ role: "system", content: "Be precise and concise." },
55+
{ role: "user", content: "What is quantum tunneling?" },
56+
],
57+
});
58+
59+
// Context-menu summarization (model=sonar)
60+
await client.chat.completions.create({
61+
model: "sonar",
62+
messages: [
63+
{ role: "system", content: "Summarize the following text concisely." },
64+
{ role: "user", content: selectedText },
65+
],
66+
});
67+
```

0 commit comments

Comments
 (0)