AgentResponseExtensions
NexusLabs.Needlr.AgentFramework¶
NexusLabs.Needlr.AgentFramework¶
AgentResponseExtensions Class¶
Convenience extensions for Microsoft.Agents.AI.AgentResponse.
Inheritance System.Object 🡒 AgentResponseExtensions
Methods¶
AgentResponseExtensions.GetText(this AgentResponse) Method¶
Extracts the concatenated text content from all messages in the response. Returns null if the response has no messages or all messages have empty text.
Parameters¶
response Microsoft.Agents.AI.AgentResponse
Returns¶
Remarks¶
MAF's Microsoft.Agents.AI.AgentResponse.Messages can contain multiple
Microsoft.Extensions.AI.ChatMessage entries (e.g., tool-call results
interleaved with assistant text). This method concatenates only the non-empty
Text properties, separated by newlines, into a single string.
Typical usage for standalone agent runs: