PHP code example of symfony / ai-ollama-platform

1. Go to this page and download the library: Download symfony/ai-ollama-platform 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/ */

    

symfony / ai-ollama-platform example snippets


use Symfony\AI\Platform\Bridge\Decision\Evaluation;
use Symfony\AI\Platform\Bridge\Decision\Question\NoulQuestion;
use Symfony\AI\Platform\Message\Content\Image;

$result = $platform->invoke('clef-flash', new Evaluation(
    'A scanned yearbook photograph.',
    ['portrait' => new NoulQuestion('Is this a posed individual portrait?')],
    images: [Image::fromFile('/path/to/photo.jpg')],
));