-
Notifications
You must be signed in to change notification settings - Fork 331
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
chore: remove discussion prompt from summary #9711
Merged
nickoferrall
merged 6 commits into
master
from
chore/9710/remove-discussion-prompt-from-summary
May 8, 2024
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6a29060
chore: remove ai summary from discussion thread
nickoferrall 39e6545
remove discussion prompt from summary
nickoferrall 16f2ed3
refactor generate group summaries to generate discussion prompt
nickoferrall 2db042c
show loading in summary if there is more than one reflection
nickoferrall f213bc6
remove summary query from endRetro mutation
nickoferrall 4ee6228
remove promise all
nickoferrall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ import sendToSentry from '../../../utils/sendToSentry' | |
import {DataLoaderWorker} from '../../graphql' | ||
import canAccessAISummary from './canAccessAISummary' | ||
|
||
const generateGroupSummaries = async ( | ||
const generateDiscussionPrompt = async ( | ||
meetingId: string, | ||
teamId: string, | ||
dataLoader: DataLoaderWorker, | ||
|
@@ -30,7 +30,7 @@ const generateGroupSummaries = async ( | |
const pg = getKysely() | ||
const manager = new OpenAIServerManager() | ||
if (!reflectionGroups.length) { | ||
const error = new Error('No reflection groups in generateGroupSummaries') | ||
const error = new Error('No reflection groups in generateDiscussionPrompt') | ||
sendToSentry(error, {userId: facilitator.id, tags: {meetingId}}) | ||
return | ||
} | ||
|
@@ -40,30 +40,21 @@ const generateGroupSummaries = async ( | |
({reflectionGroupId}) => reflectionGroupId === group.id | ||
) | ||
if (reflectionsByGroupId.length <= 1) return | ||
const reflectionTextByGroupId = reflectionsByGroupId.map( | ||
({plaintextContent}) => plaintextContent | ||
) | ||
const [fullSummary, fullQuestion] = await Promise.all([ | ||
manager.getSummary(reflectionTextByGroupId), | ||
const [fullQuestion] = await Promise.all([ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -1 No need to wrap a single call in |
||
manager.getDiscussionPromptQuestion(group.title ?? 'Unknown', reflectionsByGroupId) | ||
]) | ||
if (!fullSummary && !fullQuestion) return | ||
const summary = fullSummary?.slice(0, 2000) | ||
if (!fullQuestion) return | ||
const discussionPromptQuestion = fullQuestion?.slice(0, 2000) | ||
return Promise.all([ | ||
pg | ||
.updateTable('RetroReflectionGroup') | ||
.set({summary, discussionPromptQuestion}) | ||
.set({discussionPromptQuestion}) | ||
.where('id', '=', group.id) | ||
.execute(), | ||
r | ||
.table('RetroReflectionGroup') | ||
.get(group.id) | ||
.update({summary, discussionPromptQuestion}) | ||
.run() | ||
r.table('RetroReflectionGroup').get(group.id).update({discussionPromptQuestion}).run() | ||
]) | ||
}) | ||
) | ||
} | ||
|
||
export default generateGroupSummaries | ||
export default generateDiscussionPrompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If there's more than one reflection, we'll always create the meeting summary unless
noAISummary
is true, so we don't need to check if there's a discussion summary or reflection group summary (which is now removed anyway)