feat: embed a Flutter G4F client with Cronet, cookie jar, and origin WebView

Port the Oracle off the Python g4f container onto on-device providers: Chromium HTTP via Cronet, a shared cookie session, IterList retry, hosted OpenAI-compat aggregators, and same-origin WebView fallbacks instead of CORS fetch.
This commit is contained in:
Alma Alexyz
2026-09-01 22:05:38 +05:00
parent f3e7412cf9
commit fbf04d90db
49 changed files with 4856 additions and 92 deletions
+26
View File
@@ -0,0 +1,26 @@
// models.dart
enum Role { system, user, assistant }
class Message {
final Role role;
final String content;
const Message({required this.role, required this.content});
Map<String, dynamic> toJson() => {
'role': role.name,
'content': content,
};
}
class G4FModels {
static const String gpt4 = 'gpt-4';
static const String gpt4o = 'gpt-4o';
static const String gpt4oMini = 'gpt-4o-mini';
static const String commandR = 'command-r';
static const String commandRPlus = 'command-r-plus';
static const String mistral = 'mistral';
static const String llama3 = 'llama-3';
static const String qwen = 'qwen';
static const String openaiFast = 'openai-fast';
}