30 lines
892 B
Dart
30 lines
892 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
import 'package:trainhub_flutter/domain/entities/chat_session.dart';
|
|
import 'package:trainhub_flutter/domain/entities/chat_message.dart';
|
|
|
|
part 'chat_state.freezed.dart';
|
|
|
|
enum ThinkingStepStatus { pending, running, completed, error }
|
|
|
|
@freezed
|
|
class ThinkingStep with _$ThinkingStep {
|
|
const factory ThinkingStep({
|
|
required String id,
|
|
required String title,
|
|
@Default(ThinkingStepStatus.running) ThinkingStepStatus status,
|
|
String? details,
|
|
}) = _ThinkingStep;
|
|
}
|
|
|
|
@freezed
|
|
class ChatState with _$ChatState {
|
|
const factory ChatState({
|
|
@Default([]) List<ChatSessionEntity> sessions,
|
|
ChatSessionEntity? activeSession,
|
|
@Default([]) List<ChatMessageEntity> messages,
|
|
@Default(false) bool isTyping,
|
|
@Default([]) List<ThinkingStep> thinkingSteps,
|
|
String? streamingContent,
|
|
}) = _ChatState;
|
|
}
|