From 7463e4e3eba830caf1cd3ab01ea8dc2e98c38b79 Mon Sep 17 00:00:00 2001 From: Richard Shiue <71320345+richardshiue@users.noreply.github.com> Date: Mon, 24 Mar 2025 16:50:16 +0800 Subject: [PATCH] fix: pass response format in ai writer (#7599) --- .../editor_plugins/ai/operations/ai_writer_cubit.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/operations/ai_writer_cubit.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/operations/ai_writer_cubit.dart index 0784ade2cd..07d5d84ae9 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/operations/ai_writer_cubit.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/ai/operations/ai_writer_cubit.dart @@ -459,6 +459,7 @@ class AiWriterCubit extends Cubit { 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 { 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 { completionType: command.toCompletionType(), history: records, sourceIds: selectedSourcesNotifier.value, + format: predefinedFormat, onStart: () async { records.add( AiWriterRecord.user(