Repository navigation
[v4/p3-messages] refactor(core)!: messages, content, provider options and prompts follow the AI SDK V4 types - #237
Closed
cunninghamcard-bit wants to merge 1 commit into
Closed
cunninghamcard-bit wants to merge 1 commit into
cunninghamcard-bit wants to merge 1 commit into
Conversation
…ow the AI SDK V4 types - Content: one source, file and reasoning type per layer. A source is a url source or a document source; file citations and grounding documents map to document sources. The missing upstream content variants and usage fields are added. - Provider options and provider metadata have one typed shape. Vendor packages build and read them; a provider option that is not an object is an error, unknown keys no longer leak, and option parse errors surface for Cohere, Google and Mistral. Bedrock reads amazonBedrock before bedrock. - The provider prompt is modelled by role with one file part. Part tags use upstream's hyphenated names; references, files and tool output convert as upstream does, and file parts keep upstream's media-type and text-data rules. - The #226 decision adapters and Jev follow the typed options, metadata and split usage types. - Hand-written tests that built provider prompts by hand or pinned Rust-only behaviour are deleted; ported upstream tests are restored. FFI, bindings and their generated types follow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa
4 of 12 tasks
9 of 12 tasks
This file contains hidden or 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
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.
Requested by li
Summary
Before: core content, provider options, provider metadata and the provider prompt each have aimux-specific shapes, and vendors read options as untyped JSON.
After: one source, file and reasoning type per layer; a source is a url source or a document source. Provider options and metadata have one typed shape that each vendor package builds and reads; a non-object option is an error and unknown keys no longer leak. The provider prompt is modelled by role with one file part, using upstream's hyphenated part tags, and references, files and tool output convert as upstream does. FFI, bindings and their generated types follow.
Type of change
Checklist
cargo fmt --all -- --checkpassescargo clippy --workspace --all-targets -- -D warningspassescargo test --workspacepasses (cassette playback — no network/keys)README.md,docs/,rfc/,bindings/README.md)Notes for reviewers
Status: Draft, opened early so the series layout can be reviewed. The items under "Planned in follow-up pushes" land on this branch before it is marked ready.
cargo test --workspacehas not been run on this branch yet.standardize_prompt; coreContentPartwith 11 types, separate from the V4 content;Reasoning.signatureremoved; router and error-variant tests restored.ToolChoiceViolationand empty-argument lines; part 2 Q1 scope and §3.5 tracing note.🤖 Generated with Claude Code
https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa
🤖 Generated with Claude Code