From 4b01cd8f01ad9d24470a3c12911f4bcc76849a57 Mon Sep 17 00:00:00 2001 From: ddebowczyk Date: Sun, 25 Aug 2024 22:17:51 +0200 Subject: [PATCH] Cookbook update --- docs/cookbook/examples/advanced/context_cache.mdx | 8 ++------ examples/02_Advanced/ContextCaching/run.php | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/docs/cookbook/examples/advanced/context_cache.mdx b/docs/cookbook/examples/advanced/context_cache.mdx index aafaf38d..2547f404 100644 --- a/docs/cookbook/examples/advanced/context_cache.mdx +++ b/docs/cookbook/examples/advanced/context_cache.mdx @@ -83,9 +83,7 @@ Let's start by asking the user to describe the project for a specific audience: ```php 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], @@ -102,9 +100,7 @@ which results in faster processing and lower costs. ```php 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], diff --git a/examples/02_Advanced/ContextCaching/run.php b/examples/02_Advanced/ContextCaching/run.php index aafaf38d..2547f404 100644 --- a/examples/02_Advanced/ContextCaching/run.php +++ b/examples/02_Advanced/ContextCaching/run.php @@ -83,9 +83,7 @@ class Project { ```php 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], @@ -102,9 +100,7 @@ class Project { ```php 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],