fix: pass response format in ai writer (#7599)

This commit is contained in:
Richard Shiue 2025-03-24 16:50:16 +08:00 committed by GitHub
parent 682a50da53
commit 7463e4e3eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -459,6 +459,7 @@ class AiWriterCubit extends Cubit<AiWriterState> {
completionType: command.toCompletionType(),
history: records,
sourceIds: selectedSourcesNotifier.value,
format: predefinedFormat,
onStart: () async {
final transaction = editorState.transaction;
final position = ensurePreviousNodeIsEmptyParagraph(
@ -549,6 +550,7 @@ class AiWriterCubit extends Cubit<AiWriterState> {
final stream = await _aiService.streamCompletion(
objectId: documentId,
text: prompt,
format: predefinedFormat,
completionType: command.toCompletionType(),
history: records,
sourceIds: selectedSourcesNotifier.value,
@ -651,6 +653,7 @@ class AiWriterCubit extends Cubit<AiWriterState> {
completionType: command.toCompletionType(),
history: records,
sourceIds: selectedSourcesNotifier.value,
format: predefinedFormat,
onStart: () async {
records.add(
AiWriterRecord.user(