Repository navigation
This release fixes how AnyLanguageModel sends instructions to Anthropic and Gemini. Both providers used to get a session's instructions as a user message, so the model read them as something the user said. AnthropicLanguageModel now sends them in the top-level system field (#433), and GeminiLanguageModel sends them in systemInstruction (#436). Sessions with instructions can respond differently than they did in 1.4.0. For Anthropic, a system value that you set in extraBody still wins.
OpenAILanguageModel now sorts the keys of every request body at every level, so the same request always encodes to the same bytes, and the prompt prefix stays stable for prompt caching (#432, #437).
Thanks to @shura-v for the clear report and reproduction in #431, and to @gtokman for sorting the request keys (#432).
What's Changed
- Send Anthropic instructions in the top-level system field by @mattt in #433
- Allow extra Foundation Models evaluations in a native session test by @mattt in #434
- Tell native evaluations of dynamic instructions from ours in a test by @mattt in #435
- OpenAI: sort request body keys so prompt caches can hit by @gtokman in #432
- Send Gemini instructions in the systemInstruction field by @mattt in #436
- Test sorted keys in recorded OpenAI request bodies by @mattt in #437
- Bump README install snippets to 1.4.1 by @mattt in #438
Full Changelog: 1.4.0...1.4.1