Skip to content

Commit

Permalink
Ability to decode json as associative array
Browse files Browse the repository at this point in the history
  • Loading branch information
Plytas committed Jan 2, 2025
1 parent 7ba35de commit a6a53bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Responses/GenerativeModel/GenerateContentResponse.php
Original file line number Diff line number Diff line change
@@ -90,9 +90,9 @@ public function text(): string
/**
* A quick accessor equivalent to `json_decode($candidates[0].parts[0].text)`
*/
public function json(): mixed
public function json(bool $associative = false, int $flags = 0): mixed
{
return json_decode($this->text());
return json_decode($this->text(), associative: $associative, flags: $flags);
}

/**

0 comments on commit a6a53bd

Please sign in to comment.