Function: isAssistantMessage()
@providerprotocol/ai / @providerprotocol/ai / isAssistantMessage
Function: isAssistantMessage()
Section titled “Function: isAssistantMessage()”isAssistantMessage(
msg):msg is AssistantMessage
Defined in: src/types/messages.ts:382
Type guard for AssistantMessage.
Parameters
Section titled “Parameters”The message to check
Returns
Section titled “Returns”msg is AssistantMessage
True if the message is an AssistantMessage
Example
Section titled “Example”if (isAssistantMessage(msg)) { console.log('Assistant said:', msg.text); if (msg.hasToolCalls) { console.log('Tool calls:', msg.toolCalls); }}