-
Notifications
You must be signed in to change notification settings - Fork 0
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
v0.5.0 Release #11
Merged
v0.5.0 Release #11
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 `Options` are now copy and all call sites take by value. There are too many cases where it's useful to modify the options within a call to a `ToMarkdown` method and it's small enough to be faster this way. - Option for `heading_level` added. - Option for `attrs` added. This adds a `role` attr to the header. Mostly useful for conversion from the markdown stream to HTML.
- `Key` encryption is now an optional feature. The `Key` is still always zeroized. - Conversion from a `Vec<u8>` and array has been removed because it would allow bypassing the invariant that the inner value is utf-8, causing a panic on display. - Use `Zeroizing` wrapper for input to make it impossible to forget to `zeroize()`.
- The `key::Arr` type is no longer useful in the public interface because our only constructor is from a `String`.
- Remove a few unused things the compiler would have elided anyway.
- Add `html` feature and module for rendering the prompt and messages to `Html`. The same options as `markdown` are used and it requires this feature. - For the moment, base64 encoded images are not converted to HTML because `pulldown_cmark` does not officially support this. This crate implements the images in markdown with our own markdown rendering for that bit and will require special handling of the stream or some other solution. Images will still be included, but as markdown *in* html. Whether this is rendered or not depends on what the caller does with the Html.
- Move the unencrypted and encrypted implementations of `Key` into the `key` module.
- The `len` method on `Content` and `Message` now returns the number of bytes in the text and images. It does not include metadata or tool calls. This is mostly to help detect `Message`s which before was more cumbersome.
- Merging deltas is easy because they're strings but appending them to content is not so easy because tool use's input type is a `serde_json::Value`. This allows such merges **so long as the delta is a complete json object**. We do this to guarantee input is always valid json. However Anthropic does not currently guarantee this. Therefore it's recommended to merge such deltas manually or add complete json objects. Additions to `Stream` may be made to streamline this.
This is very important.
- The crate is now tested with no features, each feature individually, and all features together. Some breakage was fixed in testing. - `prompt-caching` feature now works without the `image` feature which was a bug. With CI this shouldn't be possible again.
- It was not a good idea to override it. Rendering attributes should be optional.
- Which causes CI to fail because we fail on warnings. Removed conditional compilation gates when `prompt-caching` feature is enabled. The API will return an error if it doesn't work anyway.
Fix "len without is_empty" errors.
Which fails to format when there is trailing whitespace, which is very very silly.
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.
This release is mostly minor breaking changes and bug fixes. The features being added are mostly Markdown rendering enhancements and a
ToHtml
trait for anything implementingToMarkdown
.