Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

chore: do not use the cell of given summary field (#5362)

Nathan.fooobd62a161bef0
diff --git a/frontend/rust-lib/flowy-database2/src/manager.rs b/frontend/rust-lib/flowy-database2/src/manager.rs
index 21858ad201..77d9a477bc 100644
--- a/frontend/rust-lib/flowy-database2/src/manager.rs
+++ b/frontend/rust-lib/flowy-database2/src/manager.rs
@@ -424,15 +424,19 @@ impl DatabaseManager {
if let Some(row) = database.get_row(&view_id, &row_id) {
let fields = database.get_fields(&view_id, None);
for field in fields {
- if let Some(cell) = row.cells.get(&field.id) {
- summary_row_content.insert(field.name.clone(), stringify_cell(cell, &field));
+ // When summarizing a row, skip the content in the "AI summary" cell; it does not need to
+ // be summarized.
+ if field.id != field_id {
+ if let Some(cell) = row.cells.get(&field.id) {
+ summary_row_content.insert(field.name.clone(), stringify_cell(cell, &field));
+ }
}
}
}
// Call the cloud service to summarize the row.
trace!(
- "[AI]: summarize row:{}, content:{:?}",
+ "[AI]:summarize row:{}, content:{:?}",
row_id,
summary_row_content
);