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

Change memo to no longer replay streams #243

Merged
merged 2 commits into from
Aug 23, 2023
Merged

Change memo to no longer replay streams #243

merged 2 commits into from
Aug 23, 2023

Conversation

petersalas
Copy link
Contributor

  • Change the behavior of memo so that it only yields the most recently rendered frame, rather than replaying the entire stream. When combined with non-append-only streams + partial rendering the previous behavior could cause an exponential blowup in the number of frames.
  • Change AI.AppendOnlyStream to be a function that takes a Node so that converting a stream to append-only does not require an extra yield (i.e. an extra frame).
  • Change partial rendering to memoize returned elements, instead of simply binding the context, and remove the now-unneeded memos in conversation.tsx accordingly.
  • Source the memoized ID from the render context so that it (can be) deterministic within a single RenderContext
  • Add unit tests for memoize.tsx.

@vercel
Copy link

vercel bot commented Aug 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ai-jsx-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2023 7:21pm
ai-jsx-nextjs-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2023 7:21pm
ai-jsx-tutorial-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 23, 2023 7:21pm

Copy link
Contributor

@NickHeiner NickHeiner left a comment

Choose a reason for hiding this comment

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

I verified that this works in Sidekick HS.

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