PHP code example of eahiya / deepseek-ai-laravel

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

    

eahiya / deepseek-ai-laravel example snippets


use eahiya\DeepSeekAI\Facades\DeepSeekAI;

$response = DeepSeekAI::chat([
    ['role' => 'user', 'content' => 'Hello, how are you?']
],'deepseek-chat');

dd($response);

use eahiya\DeepSeekAI\Services\DeepSeekAIClient;

public function someMethod(DeepSeekAIClient $deepSeek)
{
    $response = $deepSeek->chat([
        ['role' => 'user', 'content' => 'Hello, how are you?']
    ], 'deepseek-chat');

    return $response;
}
bash
php artisan vendor:publish --provider="eahiya\DeepSeekAI\DeepSeekAIServiceProvider" --tag="deepseek-config"