Skip to content

[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
v4/2-tool-calls-follow-the-ai-sdkfrom
v4/p3-messages
Closed

cunninghamcard-bit wants to merge 1 commit into
v4/2-tool-calls-follow-the-ai-sdkfrom
v4/p3-messages

Conversation

@cunninghamcard-bit

Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change
  • New provider
  • New / updated binding
  • Docs / RFC

Checklist

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes (cassette playback — no network/keys)
  • Added or updated cassette tests / contract fixtures for behavior changes
  • Updated relevant docs (README.md, docs/, rfc/, bindings/README.md)
  • Commit messages follow Conventional Commits

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 --workspace has not been run on this branch yet.


🤖 Generated with Claude Code

https://claude.ai/code/session_01A3WxDBWBA4ituJjXsHaEAa

🤖 Generated with Claude Code

…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
@cunninghamcard-bit cunninghamcard-bit self-assigned this Oct 12, 2026
@cunninghamcard-bit cunninghamcard-bit changed the title [V4 3/8] refactor(core)!: messages, content, provider options and prompts follow the AI SDK V4 types [v4/p3-messages] refactor(core)!: messages, content, provider options and prompts follow the AI SDK V4 types Oct 12, 2026
@cunninghamcard-bit
cunninghamcard-bit deleted the v4/p3-messages branch October 12, 2026 10:43
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