MCPcopy Create free account
hub / github.com/AI45Lab/Code / last_text

Function last_text

core/src/tools/task.rs:1612–1625  ·  view source on GitHub ↗
(messages: &[Message])

Source from the content-addressed store, hash-verified

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

Callers 2

pre_analysis_responseFunction · 0.85
completeMethod · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected