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

* chore: do not use the cell of given summary field

* chore: update docs
This commit is contained in:
Nathan.fooo 2024-05-19 21:35:14 +08:00 committed by GitHub
parent 7e83d598f8
commit bd62a161be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
);