Skip to content
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

Batch render user/agent messages & content fragments #2681

Merged
merged 7 commits into from
Nov 28, 2023

Conversation

PopDaph
Copy link
Contributor

@PopDaph PopDaph commented Nov 27, 2023

No description provided.

@PopDaph PopDaph force-pushed the batch-render-user-message branch from 743ad37 to 32ad485 Compare November 27, 2023 15:41
@PopDaph PopDaph marked this pull request as ready for review November 27, 2023 15:43
const agents = (
await Promise.all(
agentConfigurationIds.map(async (agentConfigId) => {
return await getAgentConfiguration(auth, agentConfigId);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a shortcut here, WDYT? I think it's worth shipping with it and iterate if we want to optimize again.

);
return await Promise.all(
agentRetrievalActionIds.map(async (agentRetrievalActionId) => {
return await renderRetrievalActionByModelId(agentRetrievalActionId);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same kind of shortcut here!

@PopDaph PopDaph changed the title Batch render user messages Batch render user/agent messages & content fragments Nov 27, 2023
@PopDaph PopDaph force-pushed the batch-render-user-message branch from 141aa77 to d2de821 Compare November 28, 2023 11:48
@PopDaph PopDaph force-pushed the batch-render-user-message branch from 10d62aa to 763d715 Compare November 28, 2023 12:18
spolu
spolu previously approved these changes Nov 28, 2023
Copy link
Contributor

@spolu spolu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -498,6 +498,9 @@ Message.init(
unique: true,
fields: ["conversationId", "rank", "version"],
},
{
fields: ["conversationId"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be covered by the index above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed it and instead I updated the query to fetch the reactions to load only the sId of messages, which is the only field we use.

@PopDaph PopDaph force-pushed the batch-render-user-message branch from b530934 to 1ef9172 Compare November 28, 2023 12:58
@PopDaph PopDaph merged commit 697dbec into main Nov 28, 2023
3 checks passed
@PopDaph PopDaph deleted the batch-render-user-message branch November 28, 2023 14:17
PopDaph added a commit that referenced this pull request Nov 28, 2023
PopDaph added a commit that referenced this pull request Nov 28, 2023
@PopDaph PopDaph restored the batch-render-user-message branch November 28, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants