Executes all ability function calls in a message.
Parameters
$messageWordPressAiClientMessagesDTOMessagerequired- The message containing function calls.
Source
public function execute_abilities( Message $message ): Message {
$response_parts = array();
foreach ( $message->getParts() as $part ) {
if ( $part->getType()->isFunctionCall() ) {
$function_call = $part->getFunctionCall();
if ( $function_call instanceof FunctionCall ) {
$function_response = $this->execute_ability( $function_call );
$response_parts[] = new MessagePart( $function_response );
}
}
}
return new UserMessage( $response_parts );
}
Changelog
| Version | Description |
|---|---|
| 7.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.