(messages: &[Message])
| 1610 | } |
| 1611 | |
| 1612 | fn last_text(messages: &[Message]) -> String { |
| 1613 | messages |
| 1614 | .last() |
| 1615 | .and_then(|message| { |
| 1616 | message.content.iter().find_map(|block| { |
| 1617 | if let ContentBlock::Text { text } = block { |
| 1618 | Some(text.clone()) |
| 1619 | } else { |
| 1620 | None |
| 1621 | } |
| 1622 | }) |
| 1623 | }) |
| 1624 | .unwrap_or_default() |
| 1625 | } |
| 1626 | |
| 1627 | /// Client for the schema-coercion tests. The agent's own turn returns |
| 1628 | /// plain text (which ends the loop); the structured-output coercion call |
no test coverage detected