-
Notifications
You must be signed in to change notification settings - Fork 72
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
semantic streaming #1293
Merged
Merged
semantic streaming #1293
Conversation
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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
imalsogreg
force-pushed
the
greg/semantic-streaming
branch
from
January 7, 2025 20:23
c8d10ad
to
aab008a
Compare
imalsogreg
force-pushed
the
greg/semantic-streaming
branch
from
January 13, 2025 19:14
9f3d137
to
c5875e8
Compare
imalsogreg
force-pushed
the
greg/semantic-streaming
branch
from
January 18, 2025 16:05
7f691bd
to
7b2d28b
Compare
imalsogreg
force-pushed
the
greg/semantic-streaming
branch
from
January 28, 2025 18:20
f5faf1c
to
c351da1
Compare
imalsogreg
force-pushed
the
greg/semantic-streaming
branch
from
January 28, 2025 19:02
c351da1
to
4b77aa2
Compare
Generated with ❤️ by ellipsis.dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add semantic streaming.
Some tricky things about this PR:
ResponseBamlValue
to wrapBamlValueWithMeta<T>
whereT
can hold all this extra data.BamlValueWithMeta
has a newdistribute_type_with_meta
method, which traverses aBamlValue
in parallel with itsFieldType
. This traversal is the key thing that allows us to analyze each field of a nestedBamlValue
with respect to its expected streaming behavior.distribute_type_with_meta
is conceptually simple but contains a number of difficult edge cases, especially when dealing with nested types and recursive type aliases.partial
andcomplete
types, the@stream.done
annotation allows for the creation of types that combine parts fromcomplete
andpartial
codegen'd modules. The resulting Frankentypes are harder to target from the FFI. Functions likecast_to
require visibility into both the complete and partial modules, and we have to threadallow_partials
through the traversal of a BamlValue during serialization, andallow_partials
may change when we reach adone
node in an otherwise partial context.