mirror of
https://github.com/katanemo/plano.git
synced 2026-05-01 11:56:29 +02:00
making Messages.Content optional, and having the upstream LLM fail if the right fields aren't set (#699)
Co-authored-by: Salman Paracha <salmanparacha@MacBook-Pro-342.local>
This commit is contained in:
parent
626f556cc6
commit
cdc1d7cee2
17 changed files with 294 additions and 133 deletions
|
|
@ -188,7 +188,7 @@ pub fn convert_openai_message_to_anthropic_content(
|
|||
|
||||
// Handle regular content
|
||||
match &message.content {
|
||||
MessageContent::Text(text) => {
|
||||
Some(MessageContent::Text(text)) => {
|
||||
if !text.is_empty() {
|
||||
blocks.push(MessagesContentBlock::Text {
|
||||
text: text.clone(),
|
||||
|
|
@ -196,7 +196,7 @@ pub fn convert_openai_message_to_anthropic_content(
|
|||
});
|
||||
}
|
||||
}
|
||||
MessageContent::Parts(parts) => {
|
||||
Some(MessageContent::Parts(parts)) => {
|
||||
for part in parts {
|
||||
match part {
|
||||
ContentPart::Text { text } => {
|
||||
|
|
@ -212,6 +212,7 @@ pub fn convert_openai_message_to_anthropic_content(
|
|||
}
|
||||
}
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
|
||||
// Handle tool calls
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue