-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Gong) - Add transcripts sync #11231
Conversation
2f5d755
to
e93525e
Compare
3ae9bdc
to
f31e5ba
Compare
f31e5ba
to
a7cad16
Compare
288000b
to
36e025f
Compare
# Conflicts: # connectors/src/connectors/gong/lib/gong_api.ts # connectors/src/connectors/gong/temporal/activities.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once comments have been addressed 🔥
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, | ||
"updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, | ||
"callId" TEXT NOT NULL, | ||
"title" TEXT NOT NULL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can title be bigger than 255 characters?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have occurrences in our gong but I would assume it's not really bounded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's truncate in the resource then.
CREATE INDEX "gong_transcripts_connector_id" ON "gong_transcripts" ("connectorId"); | ||
CREATE UNIQUE INDEX "gong_transcripts_connector_id_call_id" ON "gong_transcripts" ("connectorId", "callId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the first index, the second one (which is a composite index) will also be used when querying only on connectorId
.
folderId: makeGongTranscriptFolderInternalId(connector), | ||
parents: [makeGongTranscriptFolderInternalId(connector)], | ||
parentId: null, | ||
title: "Transcripts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
No magic variable.
export const GongParticipantCodec = t.intersection([ | ||
t.type({ | ||
speakerId: t.union([t.string, t.null]), | ||
userId: t.union([t.string, t.null, t.undefined]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure it can both null or undefined? Feels like a very strange API 😅.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mb it can only be undefined, forgot to clean this up
started: t.string, | ||
duration: t.number, | ||
title: t.string, | ||
media: t.union([t.literal("Video"), t.literal("Audio")]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest removing some fields from here and only keeping the one we use to avoid validation error.
await upsertDataSourceDocument({ | ||
dataSourceConfig, | ||
documentId, | ||
documentContent: await renderDocumentTitleAndContent({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
No await in object, let's extract them.
`language:${transcriptMetadata.metaData.language}`, // The language codes (as defined by ISO-639-2B): eng, fre, spa, ger, and ita. | ||
`media:${transcriptMetadata.metaData.media}`, | ||
`scope:${transcriptMetadata.metaData.scope}`, | ||
...participants.map((p) => p.email), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this lives out the participant that are not internal to the connected Gong's workspace. Can we still include them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm in any case these participants are retrieved using getGongUsers
, meaning they are exposed by Gong's API so I would say it's fine since they are not local to the meeting and exist somewhere in gong
connectors/src/lib/models/gong.ts
Outdated
{ fields: ["connectorId"] }, | ||
{ fields: ["connectorId", "callId"], unique: true }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, one composite index serves the two needs.
{ fields: ["connectorId"] }, | |
{ fields: ["connectorId", "callId"], unique: true }, | |
{ fields: ["connectorId", "callId"], unique: true }, |
@@ -32,6 +36,14 @@ export class GongConnectorStrategy | |||
connector: ConnectorResource, | |||
transaction: Transaction | |||
): Promise<void> { | |||
await GongUserModel.destroy({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙏
|
||
toJSON(): Record<string, unknown> { | ||
return { | ||
id: this.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
Let's add the Gong call id, no?
Description
The transcript are all available under a single folder named "Transcripts", which is not selectable.
A table
gong_transcripts
is added by this PR.The transcripts are synced as follows:
/calls/transcript
endpoint./calls/extensive
endpoint.gong_users
, fetching Gong's API if not in db.data_source_document
is created and upserted.The following tags are attached to the document:
Tests
Risk
Deploy Plan
migration_60.sql
.connectors
.front
.