Skip to content

Commit 8415a1f

Browse files
committed
Add function call part too
1 parent 1f0086f commit 8415a1f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/MCP/Client.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static function () {
150150
]
151151
);
152152

153-
\WP_CLI::log( "Making request..." . print_r( $contents, true ) );
153+
// \WP_CLI::log( "Making request..." . print_r( $contents, true ) );
154154

155155
$candidates = $service
156156
->get_model(
@@ -182,6 +182,11 @@ static function () {
182182
}
183183

184184
$function_result = [ 'result' => $function_result ];
185+
186+
$parts = new Parts();
187+
$parts->add_function_call_part( $part->get_id(), $part->get_name(), $part->get_args() );
188+
$new_contents[] = new Content( Content_Role::MODEL, $parts );
189+
185190
$parts = new Parts();
186191
$parts->add_function_response_part( $part->get_id(),$part->get_name(), $function_result );
187192
$content = new Content( Content_Role::USER, $parts );

0 commit comments

Comments
 (0)