PHP code example of jestr-ai / openmage-ai-suite

1. Go to this page and download the library: Download jestr-ai/openmage-ai-suite 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/ */

    

jestr-ai / openmage-ai-suite example snippets


class Vendor_Module_Model_Tool_Example extends AiNative_Core_Model_Tool_Abstract
{
    public function getName(): string { return 'my_tool'; }
    public function getDescription(): string { return 'What this returns and when to use it.'; }
    public function getInputSchema(): array { return $this->schema(['id' => ['type' => 'integer']], ['id']); }
    public function getAclResource(): ?string { return 'admin/catalog/products'; }
    public function execute(array $args, AiNative_Core_Model_Tool_Context $context): array { return ['ok' => true]; }
}