Skip to content

Commit

Permalink
Cookbook update
Browse files Browse the repository at this point in the history
  • Loading branch information
ddebowczyk committed Aug 25, 2024
1 parent 1f35ab0 commit 4b01cd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions docs/cookbook/examples/advanced/context_cache.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ Let's start by asking the user to describe the project for a specific audience:
```php
<?php
$project = $cached->respond(
messages: [
['role' => 'user', 'content' => 'Describe the project - my audience is P&C insurance CIOs'],
],
messages: 'Describe the project - my audience is P&C insurance CIOs',
mode: Mode::Json,
responseModel: Project::class,
options: ['max_tokens' => 4096],
Expand All @@ -102,9 +100,7 @@ which results in faster processing and lower costs.
```php
<?php
$project = $cached->respond(
messages: [
['role' => 'user', 'content' => 'Describe the project - my audience is boutique CMS consulting company owner'],
],
messages: 'Describe the project - my audience is boutique CMS consulting company owner',
mode: Mode::Json,
responseModel: Project::class,
options: ['max_tokens' => 4096],
Expand Down
8 changes: 2 additions & 6 deletions examples/02_Advanced/ContextCaching/run.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ class Project {
```php
<?php
$project = $cached->respond(
messages: [
['role' => 'user', 'content' => 'Describe the project - my audience is P&C insurance CIOs'],
],
messages: 'Describe the project - my audience is P&C insurance CIOs',
mode: Mode::Json,
responseModel: Project::class,
options: ['max_tokens' => 4096],
Expand All @@ -102,9 +100,7 @@ class Project {
```php
<?php
$project = $cached->respond(
messages: [
['role' => 'user', 'content' => 'Describe the project - my audience is boutique CMS consulting company owner'],
],
messages: 'Describe the project - my audience is boutique CMS consulting company owner',
mode: Mode::Json,
responseModel: Project::class,
options: ['max_tokens' => 4096],
Expand Down

0 comments on commit 4b01cd8

Please sign in to comment.