diff --git a/rig-core/src/providers/openai.rs b/rig-core/src/providers/openai.rs index 2beb20e4..27cb3b08 100644 --- a/rig-core/src/providers/openai.rs +++ b/rig-core/src/providers/openai.rs @@ -375,17 +375,6 @@ impl TryFrom for completion::CompletionResponse std::prelude::v1::Result { match value.choices.as_slice() { - [Choice { - message: - Message { - content: Some(content), - .. - }, - .. - }, ..] => Ok(completion::CompletionResponse { - choice: completion::ModelChoice::Message(content.to_string()), - raw_response: value, - }), [Choice { message: Message { @@ -406,6 +395,17 @@ impl TryFrom for completion::CompletionResponse Ok(completion::CompletionResponse { + choice: completion::ModelChoice::Message(content.to_string()), + raw_response: value, + }), _ => Err(CompletionError::ResponseError( "Response did not contain a message or tool call".into(), )),