PHP code example of kalebalebachew / hasab-laravel

1. Go to this page and download the library: Download kalebalebachew/hasab-laravel 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/ */

    

kalebalebachew / hasab-laravel example snippets


Hasab::tts()->synthesize('Hello world', 'eng');

use Hasab\Facades\Hasab;

// Chat
$response = Hasab::chat()->complete([
    'message' => 'Hello, how are you?',
    'model' => 'hasab-1-lite',
]);

// Text-to-Speech
$audio = Hasab::tts()->synthesize([
    'text' => 'Hello, world!',
    'language' => 'eng',
]);

// Transcription (⚠️ Ongoing Implementation)
$transcription = Hasab::transcription()->upload([
    'file' => storage_path('app/audio/recording.mp3'),
]);

// Translation (⚠️ Ongoing Implementation)
$translation = Hasab::translation()->translate([
    'text' => 'Hello, how are you?',
    'source_language' => 'eng',
    'target_language' => 'amh',
]);
bash
php artisan vendor:publish --tag=hasab-config