From 47d1add95867461611952aabc11c662e65e64c83 Mon Sep 17 00:00:00 2001 From: omaralalwi Date: Thu, 2 Jan 2025 18:49:40 +0300 Subject: [PATCH 1/6] update documentation --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 841b218..1385e27 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ - [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) @@ -78,6 +79,10 @@ $response = DeepseekClient::build($apiKey, 'https://api.deepseek.com/v2', 500) echo 'API Response:'.$response; ``` +## Use With Frameworks + +### [Laravel Deepseek Package](https://github.com/deepseek-php/deepseek-laravel) + --- ## Testing From 2e886f65a5b8fd499238561ba3dd13cd50e538e3 Mon Sep 17 00:00:00 2001 From: omaralalwi Date: Thu, 2 Jan 2025 18:55:32 +0300 Subject: [PATCH 2/6] update composer keys --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index 210ec89..4d84a87 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", From a9b127f56b623a068d81638f431fc59256717926 Mon Sep 17 00:00:00 2001 From: Omar Alalwi Date: Fri, 3 Jan 2025 08:31:12 +0300 Subject: [PATCH 3/6] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 1385e27..6c1701f 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,7 @@ --- ## 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. From 0571779471d3812475840dadc25036f77be92174 Mon Sep 17 00:00:00 2001 From: omaralalwi Date: Fri, 17 Jan 2025 17:31:35 +0300 Subject: [PATCH 4/6] feat support temperature option --- .gitignore | 14 ++++++++++++++ README.md | 1 + composer.json | 2 +- src/DeepseekClient.php | 9 +++++++++ src/Enums/Requests/QueryFlags.php | 1 + 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .gitignore 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 6c1701f..0f4424f 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ $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; diff --git a/composer.json b/composer.json index 4d84a87..44a9923 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "role": "creator" } ], - "version": "1.0.0.0", + "version": "1.0.2", "require": { "php": "^8.1.0", "php-http/discovery": "^1.20.0", diff --git a/src/DeepseekClient.php b/src/DeepseekClient.php index 33214f1..abf2902 100644 --- a/src/DeepseekClient.php +++ b/src/DeepseekClient.php @@ -43,6 +43,8 @@ class DeepseekClient implements DeepseekClientContract */ protected bool $stream; + protected int $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(int $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'; } From 0da79fa21fa1630034d0540079408c77f4c1b408 Mon Sep 17 00:00:00 2001 From: omaralalwi Date: Fri, 17 Jan 2025 19:36:44 +0300 Subject: [PATCH 5/6] bugfix temprature type --- composer.json | 2 +- src/DeepseekClient.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 44a9923..917d2b8 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "role": "creator" } ], - "version": "1.0.2", + "version": "1.0.2.1", "require": { "php": "^8.1.0", "php-http/discovery": "^1.20.0", diff --git a/src/DeepseekClient.php b/src/DeepseekClient.php index abf2902..8ed1b2c 100644 --- a/src/DeepseekClient.php +++ b/src/DeepseekClient.php @@ -43,7 +43,7 @@ class DeepseekClient implements DeepseekClientContract */ protected bool $stream; - protected int $temperature; + protected float $temperature; /** * Initialize the DeepseekClient with a PSR-compliant HTTP client. @@ -126,7 +126,7 @@ public function withStream(bool $stream = true): self return $this; } - public function setTemperature(int $temperature): self + public function setTemperature(float $temperature): self { $this->temperature = $temperature; return $this; From 941542fe1f5d8d97c29aef9bc0349cbd62741e2b Mon Sep 17 00:00:00 2001 From: Omar Alalwi Date: Fri, 17 Jan 2025 19:48:32 +0300 Subject: [PATCH 6/6] Update composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 917d2b8..1c5f46a 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,7 @@ "role": "creator" } ], - "version": "1.0.2.1", + "version": "1.0.1", "require": { "php": "^8.1.0", "php-http/discovery": "^1.20.0",