Skip to content

Commit 7aebffd

Browse files
authored
Merge branch 'main' into main
2 parents d230891 + b22a5a9 commit 7aebffd

File tree

4 files changed

+257
-7
lines changed

4 files changed

+257
-7
lines changed

docs/showcase/citypulse-ai-search.mdx

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: CityPulse - AI-Powered Geospatial Discovery Search
3+
description: Real-time local discovery search using Perplexity AI for personalized location insights and recommendations
4+
sidebar_position: 2
5+
keywords: [perplexity, geospatial, location, real-time, maps, local-discovery, sonar]
6+
---
7+
8+
# CityPulse - AI-Powered Geospatial Discovery
9+
10+
![CityPulse Main Interface](https://raw.githubusercontent.com/anevsky/CityPulse/main/assets/CityPulse-GeoSearch-App-1.jpg)
11+
12+
CityPulse is an intelligent location-based discovery search that helps users explore what's happening around them right now. It demonstrates how to create personalized, real-time local insights using Perplexity's Sonar models.
13+
14+
[![Demo Video](https://cdn.loom.com/sessions/thumbnails/6507fa27571442e680edf787b0f0690d-2fa2c36169822631-full-play.gif)](https://youtu.be/Y0UIhh3diJg)
15+
16+
## What CityPulse Does
17+
18+
- **Real-time local discovery** - Find current events, restaurants, and local alerts near any location
19+
- **AI-powered search suggestions** - Get intelligent search recommendations as you type
20+
- **Personalized insights** - Receive AI-generated advice on what to try, best times to visit, and pro tips
21+
- **Interactive mapping** - Explore results on an interactive map with custom markers and detailed popups
22+
23+
![Search Interface](https://raw.githubusercontent.com/anevsky/CityPulse/main/assets/CityPulse-GeoSearch-App-2.jpg)
24+
25+
## How It Uses Perplexity Sonar
26+
27+
CityPulse leverages two key Perplexity models:
28+
29+
**Sonar for Real-Time Data**
30+
```python
31+
# Get current local information with geographic context
32+
response = client.chat.completions.create(
33+
model="sonar",
34+
messages=[{
35+
"role": "user",
36+
"content": f"Find current events, restaurants, and alerts near {lat}, {lng}"
37+
}],
38+
response_format={"type": "json_schema", "json_schema": {"schema": LOCAL_INFO_SCHEMA}}
39+
)
40+
```
41+
42+
**Sonar Reasoning for Personalized Insights**
43+
```python
44+
# Generate AI-powered location recommendations
45+
response = client.chat.completions.create(
46+
model="sonar-reasoning",
47+
messages=[{
48+
"role": "user",
49+
"content": f"Provide personalized insights for {location_name}: what to try, best times to visit, pro tips"
50+
}]
51+
)
52+
```
53+
54+
The app uses structured JSON schemas to ensure consistent data formatting and includes citation tracking for source verification.
55+
56+
![AI Insights](https://raw.githubusercontent.com/anevsky/CityPulse/main/assets/CityPulse-GeoSearch-App-3.jpg)
57+
58+
## Links
59+
60+
- [GitHub Repository](https://github.com/anevsky/CityPulse)
61+
- [Live Demo](https://citypulse-ppx.uc.r.appspot.com/)
62+
- [Video Demo](https://youtu.be/Y0UIhh3diJg)
63+
- **[Built with ❤️ by Alex Nevsky](https://alexnevsky.com)**

docs/showcase/fact-dynamics.mdx

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
---
2+
title: Fact Dynamics | Real-time Fact-Checking Flutter App
3+
description: Cross-platform app for real-time fact-checking of debates, speeches, and images using Perplexity's Sonar API
4+
sidebar_position: 3
5+
keywords: [Fact Dynamics, fact-checking, Flutter, Dart, real-time, speech-to-text, debate, image verification]
6+
---
7+
8+
# Fact Dynamics | Real-time Fact-Checking Flutter App
9+
<p align="center">
10+
<img
11+
src="https://raw.githubusercontent.com/vishnu32510/fact_pulse/main/assets/icon/icon.png"
12+
alt="Fact Dynamics logo"
13+
width="80"
14+
height="80"
15+
style={{ borderRadius: '14px' }}
16+
/>
17+
</p>
18+
19+
**Hackathon Submission** - Built for Perplexity Hackathon in Information Tools & Deep Research categories.
20+
21+
Fact Dynamics is a cross-platform Flutter app that provides real-time fact-checking for spoken content and images. Perfect for live debates, presentations, and on-the-fly information verification.
22+
23+
24+
## Features
25+
26+
* Real-time speech transcription and fact-checking during live conversations
27+
* Image text extraction and claim verification with source citations
28+
* Claim rating system (TRUE, FALSE, MISLEADING, UNVERIFIABLE) with explanations
29+
* Source Citations** - Provides authoritative URLs backing each verdict
30+
31+
* Debate mode with continuous speech recognition and streaming feedback
32+
* User authentication via Firebase (Google, Email) with persistent chat history
33+
* Cross-platform support for iOS, Android, and Web
34+
35+
## Prerequisites
36+
37+
* Flutter SDK 3.0.0 or newer
38+
* Dart SDK 2.17.0 or newer
39+
* Firebase CLI for authentication and database setup
40+
* Perplexity API key for Sonar integration
41+
* Device with microphone access for speech recognition
42+
43+
## Installation (Follow Detailed guideline on the Repository)
44+
45+
```bash
46+
git clone https://github.com/vishnu32510/fact_pulse.git
47+
cd fact_pulse
48+
flutter pub get
49+
```
50+
51+
## Usage
52+
53+
**Real-time Speech Fact-Checking:**
54+
- Streams 5-second audio chunks through Flutter's `speech_to_text`
55+
- Sends transcribed snippets to Sonar API with structured prompts
56+
- Returns JSON with claims, ratings (TRUE/FALSE/MISLEADING/UNVERIFIABLE), explanations, and sources
57+
58+
**Image Analysis:**
59+
- Uploads images/URLs to Sonar API for text extraction
60+
- Verifies extracted claims against authoritative sources
61+
- Provides comprehensive analysis with source attribution
62+
63+
## Screenshots
64+
65+
<table>
66+
<tr>
67+
<td>
68+
<img
69+
src="https://raw.githubusercontent.com/vishnu32510/fact_pulse/main/assets/screenshots/2.%20Dashboard.png"
70+
alt="Dashboard"
71+
width="200"
72+
/>
73+
</td>
74+
<td>
75+
<img
76+
src="https://raw.githubusercontent.com/vishnu32510/fact_pulse/main/assets/screenshots/4.%20Fact%20Checks(Speech,%20Debate,%20Image).png"
77+
alt="Fact checking interface"
78+
width="200"
79+
/>
80+
</td>
81+
</tr>
82+
</table>
83+
84+
## Code Explanation
85+
86+
* Frontend: Flutter with BLoC pattern for state management targeting iOS, Android, and Web
87+
* Backend: Firebase (Firestore, Authentication) for user data and chat history persistence
88+
* Speech Processing: speech_to_text package for real-time audio transcription
89+
* API Integration: Custom Dart client calling Perplexity Sonar API with structured prompts
90+
* Image Processing: Built-in image picker with base64 encoding for multimodal analysis
91+
* Data Architecture: Firestore collections per user with subcollections for debates, speeches, and images
92+
93+
## Open Source SDKs
94+
95+
Built two reusable packages for the Flutter community:
96+
- **[perplexity_dart](https://pub.dev/packages/perplexity_dart)** - Core Dart SDK for Perplexity API
97+
- **[perplexity_flutter](https://pub.dev/packages/perplexity_flutter)** - Flutter widgets and BLoC integration
98+
99+
100+
## Links
101+
102+
- **[GitHub Repository](https://github.com/vishnu32510/fact_pulse)** - Full source code
103+
- **[Live Demo](https://fact-pulse.web.app/)** - Try the web version
104+
- **[Demo Video](https://youtu.be/92IoX19Djtc)** - Watch it in action
105+
- **[Devpost Submission](https://devpost.com/software/fact-dynamics)** - Hackathon entry

docs/showcase/index.mdx

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/showcase/perplexity-flutter.mdx

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: Perplexity Dart & Flutter SDKs
3+
description: Lightweight, type-safe SDKs for seamless Perplexity API integration in Dart and Flutter applications
4+
sidebar_position: 4
5+
keywords: [Perplexity, Flutter, Dart, SDK, API, streaming, chat-completions, sonar, type-safe, widgets]
6+
---
7+
8+
# Perplexity Dart & Flutter SDKs
9+
10+
**Perplexity Dart & Flutter SDKs** provide comprehensive toolkit for integrating Perplexity's AI capabilities into Dart and Flutter applications. Built specifically for the Flutter community, these packages include a lightweight core API client and ready-to-use Flutter widgets with BLoC state management.
11+
12+
## Features
13+
14+
* Type-safe API client with fully typed models and compile-time safety
15+
* Streaming and non-streaming chat completions with real-time response handling
16+
* Support for all Perplexity models (Sonar, Sonar Pro, Deep Research, Reasoning variants)
17+
* Multi-image processing with base64, data URI, and HTTPS URL support
18+
* Ready-to-use Flutter widgets with BLoC state management integration
19+
* Advanced configuration options (temperature, top-p, search filters, domain restrictions)
20+
* Cross-platform support for iOS, Android, Web, and Desktop
21+
* Future-proof design with custom model string support for new Perplexity releases
22+
23+
## Prerequisites
24+
25+
* Dart SDK 2.17.0 or newer
26+
* Flutter SDK 3.0.0 or newer (for Flutter-specific features)
27+
* Perplexity API key from Perplexity API Console
28+
* Basic knowledge of Flutter BLoC pattern for widget integration
29+
30+
## Installation
31+
32+
### For Dart Projects (Core API Only)
33+
34+
```bash
35+
dart pub add perplexity_dart
36+
```
37+
38+
### For Flutter Projects (Full Widget Support)
39+
40+
```bash
41+
flutter pub add perplexity_flutter
42+
```
43+
44+
### Environment variables
45+
46+
```dart
47+
// Add to your app's configuration
48+
const String perplexityApiKey = 'your_perplexity_api_key_here';
49+
```
50+
51+
## Usage
52+
53+
**Core API Integration:**
54+
- Type-safe client with all Perplexity models (Sonar, Sonar Pro, Deep Research, Reasoning)
55+
- Streaming and non-streaming chat completions
56+
- Multimodal processing with flexible MessagePart system for text + images
57+
58+
**Flutter Widget Layer:**
59+
- `ChatWrapperWidget` for BLoC state management
60+
- `PerplexityChatView` for real-time message display
61+
- `PerplexityChatInput` for user interaction handling
62+
63+
## Code Explanation
64+
65+
* Core Layer: Pure Dart API client (`perplexity_dart`) for cross-platform Perplexity API integration
66+
* UI Layer: Flutter widgets (`perplexity_flutter`) with BLoC state management for rapid development
67+
* Type Safety: Fully typed models and responses prevent runtime errors and provide IntelliSense
68+
* Multimodal: Flexible MessagePart system for combining text and images in single requests
69+
* Streaming: Built-in support for real-time chat completions with proper chunk handling
70+
* Architecture: Two-layer design allows lightweight API usage or full Flutter widget integration
71+
72+
## Architecture
73+
74+
**Two-layer design:**
75+
- **Core (`perplexity_dart`)** - Pure Dart API client for all platforms
76+
- **UI (`perplexity_flutter`)** - Flutter widgets + BLoC state management
77+
78+
Uses flexible MessagePart system for multimodal content combining text and images.
79+
## Links
80+
81+
**Packages:**
82+
- [perplexity_dart on pub.dev](https://pub.dev/packages/perplexity_dart) | [GitHub](https://github.com/vishnu32510/perplexity_dart)
83+
- [perplexity_flutter on pub.dev](https://pub.dev/packages/perplexity_flutter) | [GitHub](https://github.com/vishnu32510/perplexity_flutter)
84+
85+
**Examples:**
86+
- [Flutter Example App](https://github.com/vishnu32510/perplexity_dart/tree/main/example_flutter_app)
87+
- [Dart Examples](https://github.com/vishnu32510/perplexity_dart/tree/main/example)
88+
89+
**Contributing:** Issues and PRs welcome on both repositories.

0 commit comments

Comments
 (0)