PHP code example of deepseek-php / deepseek-laravel

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

    

deepseek-php / deepseek-laravel example snippets


DEEPSEEK_API_KEY="your_api_key"

use DeepseekClient;

$deepseek = app(DeepseekClient::class);
$response = $deepseek->query('Hello deepseek, I am Laravel Framework , how are you Today ^_^ ?')->run();
print_r("deepseek API response : " . $response);

use DeepseekClient;

$deepseek = app(DeepseekClient::class);

// Another way, with customization
$response = $deepseek
    ->query('Hello deepseek, how are you ?', 'system')
    ->query('Hello deepseek, my name is PHP ', 'user')
    ->withModel("deepseek-chat")
    ->run();

print_r("deepseek API response : " . $response);
bash
composer 
bash
php artisan vendor:publish --tag=deepseek