Skip to content

Commit 1163c9f

Browse files
committed
Use the full schema declaration for JSON
1 parent b3a0d9c commit 1163c9f

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

docs/ARCHITECTURE.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,22 @@ _Note: Unlike the previous two examples, to require JSON output it is necessary
215215

216216
##### Fluent API
217217
```php
218-
// Verbose.
219218
$text = AiClient::prompt('Transform the following CSV content into a JSON array of row data.')
220219
->asJsonResponse()
221-
->usingOutputSchema(['name' => 'string', 'age' => 'integer'])
222-
->generateText();
223-
224-
// Simple.
225-
$text = AiClient::prompt('Transform the following CSV content into a JSON array of row data.')
226-
->asJsonResponse(['name' => 'string', 'age' => 'integer'])
220+
->usingOutputSchema([
221+
'type' => 'array',
222+
'items' => [
223+
'type' => 'object',
224+
'properties' => [
225+
'name' => [
226+
'type' => 'string',
227+
],
228+
'age' => [
229+
'type' => 'integer',
230+
],
231+
],
232+
],
233+
])
227234
->generateText();
228235
```
229236

0 commit comments

Comments
 (0)