diff --git a/lib/core/utils/reasoning_parser.dart b/lib/core/utils/reasoning_parser.dart index 57dc3a4..809ba4b 100644 --- a/lib/core/utils/reasoning_parser.dart +++ b/lib/core/utils/reasoning_parser.dart @@ -1,30 +1,14 @@ -import 'package:flutter/foundation.dart'; -import 'debug_logger.dart'; - /// Utility class for parsing and extracting reasoning/thinking content from messages class ReasoningParser { /// Parses a message and extracts reasoning content static ReasoningContent? parseReasoningContent(String content) { if (content.isEmpty) return null; - if (kDebugMode) { - DebugLogger.log( - 'Parsing content: ${content.substring(0, content.length > 200 ? 200 : content.length)}...', - ); - } - // Check if content contains reasoning if (!content.contains('
tag with type="reasoning" final reasoningRegex = RegExp( r']*>\s*([^<]*)\s*(.*?)\s*
', @@ -34,44 +18,14 @@ class ReasoningParser { final match = reasoningRegex.firstMatch(content); if (match == null) { - if (kDebugMode) { - debugPrint('DEBUG: Regex did not match - checking pattern'); - } - // Try a more flexible regex to debug - final flexRegex = RegExp( - r']*type="reasoning"[^>]*>.*?', - multiLine: true, - dotAll: true, - ); - final flexMatch = flexRegex.firstMatch(content); - if (flexMatch != null) { - if (kDebugMode) { - DebugLogger.log('Found flexible match: ${flexMatch.group(0)}'); - } - } else { - if (kDebugMode) { - DebugLogger.log('No flexible match found either'); - } - } return null; } - if (kDebugMode) { - DebugLogger.log('Regex matched successfully'); - } - final isDone = match.group(1) == 'true'; final duration = int.tryParse(match.group(2) ?? '0') ?? 0; final summary = match.group(3)?.trim() ?? ''; final reasoning = match.group(4)?.trim() ?? ''; - if (kDebugMode) { - DebugLogger.log( - 'Parsed values - isDone: $isDone, duration: $duration, summary: $summary', - ); - DebugLogger.log('Reasoning content length: ${reasoning.length}'); - } - // Remove the reasoning section from the main content final mainContent = content.replaceAll(reasoningRegex, '').trim(); diff --git a/lib/features/chat/widgets/assistant_message_widget.dart b/lib/features/chat/widgets/assistant_message_widget.dart index 58bbc45..4884c39 100644 --- a/lib/features/chat/widgets/assistant_message_widget.dart +++ b/lib/features/chat/widgets/assistant_message_widget.dart @@ -494,21 +494,9 @@ class _AssistantMessageWidgetState extends ConsumerState Widget _buildTypingIndicator() { return Consumer( builder: (context, ref, child) { - const statusText = 'Thinking about your question...'; - return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - statusText, - style: TextStyle( - color: context.conduitTheme.textSecondary.withValues( - alpha: 0.7, - ), - fontSize: AppTypography.bodyMedium, - fontStyle: FontStyle.italic, - ), - ), const SizedBox(height: Spacing.xs), Row( children: [