My motoko implementation is based on this workaround which was linked with the usage of the streaming function in agent-js proxy.
let is_streaming = http_response.streaming_strategy.is_some();
let response = if let Some(streaming_strategy) = http_response.streaming_strategy {
However above piece of code and function does not exist anymore in main branch of agent-rs.