Skip to content

Trying to access array offset on value of type null #5

@cschalenborgh

Description

@cschalenborgh

Hi,

I get the following error when I run a very simple get_answer() function:

ErrorException

 Trying to access array offset on value of type null

 at vendor/adityadees/laravel-google-bard/src/LaravelBard.php:135
   131▕             return ["content" => "Response Error: " . $resp . "."];
   132▕         }
   133▕         $parsed_answer = json_decode($resp_dict, true);
   134▕         $bard_answer = [
 ➜ 135▕             "content" => $parsed_answer[0][0],
   136▕             "conversation_id" => $parsed_answer[1][0],
   137▕             "response_id" => $parsed_answer[1][1],
   138▕             "factualityQueries" => $parsed_answer[3],
   139▕             "textQuery" => $parsed_answer[2][0] ?? "",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions