Handle ChatGPT subscription metadata without aborting streams
This commit is contained in:
@@ -160,6 +160,13 @@ where
|
||||
});
|
||||
}
|
||||
Ok(StreamedAssistantContent::Unknown(value)) => {
|
||||
// ChatGPT subscription streams include informational moderation
|
||||
// metadata that Rig does not map to assistant content.
|
||||
if value.get("type").and_then(serde_json::Value::as_str)
|
||||
== Some("response.metadata")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if is_keepalive_event(&value) {
|
||||
yield Ok(AgentEvent::KeepAlive);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user