PHP code example of mecomedia / centaurus-ai

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

    

mecomedia / centaurus-ai example snippets


use Mecomedia\CentaurusAI\Facades\CentaurusAI;

$ocr = CentaurusAI::processOcrDocument($filename);

$messages = [
    [
        'role' => 'user',
        'content' => 'Hello, how are you?'
    ],
    [
        'role' => 'user',
        'content' => 'I am fine, thank you.'
    ]
];

$response = sendAnthropic($messages, 4096, AIModels::CLAUDE_37);
$response = sendOpenAI($messages, AIModels::OPENAI_MODEL_5O_NANO);
$response = sendGemini($messages, AIModels::GEMINI_25_LITE, 0.5);
$response = sendMistral($messages, AIModels::MISTRAL_LARGE, 0.3);
$response = sendIonos($messages, AIModels::IONOS_LAMA_33, 'float');