@@ -41,8 +41,7 @@ composer require alvincoded/grok-php-client
41
41
42
42
## Quick Start
43
43
44
- __ Here's how simple it is to use Grok PHP :__
45
- <br >
44
+ > ** Here's how simple it is to use Grok PHP :**
46
45
47
46
#### _ Chat Completion_
48
47
@@ -181,13 +180,15 @@ echo $config->modelSupportsFunctions($model) // false
181
180
```
182
181
183
182
#### _ Structured Output_
184
-
185
183
``` php
186
184
<?php
187
185
188
186
use GrokPHP\Client\GrokClient;
189
187
use GrokPHP\Enums\Model;
190
188
189
+ // Scenario example: A university library needs to process 50,000 research papers into their new digital repository.
190
+ // Each entry requires consistent metadata fields.
191
+
191
192
// 1. Define schema once
192
193
$jsonSchema = [
193
194
"type" => "object",
@@ -232,8 +233,8 @@ class ResearchPaper extends \GrokPHP\Utils\DataModel
232
233
#[SchemaProperty(type: 'array', description: 'List of authors')]
233
234
public array $authors;
234
235
235
- #[SchemaProperty(type: 'string ', description: 'Abstract text' )]
236
- public string $abstract ;
236
+ #[SchemaProperty(type: 'integer ', description: 'Year of publication', required: false )]
237
+ public int $publicationYear ;
237
238
}
238
239
239
240
// ...then, in your application code
@@ -322,6 +323,7 @@ try {
322
323
<br >
323
324
324
325
## Environment Variables
326
+ Add the following to your ` .env ` file:
325
327
```
326
328
GROK_API_KEY=your-api-key
327
329
```
@@ -356,4 +358,4 @@ If you encounter any issues or have questions, please [open an issue](https://gi
356
358
---
357
359
</br >
358
360
359
- <p align =' center ' >Built with ❤️ for the AI community.</p >
361
+ <p align =' center ' >Built with ❤️ for the AI community.</p >
0 commit comments