PHP code example of projectsaturnagents / good-buddy
1. Go to this page and download the library: Download projectsaturnagents/good-buddy library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
projectsaturnagents / good-buddy example snippets
use Agents\GoodBuddy\Agents\Sample\OpenWeatherChatBot;
// Initialize your agent
$agent = OpenWeatherChatBot::onConnection('anthropic')
->whereModel('claude-sonnet-4-20250514')
->whereSessionId('session-id-123')
->first();
// Set configurations that aren't already hardcoded (or overwrite them)
$agent = $agent->setMaxTokens($max_tokens)
->setTemperature($temperature)
->setMemoryStore($memory_store)
->with('system_instructions', $system_instructions)
->with('tools', $tools);
// Fire away
$agent->create([
['text' => $text]
|['image' => $image]
|['file' => $file]
]);