Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⏭️ Performance benchmarks were skippedPerf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to To run them on this PR, do any of the following, then push a commit (or re-run CI):
|
Binary size checks passed✅ 7 passed
Generated by |
What changed
ai.Prompt.messages()instead of flattening media into readable placeholders.sys_llmprovider capabilities: Gemini supports all four media kinds; OpenAI and Anthropic support image/audio/PDF and return an explicit error for video.Why
The new stdlib clients consumed the readable
PromptMessage.contentprojection. That converted BAML media values into placeholder text before provider request construction, so LLM functions withimage,audio,video, orpdfinputs could not send the media to the model. The clients now consume ordered structural prompt parts and lower each media value at the provider boundary.Impact
BAML LLM functions using media input types now work through the new stdlib provider clients. Existing readable prompt inspection remains unchanged through
PromptMessage.contentandPrompt.text().Validation
cargo fmt --all -- --checkcargo nextest run -p baml_tests -E 'test(~__ai_std__)'cargo nextest run -p baml_tests --test promptast_accessors --test structured_prompt_requestscargo nextest run -p baml_builtins2 -p bex_vmNote
Medium Risk
Changes provider request construction and media resolution (file I/O and HTTP fetches) across OpenAI, Anthropic, and Gemini clients. Readable prompt inspection is unchanged, but incorrect lowering could send malformed multimodal payloads.
Overview
Media inputs now reach the model through stdlib LLM clients instead of being flattened into readable placeholders before request construction.
PromptMessagegains a structuralpartsfield (string | MediaPart). RustPromptAstexposesto_structured_messages()so media survivesmessages(), whilecontent/text()stay as the readable projection.Adds shared
ai.wire.resolve_mediato resolve local files, base64/data URLs, HTTP(S) fetches, MIME types, andgs://URLs before provider lowering.OpenAI Responses, Anthropic Messages, and Gemini now lower those parts into native request shapes. Gemini accepts all four media kinds; OpenAI and Anthropic accept image/audio/PDF and reject video.
Reviewed by Cursor Bugbot for commit bf12bcd. Bugbot is set up for automated code reviews on this repo. Configure here.