Checks if a message contains any ability function calls.
Parameters
$messageWordPressAiClientMessagesDTOMessagerequired- The message to check.
Source
public function has_ability_calls( Message $message ): bool {
foreach ( $message->getParts() as $part ) {
if ( $part->getType()->isFunctionCall() ) {
$function_call = $part->getFunctionCall();
if ( $function_call instanceof FunctionCall && $this->is_ability_call( $function_call ) ) {
return true;
}
}
}
return false;
}
Changelog
| Version | Description |
|---|---|
| 7.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.