Skip to content

Commit 3f1cdf8

Browse files
committed
minor #644 Smaller CS fixes in examples (chr-hertel)
This PR was merged into the main branch. Discussion ---------- Smaller CS fixes in examples | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | | License | MIT Commits ------- 6758ae5 Smaller CS fixes in examples
2 parents e305bee + 6758ae5 commit 3f1cdf8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

examples/gemini/toolcall.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
require_once dirname(__DIR__).'/bootstrap.php';
2222

2323
$platform = PlatformFactory::create(env('GEMINI_API_KEY'), http_client());
24-
$llm = new Gemini(Gemini::GEMINI_2_FLASH);
24+
$model = new Gemini(Gemini::GEMINI_2_FLASH);
2525

2626
$toolbox = new Toolbox([new Clock()], logger: logger());
2727
$processor = new AgentProcessor($toolbox);
28-
$agent = new Agent($platform, $llm, [$processor], [$processor], logger: logger());
28+
$agent = new Agent($platform, $model, [$processor], [$processor], logger: logger());
2929

3030
$messages = new MessageBag(Message::ofUser('What time is it?'));
3131
$result = $agent->call($messages);

examples/ollama/stream.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@
2424
Message::ofUser('Tina has one brother and one sister. How many sisters do Tina\'s siblings have?'),
2525
);
2626

27-
// Stream the response
2827
$result = $platform->invoke($model, $messages, ['stream' => true]);
29-
// Emit each chunk as it is received
3028

31-
foreach ($result->getResult()->getContent() as $chunk) {
32-
echo $chunk;
29+
foreach ($result->getResult()->getContent() as $word) {
30+
echo $word;
3331
}
3432
echo \PHP_EOL;

0 commit comments

Comments
 (0)