Skip to content

Rename AIBundle to AiBundle, etc. #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .phpstan/ForbidNativeExceptionRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class ForbidNativeExceptionRule implements Rule
'Symfony\\AI\\Platform' => 'Symfony\\AI\\Platform\\Exception\\',
'Symfony\\AI\\Store' => 'Symfony\\AI\\Store\\Exception\\',
'Symfony\\AI\\McpSdk' => 'Symfony\\AI\\McpSdk\\Exception\\',
'Symfony\\AI\\AIBundle' => 'Symfony\\AI\\AIBundle\\Exception\\',
'Symfony\\AI\\AiBundle' => 'Symfony\\AI\\AiBundle\\Exception\\',
'Symfony\\AI\\McpBundle' => 'Symfony\\AI\\McpBundle\\Exception\\',
];

Expand Down
2 changes: 1 addition & 1 deletion demo/config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
Symfony\UX\Turbo\TurboBundle::class => ['all' => true],
Symfony\UX\Icons\UXIconsBundle::class => ['all' => true],
Symfony\UX\Typed\TypedBundle::class => ['all' => true],
Symfony\AI\AIBundle\AIBundle::class => ['all' => true],
Symfony\AI\AiBundle\AiBundle::class => ['all' => true],
Symfony\AI\McpBundle\McpBundle::class => ['all' => true],
];
24 changes: 12 additions & 12 deletions demo/config/packages/ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ai:
blog:
# platform: 'ai.platform.anthropic'
model:
class: 'Symfony\AI\Platform\Bridge\OpenAI\GPT'
name: !php/const Symfony\AI\Platform\Bridge\OpenAI\GPT::GPT_4O_MINI
class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt'
name: !php/const Symfony\AI\Platform\Bridge\OpenAi\Gpt::GPT_4O_MINI
tools:
- 'Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch'
- service: 'clock'
Expand All @@ -16,8 +16,8 @@ ai:
method: 'now'
stream:
model:
class: 'Symfony\AI\Platform\Bridge\OpenAI\GPT'
name: !php/const Symfony\AI\Platform\Bridge\OpenAI\GPT::GPT_4O_MINI
class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt'
name: !php/const Symfony\AI\Platform\Bridge\OpenAi\Gpt::GPT_4O_MINI
system_prompt: |
You are an example chat application where messages from the LLM are streamed to the user using
Server-Sent Events via `symfony/ux-turbo` / Turbo Streams. This example does not use any custom
Expand All @@ -26,13 +26,13 @@ ai:
tools: false
youtube:
model:
class: 'Symfony\AI\Platform\Bridge\OpenAI\GPT'
name: !php/const Symfony\AI\Platform\Bridge\OpenAI\GPT::GPT_4O_MINI
class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt'
name: !php/const Symfony\AI\Platform\Bridge\OpenAi\Gpt::GPT_4O_MINI
tools: false
wikipedia:
model:
class: 'Symfony\AI\Platform\Bridge\OpenAI\GPT'
name: !php/const Symfony\AI\Platform\Bridge\OpenAI\GPT::GPT_4O_MINI
class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt'
name: !php/const Symfony\AI\Platform\Bridge\OpenAi\Gpt::GPT_4O_MINI
options:
temperature: 0.5
system_prompt: 'Please answer the users question based on Wikipedia and provide a link to the article.'
Expand All @@ -41,8 +41,8 @@ ai:
- 'Symfony\AI\Agent\Toolbox\Tool\Wikipedia'
audio:
model:
class: 'Symfony\AI\Platform\Bridge\OpenAI\GPT'
name: !php/const Symfony\AI\Platform\Bridge\OpenAI\GPT::GPT_4O_MINI
class: 'Symfony\AI\Platform\Bridge\OpenAi\Gpt'
name: !php/const Symfony\AI\Platform\Bridge\OpenAi\Gpt::GPT_4O_MINI
system_prompt: 'You are a friendly chatbot that likes to have a conversation with users and asks them some questions.'
tools:
# Agent in agent 🤯
Expand All @@ -56,8 +56,8 @@ ai:
indexer:
default:
model:
class: 'Symfony\AI\Platform\Bridge\OpenAI\Embeddings'
name: !php/const Symfony\AI\Platform\Bridge\OpenAI\Embeddings::TEXT_ADA_002
class: 'Symfony\AI\Platform\Bridge\OpenAi\Embeddings'
name: !php/const Symfony\AI\Platform\Bridge\OpenAi\Embeddings::TEXT_ADA_002

services:
_defaults:
Expand Down
2 changes: 1 addition & 1 deletion demo/src/Audio/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace App\Audio;

use Symfony\AI\Agent\AgentInterface;
use Symfony\AI\Platform\Bridge\OpenAI\Whisper;
use Symfony\AI\Platform\Bridge\OpenAi\Whisper;
use Symfony\AI\Platform\Message\Content\Audio;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;
Expand Down
2 changes: 1 addition & 1 deletion demo/src/Blog/Command/QueryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace App\Blog\Command;

use Codewithkyrian\ChromaDB\Client;
use Symfony\AI\Platform\Bridge\OpenAI\Embeddings;
use Symfony\AI\Platform\Bridge\OpenAi\Embeddings;
use Symfony\AI\Platform\PlatformInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
Expand Down
4 changes: 2 additions & 2 deletions demo/src/Video/TwigComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace App\Video;

use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Message\Content\Image;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;
Expand Down Expand Up @@ -47,7 +47,7 @@ public function submit(#[LiveArg] string $instruction, #[LiveArg] string $image)
Message::ofUser($instruction, Image::fromDataUrl($image))
);

$result = $this->platform->invoke(new GPT(GPT::GPT_4O_MINI), $messageBag, [
$result = $this->platform->invoke(new Gpt(Gpt::GPT_4O_MINI), $messageBag, [
'max_tokens' => 100,
]);

Expand Down
4 changes: 2 additions & 2 deletions examples/albert/chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

use Symfony\AI\Agent\Agent;
use Symfony\AI\Platform\Bridge\Albert\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

require_once dirname(__DIR__).'/bootstrap.php';

$platform = PlatformFactory::create(env('ALBERT_API_KEY'), env('ALBERT_API_URL'), http_client());

$model = new GPT('gpt-4o');
$model = new Gpt('gpt-4o');
$agent = new Agent($platform, $model, logger: logger());

$documentContext = <<<'CONTEXT'
Expand Down
4 changes: 2 additions & 2 deletions examples/azure/audio-transcript.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/

use Symfony\AI\Platform\Bridge\Azure\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAI\Whisper;
use Symfony\AI\Platform\Bridge\Azure\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Whisper;
use Symfony\AI\Platform\Message\Content\Audio;

require_once dirname(__DIR__).'/bootstrap.php';
Expand Down
6 changes: 3 additions & 3 deletions examples/azure/chat-gpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/

use Symfony\AI\Agent\Agent;
use Symfony\AI\Platform\Bridge\Azure\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\Azure\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

Expand All @@ -24,7 +24,7 @@
env('AZURE_OPENAI_KEY'),
http_client(),
);
$model = new GPT(GPT::GPT_4O_MINI);
$model = new Gpt(Gpt::GPT_4O_MINI);

$agent = new Agent($platform, $model, logger: logger());
$messages = new MessageBag(
Expand Down
4 changes: 2 additions & 2 deletions examples/azure/embeddings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/

use Symfony\AI\Platform\Bridge\Azure\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAI\Embeddings;
use Symfony\AI\Platform\Bridge\Azure\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Embeddings;

require_once dirname(__DIR__).'/bootstrap.php';

Expand Down
4 changes: 2 additions & 2 deletions examples/document/vectorizing.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/

use Symfony\AI\Platform\Bridge\OpenAI\Embeddings;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Embeddings;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Store\Document\TextDocument;
use Symfony\AI\Store\Document\VectorDocument;
use Symfony\AI\Store\Document\Vectorizer;
Expand Down
4 changes: 2 additions & 2 deletions examples/lmstudio/chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/

use Symfony\AI\Agent\Agent;
use Symfony\AI\Platform\Bridge\LMStudio\Completions;
use Symfony\AI\Platform\Bridge\LMStudio\PlatformFactory;
use Symfony\AI\Platform\Bridge\LmStudio\Completions;
use Symfony\AI\Platform\Bridge\LmStudio\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

Expand Down
4 changes: 2 additions & 2 deletions examples/lmstudio/image-input-binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/

use Symfony\AI\Agent\Agent;
use Symfony\AI\Platform\Bridge\LMStudio\Completions;
use Symfony\AI\Platform\Bridge\LMStudio\PlatformFactory;
use Symfony\AI\Platform\Bridge\LmStudio\Completions;
use Symfony\AI\Platform\Bridge\LmStudio\PlatformFactory;
use Symfony\AI\Platform\Capability;
use Symfony\AI\Platform\Message\Content\Image;
use Symfony\AI\Platform\Message\Message;
Expand Down
10 changes: 5 additions & 5 deletions examples/memory/mariadb.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
use Symfony\AI\Agent\Agent;
use Symfony\AI\Agent\Memory\EmbeddingProvider;
use Symfony\AI\Agent\Memory\MemoryInputProcessor;
use Symfony\AI\Platform\Bridge\OpenAI\Embeddings;
use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Embeddings;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;
use Symfony\AI\Store\Bridge\MariaDB\Store;
use Symfony\AI\Store\Bridge\MariaDb\Store;
use Symfony\AI\Store\Document\Metadata;
use Symfony\AI\Store\Document\TextDocument;
use Symfony\AI\Store\Document\Vectorizer;
Expand Down Expand Up @@ -66,7 +66,7 @@
$embeddingsMemory = new EmbeddingProvider($platform, $embeddings, $store);
$memoryProcessor = new MemoryInputProcessor($embeddingsMemory);

$agent = new Agent($platform, new GPT(GPT::GPT_4O_MINI), [$memoryProcessor], logger: logger());
$agent = new Agent($platform, new Gpt(Gpt::GPT_4O_MINI), [$memoryProcessor], logger: logger());
$messages = new MessageBag(Message::ofUser('Have we discussed about my friend John in the past? If yes, what did we talk about?'));
$result = $agent->call($messages);

Expand Down
6 changes: 3 additions & 3 deletions examples/memory/static.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
use Symfony\AI\Agent\InputProcessor\SystemPromptInputProcessor;
use Symfony\AI\Agent\Memory\MemoryInputProcessor;
use Symfony\AI\Agent\Memory\StaticMemoryProvider;
use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

require_once dirname(__DIR__).'/bootstrap.php';

$platform = PlatformFactory::create($_ENV['OPENAI_API_KEY'], http_client());
$model = new GPT(GPT::GPT_4O_MINI);
$model = new Gpt(Gpt::GPT_4O_MINI);

$systemPromptProcessor = new SystemPromptInputProcessor('You are a professional trainer with short, personalized advices and a motivating claim.');

Expand Down
6 changes: 3 additions & 3 deletions examples/misc/chat-system-prompt.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

use Symfony\AI\Agent\Agent;
use Symfony\AI\Agent\InputProcessor\SystemPromptInputProcessor;
use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

require_once dirname(__DIR__).'/bootstrap.php';

$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
$model = new GPT(GPT::GPT_4O_MINI);
$model = new Gpt(Gpt::GPT_4O_MINI);

$processor = new SystemPromptInputProcessor('You are Yoda and write like he speaks. But short.');

Expand Down
6 changes: 3 additions & 3 deletions examples/misc/parallel-chat-gpt.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
* file that was distributed with this source code.
*/

use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

require_once dirname(__DIR__).'/bootstrap.php';

$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
$model = new GPT(GPT::GPT_4O_MINI, [
$model = new Gpt(Gpt::GPT_4O_MINI, [
'temperature' => 0.5, // default options for the model
]);

Expand Down
4 changes: 2 additions & 2 deletions examples/misc/parallel-embeddings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/

use Symfony\AI\Platform\Bridge\OpenAI\Embeddings;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Embeddings;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;

require_once dirname(__DIR__).'/bootstrap.php';

Expand Down
6 changes: 3 additions & 3 deletions examples/misc/persistent-chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
use Symfony\AI\Agent\Agent;
use Symfony\AI\Agent\Chat;
use Symfony\AI\Agent\Chat\MessageStore\InMemoryStore;
use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

require_once dirname(__DIR__).'/bootstrap.php';

$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
$llm = new GPT(GPT::GPT_4O_MINI);
$llm = new Gpt(Gpt::GPT_4O_MINI);

$agent = new Agent($platform, $llm, logger: logger());
$chat = new Chat($agent, new InMemoryStore());
Expand Down
6 changes: 3 additions & 3 deletions examples/openai/audio-input.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
*/

use Symfony\AI\Agent\Agent;
use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Content\Audio;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

require_once dirname(__DIR__).'/bootstrap.php';

$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
$model = new GPT(GPT::GPT_4O_AUDIO);
$model = new Gpt(Gpt::GPT_4O_AUDIO);

$agent = new Agent($platform, $model, logger: logger());
$messages = new MessageBag(
Expand Down
4 changes: 2 additions & 2 deletions examples/openai/audio-transcript.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* file that was distributed with this source code.
*/

use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAI\Whisper;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Whisper;
use Symfony\AI\Platform\Message\Content\Audio;

require_once dirname(__DIR__).'/bootstrap.php';
Expand Down
6 changes: 3 additions & 3 deletions examples/openai/chat-o1.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
*/

use Symfony\AI\Agent\Agent;
use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

Expand All @@ -23,7 +23,7 @@
}

$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
$model = new GPT(GPT::O1_PREVIEW);
$model = new Gpt(Gpt::O1_PREVIEW);

$prompt = <<<PROMPT
I want to build a Symfony app in PHP 8.2 that takes user questions and looks them
Expand Down
6 changes: 3 additions & 3 deletions examples/openai/chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
*/

use Symfony\AI\Agent\Agent;
use Symfony\AI\Platform\Bridge\OpenAI\GPT;
use Symfony\AI\Platform\Bridge\OpenAI\PlatformFactory;
use Symfony\AI\Platform\Bridge\OpenAi\Gpt;
use Symfony\AI\Platform\Bridge\OpenAi\PlatformFactory;
use Symfony\AI\Platform\Message\Message;
use Symfony\AI\Platform\Message\MessageBag;

require_once dirname(__DIR__).'/bootstrap.php';

$platform = PlatformFactory::create(env('OPENAI_API_KEY'), http_client());
$model = new GPT(GPT::GPT_4O_MINI, [
$model = new Gpt(Gpt::GPT_4O_MINI, [
'temperature' => 0.5, // default options for the model
]);

Expand Down
Loading
Loading