From d46796f55a0d8d697fe3107655a109c68a3e4acf Mon Sep 17 00:00:00 2001 From: dbogovoy Date: Mon, 4 Dec 2023 19:42:27 +0000 Subject: [PATCH 01/24] Update min symfony version to ^7.0.0 --- composer.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 73120fc..417ba8c 100644 --- a/composer.json +++ b/composer.json @@ -15,21 +15,21 @@ } ], "require": { - "php": "^8.1.0", + "php": "^8.2.0", "nyholm/psr7": "^1.8.1", "openai-php/client": "^0.8.0", "psr/http-client": "^1.0.3", "psr/http-factory": "^1.0.2", - "symfony/config": "^5.4.21|^6.3.8", - "symfony/dependency-injection": "^5.4.21|^6.3.8", - "symfony/http-client": "^5.4.21|^6.3.8", - "symfony/http-kernel": "^5.4.21|^6.3.8" + "symfony/config": "^7.0.0", + "symfony/dependency-injection": "^7.0.0", + "symfony/http-client": "^7.0.0", + "symfony/http-kernel": "^7.0.0" }, "require-dev": { "laravel/pint": "^1.13.6", "phpstan/phpstan": "^1.10.44", "rector/rector": "^0.14.8", - "symfony/phpunit-bridge": "^6.3.8" + "symfony/phpunit-bridge": "^7.0.0" }, "autoload": { "psr-4": { From ffd4ce93f72bdaa9f313f949e06503dd0ec82a38 Mon Sep 17 00:00:00 2001 From: dbogovoy Date: Mon, 4 Dec 2023 19:59:29 +0000 Subject: [PATCH 02/24] Update workflow for testing. Add symfony 6.4.* --- .github/workflows/tests.yml | 4 ++-- composer.json | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bdc3757..6628d01 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,8 +9,8 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.1, 8.2] - symfony: [5.4.*, 6.2.*] + php: [8.2] + symfony: [^6.4.*, 7.0.*] dependency-version: [prefer-lowest, prefer-stable] name: Tests P${{ matrix.php }} - SF${{ matrix.symfony }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} diff --git a/composer.json b/composer.json index 417ba8c..5534f1f 100644 --- a/composer.json +++ b/composer.json @@ -20,16 +20,16 @@ "openai-php/client": "^0.8.0", "psr/http-client": "^1.0.3", "psr/http-factory": "^1.0.2", - "symfony/config": "^7.0.0", - "symfony/dependency-injection": "^7.0.0", - "symfony/http-client": "^7.0.0", - "symfony/http-kernel": "^7.0.0" + "symfony/config": "^6.4.0|^7.0.0", + "symfony/dependency-injection": "^6.4.0|^7.0.0", + "symfony/http-client": "^6.4.0|^7.0.0", + "symfony/http-kernel": "^6.4.0|^7.0.0" }, "require-dev": { "laravel/pint": "^1.13.6", "phpstan/phpstan": "^1.10.44", "rector/rector": "^0.14.8", - "symfony/phpunit-bridge": "^7.0.0" + "symfony/phpunit-bridge": "^6.4.0|^7.0.0" }, "autoload": { "psr-4": { From a7bddbe60a2f444c891ce5510cbc71c3a70d4dce Mon Sep 17 00:00:00 2001 From: dbogovoy Date: Mon, 4 Dec 2023 20:03:49 +0000 Subject: [PATCH 03/24] Rollback minimum symfony versions --- .github/workflows/tests.yml | 2 +- composer.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6628d01..b20faa0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: matrix: os: [ubuntu-latest] php: [8.2] - symfony: [^6.4.*, 7.0.*] + symfony: [5.4.*, 6.3.*, 7.0.*] dependency-version: [prefer-lowest, prefer-stable] name: Tests P${{ matrix.php }} - SF${{ matrix.symfony }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} diff --git a/composer.json b/composer.json index 5534f1f..8d32ecc 100644 --- a/composer.json +++ b/composer.json @@ -20,16 +20,16 @@ "openai-php/client": "^0.8.0", "psr/http-client": "^1.0.3", "psr/http-factory": "^1.0.2", - "symfony/config": "^6.4.0|^7.0.0", - "symfony/dependency-injection": "^6.4.0|^7.0.0", - "symfony/http-client": "^6.4.0|^7.0.0", - "symfony/http-kernel": "^6.4.0|^7.0.0" + "symfony/config": "^5.4|^6.3|^7.0", + "symfony/dependency-injection": "^5.4|^6.3|^7.0", + "symfony/http-client": "^5.4|^6.3|^7.0", + "symfony/http-kernel": "^5.4|^6.3|^7.0" }, "require-dev": { "laravel/pint": "^1.13.6", "phpstan/phpstan": "^1.10.44", "rector/rector": "^0.14.8", - "symfony/phpunit-bridge": "^6.4.0|^7.0.0" + "symfony/phpunit-bridge": "^5.4|^6.3|^7.0" }, "autoload": { "psr-4": { From 3423a6b89f07e33f601da0274c3157fead9bfd7f Mon Sep 17 00:00:00 2001 From: dbogovoy Date: Mon, 4 Dec 2023 20:42:47 +0000 Subject: [PATCH 04/24] Update php versioning --- .github/workflows/tests.yml | 14 ++++++++++++-- composer.json | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b20faa0..40a99c4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,9 +9,19 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.2] - symfony: [5.4.*, 6.3.*, 7.0.*] + php: [8.1, 8.2] + symfony: [5.4.*, 6.3.*, 6.4.*, 7.0.*] dependency-version: [prefer-lowest, prefer-stable] + include: + - php: "8.1" + symfony: "^5.4" + - php: "8.1" + symfony: "^6.3" + - php: "8.1" + symfony: "^6.4" + exclude: + - php: "8.1" + symfony: "^7.0" name: Tests P${{ matrix.php }} - SF${{ matrix.symfony }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} steps: diff --git a/composer.json b/composer.json index 8d32ecc..dfc7ced 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": "^8.2.0", + "php": "^8.1.0", "nyholm/psr7": "^1.8.1", "openai-php/client": "^0.8.0", "psr/http-client": "^1.0.3", From e3c9145e116d957cc3c0ea29da75dc838da94ecf Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 5 Dec 2023 09:38:01 +0000 Subject: [PATCH 05/24] chore: bumps dependencies --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index dfc7ced..888715c 100644 --- a/composer.json +++ b/composer.json @@ -21,15 +21,15 @@ "psr/http-client": "^1.0.3", "psr/http-factory": "^1.0.2", "symfony/config": "^5.4|^6.3|^7.0", - "symfony/dependency-injection": "^5.4|^6.3|^7.0", + "symfony/dependency-injection": "^5.4|^6.3|^7.0.1", "symfony/http-client": "^5.4|^6.3|^7.0", - "symfony/http-kernel": "^5.4|^6.3|^7.0" + "symfony/http-kernel": "^5.4|^6.3|^7.0.1" }, "require-dev": { "laravel/pint": "^1.13.6", - "phpstan/phpstan": "^1.10.44", + "phpstan/phpstan": "^1.10.47", "rector/rector": "^0.14.8", - "symfony/phpunit-bridge": "^5.4|^6.3|^7.0" + "symfony/phpunit-bridge": "^5.4|^6.3|^7.0.1" }, "autoload": { "psr-4": { From ad929762be31f8c434edb97362c70b0c0de8bb79 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 5 Dec 2023 10:10:22 +0000 Subject: [PATCH 06/24] chore: updates tesitng --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 40a99c4..6a24087 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, macos-latest] php: [8.1, 8.2] symfony: [5.4.*, 6.3.*, 6.4.*, 7.0.*] dependency-version: [prefer-lowest, prefer-stable] From da74d650f5e38701e0a2b8b188f887cf4345a182 Mon Sep 17 00:00:00 2001 From: frithjof pfannstiel Date: Fri, 22 Dec 2023 12:44:52 +0100 Subject: [PATCH 07/24] add assistant beta header --- src/Resources/config/services.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Resources/config/services.php b/src/Resources/config/services.php index a4780b6..7dded7e 100644 --- a/src/Resources/config/services.php +++ b/src/Resources/config/services.php @@ -17,6 +17,7 @@ ->set(Factory::class) ->factory([OpenAI::class, 'factory']) ->call('withHttpClient', [service('openai.http_client')]) + ->call('withHttpHeader', ['OpenAI-Beta' , 'assistants=v1']) ->set(Client::class) ->factory([service(Factory::class), 'make']) From 4e03acc1e7f65f0412e0b7290dbb42a8628a6c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Mon, 15 Jan 2024 18:18:44 +0100 Subject: [PATCH 08/24] Update src/Resources/config/services.php --- src/Resources/config/services.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/config/services.php b/src/Resources/config/services.php index 7dded7e..42ad5b5 100644 --- a/src/Resources/config/services.php +++ b/src/Resources/config/services.php @@ -17,7 +17,7 @@ ->set(Factory::class) ->factory([OpenAI::class, 'factory']) ->call('withHttpClient', [service('openai.http_client')]) - ->call('withHttpHeader', ['OpenAI-Beta' , 'assistants=v1']) + ->call('withHttpHeader', ['OpenAI-Beta', 'assistants=v1']) ->set(Client::class) ->factory([service(Factory::class), 'make']) From 26f9b8b11af47f9dd5567e52ff2f44cbebd4e3df Mon Sep 17 00:00:00 2001 From: Dylan Delobel Date: Mon, 15 Jan 2024 18:58:47 +0100 Subject: [PATCH 09/24] Update deprecated model --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8171dd2..8434328 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Finally, you may use the `openai` service to access the OpenAI API: ```php $result = $container->get('openai')->completions()->create([ - 'model' => 'text-davinci-003', + 'model' => 'gpt-3.5-turbo-instruct', 'prompt' => 'PHP is', ]); From 4aaf1347266cbf0277325d8533a77f8a4578b233 Mon Sep 17 00:00:00 2001 From: slim-dg9 <122024497+slim-dg9@users.noreply.github.com> Date: Fri, 7 Jun 2024 15:51:37 +0200 Subject: [PATCH 10/24] Assistant v2 update --- composer.json | 2 +- src/Resources/config/services.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 888715c..c2712a1 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "php": "^8.1.0", "nyholm/psr7": "^1.8.1", - "openai-php/client": "^0.8.0", + "openai-php/client": "^0.10", "psr/http-client": "^1.0.3", "psr/http-factory": "^1.0.2", "symfony/config": "^5.4|^6.3|^7.0", diff --git a/src/Resources/config/services.php b/src/Resources/config/services.php index 42ad5b5..5f00864 100644 --- a/src/Resources/config/services.php +++ b/src/Resources/config/services.php @@ -17,7 +17,7 @@ ->set(Factory::class) ->factory([OpenAI::class, 'factory']) ->call('withHttpClient', [service('openai.http_client')]) - ->call('withHttpHeader', ['OpenAI-Beta', 'assistants=v1']) + ->call('withHttpHeader', ['OpenAI-Beta', 'assistants=v2']) ->set(Client::class) ->factory([service(Factory::class), 'make']) From 3e9972358af998d60c4eb1fd4fdf4926643ebb23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 19 Jun 2024 13:41:30 +0200 Subject: [PATCH 11/24] Fix CS --- src/OpenAIBundle.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/OpenAIBundle.php b/src/OpenAIBundle.php index 4a58def..c14715b 100644 --- a/src/OpenAIBundle.php +++ b/src/OpenAIBundle.php @@ -6,6 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; -final class OpenAIBundle extends Bundle -{ -} +final class OpenAIBundle extends Bundle {} From 7eee58b69714a99573670ba365704fc2621220ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Wed, 19 Jun 2024 13:53:03 +0200 Subject: [PATCH 12/24] Prepare v0.10.0 (#20) --- CHANGELOG.md | 5 +++++ composer.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c22efa5..82286bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## v0.10.0 (2024-06-19) +### Changed +- Specify header `OpenAI-Beta: assistants=v2` +- Changed underlying `openai/client` package version to 0.10.0 + ## v0.7.10 (2023-11-14) ### Changed - Changed underlying `openai/client` package version to 0.7.10 diff --git a/composer.json b/composer.json index c2712a1..d0b04c9 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "symfony/http-kernel": "^5.4|^6.3|^7.0.1" }, "require-dev": { - "laravel/pint": "^1.13.6", + "laravel/pint": "^1.16.1", "phpstan/phpstan": "^1.10.47", "rector/rector": "^0.14.8", "symfony/phpunit-bridge": "^5.4|^6.3|^7.0.1" From 0bf2a5a440c60fbe8d8d6c5ffcfa1c4e74746ea2 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 17 Oct 2024 21:36:38 +0100 Subject: [PATCH 13/24] feat: adds php 8.4 support --- .github/workflows/tests.yml | 2 +- composer.json | 20 +++++++++---------- src/OpenAIBundle.php | 4 +--- .../OpenAIExtensionTest.php | 4 ++-- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 40a99c4..db5997d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest] - php: [8.1, 8.2] + php: [8.1, 8.2, 8.3, 8.4] symfony: [5.4.*, 6.3.*, 6.4.*, 7.0.*] dependency-version: [prefer-lowest, prefer-stable] include: diff --git a/composer.json b/composer.json index 888715c..451dd1e 100644 --- a/composer.json +++ b/composer.json @@ -16,20 +16,20 @@ ], "require": { "php": "^8.1.0", - "nyholm/psr7": "^1.8.1", - "openai-php/client": "^0.8.0", + "nyholm/psr7": "^1.8.2", + "openai-php/client": "^0.8.5", "psr/http-client": "^1.0.3", - "psr/http-factory": "^1.0.2", - "symfony/config": "^5.4|^6.3|^7.0", - "symfony/dependency-injection": "^5.4|^6.3|^7.0.1", - "symfony/http-client": "^5.4|^6.3|^7.0", - "symfony/http-kernel": "^5.4|^6.3|^7.0.1" + "psr/http-factory": "^1.1.0", + "symfony/config": "^5.4|^6.3|^7.1.1", + "symfony/dependency-injection": "^5.4|^6.3|^7.1.5", + "symfony/http-client": "^5.4|^6.3|^7.1.5", + "symfony/http-kernel": "^5.4|^6.3|^7.1.5" }, "require-dev": { - "laravel/pint": "^1.13.6", - "phpstan/phpstan": "^1.10.47", + "laravel/pint": "^1.18.1", + "phpstan/phpstan": "^1.12.6", "rector/rector": "^0.14.8", - "symfony/phpunit-bridge": "^5.4|^6.3|^7.0.1" + "symfony/phpunit-bridge": "^5.4|^6.3|^7.1.4" }, "autoload": { "psr-4": { diff --git a/src/OpenAIBundle.php b/src/OpenAIBundle.php index 4a58def..c14715b 100644 --- a/src/OpenAIBundle.php +++ b/src/OpenAIBundle.php @@ -6,6 +6,4 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; -final class OpenAIBundle extends Bundle -{ -} +final class OpenAIBundle extends Bundle {} diff --git a/tests/DependencyInjection/OpenAIExtensionTest.php b/tests/DependencyInjection/OpenAIExtensionTest.php index 54f225c..1138a03 100644 --- a/tests/DependencyInjection/OpenAIExtensionTest.php +++ b/tests/DependencyInjection/OpenAIExtensionTest.php @@ -30,10 +30,10 @@ public function testService(): void ]); }); - $container = new ContainerBuilder(); + $container = new ContainerBuilder; $container->set('http_client', $httpClient); - $extension = new OpenAIExtension(); + $extension = new OpenAIExtension; $extension->load([ 'openai' => [ 'api_key' => 'pk-123456789', From 8337e9d2304bf612bc2cbcf744349a6200c4524a Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 17 Oct 2024 21:40:43 +0100 Subject: [PATCH 14/24] style --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index db5997d..8b0c196 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,6 +5,7 @@ on: ['push', 'pull_request'] jobs: ci: runs-on: ${{ matrix.os }} + strategy: fail-fast: true matrix: From 8e33983311a551dbdd6eb6fb7dc0fe154fd5fdf1 Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 17 Oct 2024 21:41:32 +0100 Subject: [PATCH 15/24] chore: don't tests against lower --- .github/workflows/formats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index dd0c824..c4100ca 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -11,7 +11,7 @@ jobs: matrix: os: [ubuntu-latest] php: [8.2] - dependency-version: [prefer-lowest, prefer-stable] + dependency-version: [prefer-stable] name: Formats P${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} From ac29660667ca86e8fc1d06aa8e15c430cf066beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Sat, 8 Feb 2025 07:49:44 +0100 Subject: [PATCH 16/24] Add an alias for the ClientContract (#22) --- src/Resources/config/services.php | 2 ++ tests/DependencyInjection/OpenAIExtensionTest.php | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Resources/config/services.php b/src/Resources/config/services.php index 5f00864..67fee2f 100644 --- a/src/Resources/config/services.php +++ b/src/Resources/config/services.php @@ -6,6 +6,7 @@ use OpenAI; use OpenAI\Client; +use OpenAI\Contracts\ClientContract; use OpenAI\Factory; use Symfony\Component\HttpClient\Psr18Client; @@ -22,5 +23,6 @@ ->set(Client::class) ->factory([service(Factory::class), 'make']) + ->alias(ClientContract::class, Client::class) ->alias('openai', Client::class); }; diff --git a/tests/DependencyInjection/OpenAIExtensionTest.php b/tests/DependencyInjection/OpenAIExtensionTest.php index 1138a03..6514b13 100644 --- a/tests/DependencyInjection/OpenAIExtensionTest.php +++ b/tests/DependencyInjection/OpenAIExtensionTest.php @@ -5,6 +5,7 @@ namespace OpenAI\Symfony\Tests\DependencyInjection; use OpenAI\Client; +use OpenAI\Contracts\ClientContract; use OpenAI\Symfony\DependencyInjection\OpenAIExtension; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -13,7 +14,7 @@ final class OpenAIExtensionTest extends TestCase { - public function testService(): void + public function test_service(): void { // Using a mock to test the service configuration $httpClient = new MockHttpClient(function (string $method, string $url, array $options = []) { @@ -45,5 +46,7 @@ public function testService(): void $response = $openai->files()->delete('file.txt'); self::assertSame('file.txt', $response->id); + + self::assertSame($openai, $container->get(ClientContract::class), 'Alias for the ClientContract interface'); } } From 14c4243ef2fa66331a9ac306065b2c608c9bffcc Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Thu, 3 Apr 2025 02:33:01 -0400 Subject: [PATCH 17/24] Correct GitHub Action deprecations + Opt into Dependabot (#23) * fix: update to latest github action versions * feat: opt into Dependabot for GitHub Action health --- .github/dependabot.yml | 6 ++++++ .github/workflows/formats.yml | 4 ++-- .github/workflows/tests.yml | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ca79ca5 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index c4100ca..5440721 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -18,10 +18,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8b0c196..b7f2291 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,10 +28,10 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.composer/cache/files key: dependencies-php-${{ matrix.php }}-SF${{ matrix.symfony }}-${{ matrix.dependency-version }}-composer-${{ hashFiles('composer.json') }} From 7185af1911017fe8d9cddafe1a1636ca2900d669 Mon Sep 17 00:00:00 2001 From: Connor Tumbleson Date: Sun, 6 Apr 2025 05:24:32 -0400 Subject: [PATCH 18/24] Run "test" workflow without startup errors. (#24) * chore: drop matrix.os to reduce matrix complexity * chore: drop symfony 6.3, add 7.2 * chore: skip php 8.1 on symfony 7.2 * chore: skip php 8.4 on symfony 5.4 * chore: skip php 8.4 on symfony 6.4 * chore: restore symfony 7.0 * chore: restore symfony 7.0, but skip 8.4 --- .github/workflows/tests.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b7f2291..512051f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,27 +4,25 @@ on: ['push', 'pull_request'] jobs: ci: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: fail-fast: true matrix: - os: [ubuntu-latest] php: [8.1, 8.2, 8.3, 8.4] - symfony: [5.4.*, 6.3.*, 6.4.*, 7.0.*] + symfony: [5.4.*, 6.4.*, 7.0.*] dependency-version: [prefer-lowest, prefer-stable] - include: - - php: "8.1" - symfony: "^5.4" - - php: "8.1" - symfony: "^6.3" - - php: "8.1" - symfony: "^6.4" exclude: - - php: "8.1" - symfony: "^7.0" - - name: Tests P${{ matrix.php }} - SF${{ matrix.symfony }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} + - php: 8.1 + symfony: 7.0.* + - php: 8.4 + symfony: 5.4.* + - php: 8.4 + symfony: 6.4.* + - php: 8.4 + symfony: 7.0.* + + name: Tests P${{ matrix.php }} - SF${{ matrix.symfony }} - ubuntu-latest - ${{ matrix.dependency-version }} steps: - name: Checkout @@ -50,6 +48,7 @@ jobs: "symfony/dependency-injection:${{ matrix.symfony }}" "symfony/http-kernel:${{ matrix.symfony }}" --no-interaction --no-update + - name: Install Composer dependencies run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist From 3e981b1ade1544e83371d62c9a0657d0c4d545eb Mon Sep 17 00:00:00 2001 From: 3qdev Date: Fri, 9 May 2025 12:25:35 +0200 Subject: [PATCH 19/24] Changed underlying `openai/client` package version to 0.12.0 (#25) (#26) * Changed underlying `openai/client` package version to 0.12.0 (#25) * update require to php >=8.2 (#25) * drop php 8.1 from test matrix (#25) --- .github/workflows/tests.yml | 4 +--- CHANGELOG.md | 4 ++++ composer.json | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 512051f..d514d65 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,12 +9,10 @@ jobs: strategy: fail-fast: true matrix: - php: [8.1, 8.2, 8.3, 8.4] + php: [8.2, 8.3, 8.4] symfony: [5.4.*, 6.4.*, 7.0.*] dependency-version: [prefer-lowest, prefer-stable] exclude: - - php: 8.1 - symfony: 7.0.* - php: 8.4 symfony: 5.4.* - php: 8.4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 82286bc..45256e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## v0.12.0 (2025-05-06) +### Changed +- Changed underlying `openai/client` package version to 0.12.0 + ## v0.10.0 (2024-06-19) ### Changed - Specify header `OpenAI-Beta: assistants=v2` diff --git a/composer.json b/composer.json index 03b85fe..a4839d0 100644 --- a/composer.json +++ b/composer.json @@ -15,9 +15,9 @@ } ], "require": { - "php": "^8.1.0", + "php": "^8.2.0", "nyholm/psr7": "^1.8.2", - "openai-php/client": "^0.10.2", + "openai-php/client": "^0.12.0", "psr/http-client": "^1.0.3", "psr/http-factory": "^1.1.0", "symfony/config": "^5.4|^6.3|^7.1.1", From 2ce4aeee124876be90b7ac6e7c9e503d349ddb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Fri, 9 May 2025 12:28:50 +0200 Subject: [PATCH 20/24] Update CHANGELOG for v0.12.0 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 45256e0..22f06ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## v0.12.0 (2025-05-06) ### Changed - Changed underlying `openai/client` package version to 0.12.0 +- Add an alias for the `ClientContract` interface ## v0.10.0 (2024-06-19) ### Changed From f62a924b735e6c5e525e726e376f46b181f81f5e Mon Sep 17 00:00:00 2001 From: Anne van de Venis Date: Mon, 19 May 2025 14:43:09 +0200 Subject: [PATCH 21/24] deps: allow openai-php/client v0.13 (#27) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a4839d0..8a72cd7 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "php": "^8.2.0", "nyholm/psr7": "^1.8.2", - "openai-php/client": "^0.12.0", + "openai-php/client": "^0.13.0", "psr/http-client": "^1.0.3", "psr/http-factory": "^1.1.0", "symfony/config": "^5.4|^6.3|^7.1.1", From 6c70a13d8d7c2f9a0faab0d311871e1b886778e1 Mon Sep 17 00:00:00 2001 From: Adeniji Adekunle James Date: Fri, 4 Jul 2025 09:19:38 +0100 Subject: [PATCH 22/24] Moves model to 4o-mini as it is cheaper and typically better than 3.5 (#29) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8434328..3d6e4d3 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Finally, you may use the `openai` service to access the OpenAI API: ```php $result = $container->get('openai')->completions()->create([ - 'model' => 'gpt-3.5-turbo-instruct', + 'model' => 'gpt-4o-mini', 'prompt' => 'PHP is', ]); From 8b548efd712b48cdc8e7f88442bf1099e99c1c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen?= Date: Tue, 12 Aug 2025 11:26:55 +0200 Subject: [PATCH 23/24] Bump openai-php/client to 0.15 (#30) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8a72cd7..2cb1e96 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "php": "^8.2.0", "nyholm/psr7": "^1.8.2", - "openai-php/client": "^0.13.0", + "openai-php/client": "^0.15.0", "psr/http-client": "^1.0.3", "psr/http-factory": "^1.1.0", "symfony/config": "^5.4|^6.3|^7.1.1", From 48600287744726751d61eda73a07a372de8d5ae9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Aug 2025 11:07:30 +0200 Subject: [PATCH 24/24] chore(deps): bump actions/checkout from 4 to 5 (#31) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/formats.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/formats.yml b/.github/workflows/formats.yml index 5440721..d858f6a 100644 --- a/.github/workflows/formats.yml +++ b/.github/workflows/formats.yml @@ -18,7 +18,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Cache dependencies uses: actions/cache@v4 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d514d65..a434b17 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Cache dependencies uses: actions/cache@v4