fix: default model edge cases
This commit is contained in:
@@ -139,7 +139,7 @@ class VoiceInputService {
|
||||
path: filePath,
|
||||
);
|
||||
// ignore: avoid_print
|
||||
print('DEBUG: VoiceInputService recording started at: ' + filePath);
|
||||
print('DEBUG: VoiceInputService recording started at: $filePath');
|
||||
|
||||
// Drive intensity from amplitude stream and detect silence
|
||||
// Consider amplitude less than threshold as silence; stop after ~3s of continuous silence
|
||||
@@ -183,7 +183,7 @@ class VoiceInputService {
|
||||
return;
|
||||
}
|
||||
// ignore: avoid_print
|
||||
print('DEBUG: VoiceInputService recording saved: ' + path);
|
||||
print('DEBUG: VoiceInputService recording saved: $path');
|
||||
// Hand off recorded file path to listeners as a special token; UI layer will upload for transcription
|
||||
_textStreamController?.add('[[AUDIO_FILE_PATH]]:$path');
|
||||
} catch (e) {
|
||||
|
||||
@@ -109,7 +109,7 @@ class _ChatPageState extends ConsumerState<ChatPage> {
|
||||
|
||||
// Try to use the default model provider
|
||||
try {
|
||||
final model = await ref.read(defaultModelProvider.future);
|
||||
final Model? model = await ref.read(defaultModelProvider.future);
|
||||
if (model != null) {
|
||||
debugPrint('DEBUG: Model auto-selected via provider: ${model.name}');
|
||||
}
|
||||
@@ -2170,7 +2170,7 @@ class _VoiceInputSheetState extends ConsumerState<_VoiceInputSheet> {
|
||||
if (text.startsWith('[[AUDIO_FILE_PATH]]:')) {
|
||||
final filePath = text.split(':').skip(1).join(':');
|
||||
debugPrint(
|
||||
'DEBUG: VoiceInputSheet received audio file path: ' + filePath,
|
||||
'DEBUG: VoiceInputSheet received audio file path: $filePath',
|
||||
);
|
||||
_transcribeRecordedFile(filePath);
|
||||
} else {
|
||||
@@ -2237,7 +2237,7 @@ class _VoiceInputSheetState extends ConsumerState<_VoiceInputSheet> {
|
||||
language: language,
|
||||
);
|
||||
debugPrint(
|
||||
'DEBUG: Transcription received: ' + (text.isEmpty ? '[empty]' : text),
|
||||
'DEBUG: Transcription received: ${text.isEmpty ? '[empty]' : text}',
|
||||
);
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
|
||||
@@ -199,6 +199,7 @@ class _ModelSelectorPageState extends ConsumerState<ModelSelectorPage> {
|
||||
onTap: () {
|
||||
ref.read(selectedModelProvider.notifier).state =
|
||||
model;
|
||||
ref.read(isManualModelSelectionProvider.notifier).state = true;
|
||||
Navigator.pop(context);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -839,19 +839,19 @@ class MoreOptionsSheet extends ConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
void _showDeleteConfirmation(BuildContext context, WidgetRef ref) {
|
||||
ThemedDialogs.confirm(
|
||||
void _showDeleteConfirmation(BuildContext context, WidgetRef ref) async {
|
||||
final confirmed = await ThemedDialogs.confirm(
|
||||
context,
|
||||
title: 'Delete Messages',
|
||||
message:
|
||||
'Are you sure you want to delete ${messages.length} message${messages.length == 1 ? '' : 's'}? This action cannot be undone.',
|
||||
confirmText: 'Delete',
|
||||
isDestructive: true,
|
||||
).then((confirmed) {
|
||||
if (confirmed == true) {
|
||||
_deleteMessages(context, ref);
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
if (confirmed == true && context.mounted) {
|
||||
_deleteMessages(context, ref);
|
||||
}
|
||||
}
|
||||
|
||||
void _deleteMessages(BuildContext context, WidgetRef ref) async {
|
||||
|
||||
Reference in New Issue
Block a user