Skip to content

Add prompt cache key argument + other updates#262

Open
Ankur Goyal (ankrgyl) wants to merge 1 commit into
mainfrom
prompt-cache-key-updates
Open

Add prompt cache key argument + other updates#262
Ankur Goyal (ankrgyl) wants to merge 1 commit into
mainfrom
prompt-cache-key-updates

Conversation

@ankrgyl
Copy link
Copy Markdown
Contributor

  • 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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +411 to +413
generated::MessageRole::System => Ok(Message::System {
content: anthropic_system_message_content(input_msg.content)?,
}),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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.

1 participant