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

feat(ai/rsc): Implement bulked AI actions #1108

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat(ai/rsc): Implement bulked AI actions #1108

wants to merge 1 commit into from

Conversation

shuding
Copy link
Member

@shuding shuding commented Mar 5, 2024

This PR implements bulked AI action calls.

Currently if we have (note that action calls don't have await):

action1() // (state, action1) -> (diff, result); state = state + diff;
action2() // (state, action2) -> (diff, result); state = state + diff;
action3() // (state, action3) -> (diff, result); state = state + diff;

They will still be 3 sequential requests (also there's a bug regarding AI state in that case) mostly because the hidden state always depends on the previous response's diff.

With this PR, it will behave like:

action1() // (state, action1) -> (diff, result); state = state + diff;
action2() // (state, action2) -> queued
action3() // (state, action3) -> queued

    queue // (state, [action2, action3]) -> (diff, [result2, result3]); state = state + diff;

When the first one is executing, 2 and 3 will be queued and then sent together as one request and receive the results all together.

@shuding shuding changed the title feat: Implement bulked AI actions feat(ai/rsc): Implement bulked AI actions Mar 25, 2024
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.

None yet

1 participant