From f50e46facbd67f8b79bdc49eeed19a88fc44605b Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Tue, 28 Jan 2025 20:55:03 -0800 Subject: [PATCH] Fix API request options not being passed in Generative_AI_Service::list_models() implementations. --- includes/Anthropic/Anthropic_AI_Service.php | 2 +- includes/Google/Google_AI_Service.php | 2 +- includes/OpenAI/OpenAI_AI_Service.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/Anthropic/Anthropic_AI_Service.php b/includes/Anthropic/Anthropic_AI_Service.php index 97c0850..3b3d1de 100644 --- a/includes/Anthropic/Anthropic_AI_Service.php +++ b/includes/Anthropic/Anthropic_AI_Service.php @@ -109,7 +109,7 @@ public function is_connected(): bool { * @throws Generative_AI_Exception Thrown if the request fails or the response is invalid. */ public function list_models( array $request_options = array() ): array { - $request = $this->api->create_list_models_request(); + $request = $this->api->create_list_models_request( array(), $request_options ); $response_data = $this->api->make_request( $request )->get_data(); if ( ! isset( $response_data['data'] ) || ! $response_data['data'] ) { diff --git a/includes/Google/Google_AI_Service.php b/includes/Google/Google_AI_Service.php index b44085a..5e383a7 100644 --- a/includes/Google/Google_AI_Service.php +++ b/includes/Google/Google_AI_Service.php @@ -107,7 +107,7 @@ public function is_connected(): bool { * @throws Generative_AI_Exception Thrown if the request fails or the response is invalid. */ public function list_models( array $request_options = array() ): array { - $request = $this->api->create_list_models_request(); + $request = $this->api->create_list_models_request( array(), $request_options ); $response_data = $this->api->make_request( $request )->get_data(); if ( ! isset( $response_data['models'] ) || ! $response_data['models'] ) { diff --git a/includes/OpenAI/OpenAI_AI_Service.php b/includes/OpenAI/OpenAI_AI_Service.php index a12cb82..2d5fdcf 100644 --- a/includes/OpenAI/OpenAI_AI_Service.php +++ b/includes/OpenAI/OpenAI_AI_Service.php @@ -106,7 +106,7 @@ public function is_connected(): bool { * @throws Generative_AI_Exception Thrown if the request fails or the response is invalid. */ public function list_models( array $request_options = array() ): array { - $request = $this->api->create_list_models_request(); + $request = $this->api->create_list_models_request( array(), $request_options ); $response_data = $this->api->make_request( $request )->get_data(); if ( ! isset( $response_data['data'] ) || ! $response_data['data'] ) {