1. Go to this page and download the library: Download use-the-fork/synapse 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/ */
use UseTheFork\Synapse\Agent;
use UseTheFork\Synapse\Integrations\OpenAIIntegration;
use UseTheFork\Synapse\Memory\CollectionMemory;
use UseTheFork\Synapse\Contracts\Agent\HasMemory;
use UseTheFork\Synapse\Contracts\Integration;
use UseTheFork\Synapse\Contracts\Memory;
class SimpleAgent extends Agent implements HasMemory
{
protected string $promptView = 'synapse::Prompts.SimplePrompt';
public function resolveIntegration(): Integration
{
return new OpenAIIntegration();
}
public function resolveMemory(): Memory
{
return new CollectionMemory();
}
}
public function resolveMemory(): Memory
{
return new DatabaseMemory(123); // Use a specific memory ID
}
public function resolveIntegration(): Integration
{
return new OpenAIIntegration();
}
bash
php artisan synapse:install
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.