fbf04d90db
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.
27 lines
701 B
Dart
27 lines
701 B
Dart
// 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';
|
|
}
|