Add prompt cache key argument + other updates#262
Conversation
Ankur Goyal (ankrgyl)
commented
May 30, 2026
- Add prompt cache key to universal params
- Pull updated openai and anthropic specs. Anthropic had some new features: system role, mid_conv_system, url_not_in_prior_context, and output token details.
- Regenerate typescript bindings
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16dc5bbd5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
| generated::MessageRole::System => Ok(Message::System { | ||
| content: anthropic_system_message_content(input_msg.content)?, | ||
| }), |
There was a problem hiding this comment.
Preserve mid-conversation system placement
When an Anthropic request includes a new role: "system" / mid_conv_system message after a user turn, this imports it as an ordinary Message::System. The Anthropic exporter later calls extract_system_messages and removes all Message::System values from their original positions into the top-level system field, so any path that re-emits from universal without the raw Anthropic extras changes a mid-conversation instruction into a leading system prompt or merges it with the initial prompt. Since this commit adds support for mid-conversation system blocks, the import needs a placement-preserving representation or the exporter needs to emit Anthropic's mid-conversation shape.
Useful? React with 👍 / 👎.