Skip to content

Commit ea4c049

Browse files
authored
Merge branch 'main' into main
2 parents 4c5fe03 + 7399b75 commit ea4c049

File tree

3 files changed

+194
-7
lines changed

3 files changed

+194
-7
lines changed

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: 2
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: 3
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)