mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 01:40:21 +08:00
fix(ai): allow null OpenAI Responses error fields
This commit is contained in:
@@ -29,7 +29,9 @@ pub fn to_compact(response: &CanonicalResponse, ctx: &FormatContext) -> Option<V
|
||||
|
||||
pub fn from_raw(body_json: &Value) -> Option<CanonicalResponse> {
|
||||
let body = body_json.as_object()?;
|
||||
if body.contains_key("error") || body.get("status").and_then(Value::as_str) == Some("failed") {
|
||||
if body.get("error").is_some_and(|error| !error.is_null())
|
||||
|| body.get("status").and_then(Value::as_str) == Some("failed")
|
||||
{
|
||||
return None;
|
||||
}
|
||||
let content = openai_responses_output_to_canonical_blocks(body.get("output"))?;
|
||||
|
||||
Reference in New Issue
Block a user