intermediate
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_material_design_icons/flutter_material_design_icons.dart';
|
||||
|
||||
enum KagiTool {
|
||||
search(MdiIcons.searchWeb),
|
||||
summarizer(MdiIcons.text),
|
||||
//Sort early access features last
|
||||
assistant(MdiIcons.brain);
|
||||
|
||||
final IconData icon;
|
||||
|
||||
const KagiTool(this.icon);
|
||||
}
|
||||
|
||||
enum AssistantMode {
|
||||
research(7),
|
||||
code(5),
|
||||
chat(4),
|
||||
custom(6);
|
||||
|
||||
final int value;
|
||||
|
||||
const AssistantMode(this.value);
|
||||
}
|
||||
|
||||
enum ResearchVariant {
|
||||
fast(1),
|
||||
expert(2);
|
||||
|
||||
final int value;
|
||||
|
||||
const ResearchVariant(this.value);
|
||||
}
|
||||
|
||||
enum ChatModel {
|
||||
gpt35Turbo('GPT 3.5 Turbo', 1),
|
||||
gpt4('GPT 4', 2),
|
||||
gpt4Turbo('GPT 4 Turbo', 7),
|
||||
gpt4o('GPT 4o', 15),
|
||||
claude3Haiku('Claude 3 Haiku', 13),
|
||||
claude3Sonnet('Claude 3 Sonnet', 14),
|
||||
claude3Opus('Claude 3 Opus', 12),
|
||||
gemini15Pro('Gemini 1.5 Pro', 8),
|
||||
mistralSmall('Mistral Small', 10),
|
||||
mistralLarge('Mistral Large', 11);
|
||||
|
||||
final int value;
|
||||
final String label;
|
||||
|
||||
const ChatModel(this.label, this.value);
|
||||
}
|
||||
|
||||
enum SummarizerMode {
|
||||
keyMoments('takeaway'),
|
||||
summary('summary');
|
||||
|
||||
final String value;
|
||||
|
||||
const SummarizerMode(this.value);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_mozilla_components/flutter_mozilla_components.dart';
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
|
||||
part 'session.g.dart';
|
||||
|
||||
@Riverpod()
|
||||
class KagiSessionService extends _$KagiSessionService {
|
||||
final _cookieManager = GeckoCookieService();
|
||||
|
||||
Future<void> setKagiSession(String session) async {
|
||||
await _cookieManager.setCookie(
|
||||
url: Uri.https('kagi.com'),
|
||||
name: 'kagi_session',
|
||||
value: session,
|
||||
domain: Uri.https('kagi.com'),
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
sameSite: CookieSameSiteStatus.lax,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void build() {}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'session.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$kagiSessionServiceHash() =>
|
||||
r'8bed5d74d319ff2f874f42bc8596d02f05347c1f';
|
||||
|
||||
/// See also [KagiSessionService].
|
||||
@ProviderFor(KagiSessionService)
|
||||
final kagiSessionServiceProvider =
|
||||
AutoDisposeNotifierProvider<KagiSessionService, void>.internal(
|
||||
KagiSessionService.new,
|
||||
name: r'kagiSessionServiceProvider',
|
||||
debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
|
||||
? null
|
||||
: _$kagiSessionServiceHash,
|
||||
dependencies: null,
|
||||
allTransitiveDependencies: null,
|
||||
);
|
||||
|
||||
typedef _$KagiSessionService = AutoDisposeNotifier<void>;
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member
|
||||
Reference in New Issue
Block a user