Fix Mentra nested Responses endpoints
This commit is contained in:
@@ -50,10 +50,19 @@ async fn luna_describes_live_renderer_evidence() -> Result<(), Box<dyn Error>> {
|
||||
ContentBlock::image_url(image),
|
||||
])
|
||||
.await?;
|
||||
for block in response.content {
|
||||
if let ContentBlock::Text { text } = block {
|
||||
println!("LIVE_LLM_VISION={text}");
|
||||
}
|
||||
let descriptions = response
|
||||
.content
|
||||
.into_iter()
|
||||
.filter_map(|block| match block {
|
||||
ContentBlock::Text { text } if !text.trim().is_empty() => Some(text),
|
||||
_ => None,
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
if descriptions.is_empty() {
|
||||
return Err("Luna returned no snapshot description".into());
|
||||
}
|
||||
for description in descriptions {
|
||||
println!("LIVE_LLM_VISION={description}");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user