Skip to content

Commit

Permalink
Fix API request options not being passed in Generative_AI_Service::li…
Browse files Browse the repository at this point in the history
…st_models() implementations.
  • Loading branch information
felixarntz committed Jan 29, 2025
1 parent 40c4351 commit f50e46f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/Anthropic/Anthropic_AI_Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/Google/Google_AI_Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/OpenAI/OpenAI_AI_Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) {
Expand Down

0 comments on commit f50e46f

Please sign in to comment.