@@ -41,8 +41,7 @@ composer require alvincoded/grok-php-client
4141
4242## Quick Start
4343
44- __ Here's how simple it is to use Grok PHP :__
45- <br >
44+ > ** Here's how simple it is to use Grok PHP :**
4645
4746#### _ Chat Completion_
4847
@@ -181,13 +180,15 @@ echo $config->modelSupportsFunctions($model) // false
181180```
182181
183182#### _ Structured Output_
184-
185183``` php
186184<?php
187185
188186use GrokPHP\Client\GrokClient;
189187use GrokPHP\Enums\Model;
190188
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+
191192// 1. Define schema once
192193$jsonSchema = [
193194 "type" => "object",
@@ -232,8 +233,8 @@ class ResearchPaper extends \GrokPHP\Utils\DataModel
232233 #[SchemaProperty(type: 'array', description: 'List of authors')]
233234 public array $authors;
234235
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 ;
237238}
238239
239240// ...then, in your application code
@@ -322,6 +323,7 @@ try {
322323<br >
323324
324325## Environment Variables
326+ Add the following to your ` .env ` file:
325327```
326328GROK_API_KEY=your-api-key
327329```
@@ -356,4 +358,4 @@ If you encounter any issues or have questions, please [open an issue](https://gi
356358---
357359</br >
358360
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