Make serialization backwards-compatible for collab server (#27626)

Sets up the collab server to accept the format of system message that
we'll introduce later for [prompt
caching](https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching).

Release Notes:

- N/A
This commit is contained in:
Richard Feldman 2025-03-27 18:20:10 -04:00 committed by GitHub
parent 6550a96e15
commit 85740ddaa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

View file

@ -586,7 +586,11 @@ pub fn into_anthropic(
model,
messages: new_messages,
max_tokens: max_output_tokens,
system: Some(system_message),
system: if system_message.is_empty() {
None
} else {
Some(anthropic::StringOrContents::String(system_message))
},
thinking: if let AnthropicModelMode::Thinking { budget_tokens } = mode {
Some(anthropic::Thinking::Enabled { budget_tokens })
} else {