diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c5a6b38 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +build +vendor +tests/TestSupport/temp +tests/temp +composer.lock +phpunit.xml +.env +.phpunit.cache/ +.phpunit.result.cache +.phpunit.cache/test-results +.php-cs-fixer.cache +phpstan.neon +tests/Support/temp/ +.idea/ diff --git a/README.md b/README.md index 841b218..0f4424f 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,14 @@ - [Quick Start Guide](#quick-start-guide) - [Basic Usage](#basic-usage) - [Advanced Usage](#advanced-usage) + - [Use With Frameworks](#use-with-frameworks) - [Testing](#testing) - [Contributors](#contributors-) - [License](#license) --- ## Overview -**Deepseek PHP Client** is a robust and community-driven PHP client library for seamless integration with the [Deepseek](https://www.deepseek.com/) API, offering efficient access to advanced AI and data processing capabilities - +**Deepseek PHP Client** is a robust and community-driven PHP client library for seamless integration with the [Deepseek](https://www.deepseek.com/) API. ### Key Features - **Easy Integration:** Simplifies interaction with the Deepseek API using a PHP client. - **Method Chaining:** Supports fluent method chaining for building requests. @@ -73,11 +73,16 @@ $response = DeepseekClient::build($apiKey, 'https://api.deepseek.com/v2', 500) ->query('System setup query', 'system') ->query('User input message', 'user') ->withModel(Models::CODER->value) + ->setTemperature(1.5) ->run(); echo 'API Response:'.$response; ``` +## Use With Frameworks + +### [Laravel Deepseek Package](https://github.com/deepseek-php/deepseek-laravel) + --- ## Testing diff --git a/composer.json b/composer.json index 210ec89..1c5f46a 100644 --- a/composer.json +++ b/composer.json @@ -6,6 +6,9 @@ "deepseek-php-client", "deepseek-api", "php-deepseek", + "deepseek-coder", + "deepseek-chat", + "deepseek-math", "deepseek-integration", "openai", "sdk", @@ -56,7 +59,7 @@ "role": "creator" } ], - "version": "1.0.0.0", + "version": "1.0.1", "require": { "php": "^8.1.0", "php-http/discovery": "^1.20.0", diff --git a/src/DeepseekClient.php b/src/DeepseekClient.php index 33214f1..8ed1b2c 100644 --- a/src/DeepseekClient.php +++ b/src/DeepseekClient.php @@ -43,6 +43,8 @@ class DeepseekClient implements DeepseekClientContract */ protected bool $stream; + protected float $temperature; + /** * Initialize the DeepseekClient with a PSR-compliant HTTP client. * @@ -61,6 +63,7 @@ public function run(): string QueryFlags::MESSAGES->value => $this->queries, QueryFlags::MODEL->value => $this->model, QueryFlags::STREAM->value => $this->stream, + QueryFlags::TEMPERATURE->value => $this->temperature, ]; // Clear queries after sending $this->queries = []; @@ -123,6 +126,12 @@ public function withStream(bool $stream = true): self return $this; } + public function setTemperature(float $temperature): self + { + $this->temperature = $temperature; + return $this; + } + protected function buildQuery(string $content, ?string $role = null): array { return [ diff --git a/src/Enums/Requests/QueryFlags.php b/src/Enums/Requests/QueryFlags.php index fb133d6..b4523f2 100644 --- a/src/Enums/Requests/QueryFlags.php +++ b/src/Enums/Requests/QueryFlags.php @@ -7,4 +7,5 @@ enum QueryFlags: string case MESSAGES = 'messages'; case MODEL = 'model'; case STREAM = 'stream'; + case TEMPERATURE = 'temperature'; }