diff --git a/connectors/src/connectors/google_drive/temporal/activities.ts b/connectors/src/connectors/google_drive/temporal/activities.ts index 57b1ab529020..43caaefd18a9 100644 --- a/connectors/src/connectors/google_drive/temporal/activities.ts +++ b/connectors/src/connectors/google_drive/temporal/activities.ts @@ -513,6 +513,7 @@ async function syncOneFile( title: file.name, updatedAt: file.updatedAtMs ? new Date(file.updatedAtMs) : undefined, createdAt: file.createdAtMs ? new Date(file.createdAtMs) : undefined, + lastEditor: file.lastEditor ? file.lastEditor.displayName : undefined, content: documentContent ? { prefix: null, content: documentContent, sections: [] } : null, diff --git a/connectors/src/connectors/notion/temporal/activities.ts b/connectors/src/connectors/notion/temporal/activities.ts index 9523986ec94c..f7b49ee043e0 100644 --- a/connectors/src/connectors/notion/temporal/activities.ts +++ b/connectors/src/connectors/notion/temporal/activities.ts @@ -1757,6 +1757,8 @@ export async function renderAndUpsertPageFromCache({ title: title ?? null, createdAt: createdAt, updatedAt: updatedAt, + author, + lastEditor, content: { prefix: null, content: renderedPage, sections: [] }, }); diff --git a/connectors/src/lib/data_sources.ts b/connectors/src/lib/data_sources.ts index 3c07a3719ef9..87ddbabdfcd0 100644 --- a/connectors/src/lib/data_sources.ts +++ b/connectors/src/lib/data_sources.ts @@ -323,11 +323,15 @@ export function renderDocumentTitleAndContent({ title, createdAt, updatedAt, + author, + lastEditor, content, }: { title: string | null; createdAt?: Date; updatedAt?: Date; + author?: string; + lastEditor?: string; content: CoreAPIDataSourceDocumentSection | null; }): CoreAPIDataSourceDocumentSection { if (title && title.trim()) { @@ -342,6 +346,16 @@ export function renderDocumentTitleAndContent({ if (updatedAt) { c.prefix += `$updatedAt: ${updatedAt.toISOString()}\n`; } + if (author && lastEditor && author === lastEditor) { + c.prefix += `$author: ${author}\n`; + } else { + if (author) { + c.prefix += `$author: ${author}\n`; + } + if (lastEditor) { + c.prefix += `$lastEditor: ${lastEditor}\n`; + } + } if (content) { c.sections.push(content); }