chore: update markdown dependency and refactor streaming handling
- Added `markdown` dependency version `^7.2.1` in `pubspec.yaml`. - Updated `pubspec.lock` to reflect the direct dependency change. - Refactored `streaming_helper.dart` to utilize `StreamingResponseController` for better stream management. - Enhanced `ChatMessagesNotifier` to handle message streams with improved formatting and error handling. - Updated `StreamingMarkdownWidget` to streamline markdown rendering and support new configurations.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../../../core/models/chat_message.dart';
|
||||
|
||||
typedef AssistantResponseBuilder =
|
||||
Widget Function(BuildContext context, AssistantResponseContext response);
|
||||
|
||||
class AssistantResponseContext {
|
||||
const AssistantResponseContext({
|
||||
required this.message,
|
||||
required this.markdown,
|
||||
required this.isStreaming,
|
||||
required this.buildDefault,
|
||||
});
|
||||
|
||||
final ChatMessage message;
|
||||
final String markdown;
|
||||
final bool isStreaming;
|
||||
final WidgetBuilder buildDefault;
|
||||
}
|
||||
|
||||
final assistantResponseBuilderProvider = Provider<AssistantResponseBuilder?>(
|
||||
(_) => null,
|
||||
);
|
||||
Reference in New Issue
Block a user