Skip to content

Commit bfd52e0

Browse files
committed
fix(Generator): Hydrate data with JSON_THROW_ON_ERROR
- Decode data with JSON_THROW_ON_ERROR - Get text from rowResponse
1 parent cb4f0dc commit bfd52e0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ai-commit.tape

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Require php
5252

5353
Set Framerate 120
5454
Set FontSize 18
55-
Set Width 1000
56-
Set Height 618
55+
Set Width 1400
56+
Set Height 865
5757
Set TypingSpeed 100ms
5858
Set PlaybackSpeed 0.1
5959

app/Generators/OpenAIGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function generate(string $prompt): string
7272
}
7373

7474
// (正常|错误|流)响应
75-
$rowResponse = (array) json_decode($this->openAI::hydrateData($data), true, 512, JSON_THROW_ON_ERROR);
75+
$rowResponse = (array) json_decode($this->openAI::hydrateData($data), true);
7676
$messages .= $text = Arr::get($rowResponse, 'choices.0.text', '');
7777
$output->write($text);
7878
});

0 commit comments

Comments
 (0)