Skip to content

Change bundle extension from symfony_ai to ai #148

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 1 commit into from
Jul 17, 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
6 changes: 3 additions & 3 deletions demo/config/packages/ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ai:
api_key: '%env(OPENAI_API_KEY)%'
agent:
blog:
# platform: 'symfony_ai.platform.anthropic'
# platform: 'ai.platform.anthropic'
model:
class: 'Symfony\AI\Platform\Bridge\OpenAI\GPT'
name: !php/const Symfony\AI\Platform\Bridge\OpenAI\GPT::GPT_4O_MINI
Expand Down Expand Up @@ -36,7 +36,7 @@ ai:
system_prompt: 'You are a friendly chatbot that likes to have a conversation with users and asks them some questions.'
tools:
# Agent in agent 🤯
- service: 'symfony_ai.agent.blog'
- service: 'ai.agent.blog'
name: 'symfony_blog'
description: 'Can answer questions based on the Symfony blog.'
is_agent: true
Expand All @@ -61,5 +61,5 @@ services:
# $apiKey: '%env(SERP_API_KEY)%'
Symfony\AI\Agent\Toolbox\Tool\Wikipedia: ~
Symfony\AI\Agent\Toolbox\Tool\SimilaritySearch:
$model: '@symfony_ai.indexer.default.model'
$model: '@ai.indexer.default.model'

2 changes: 1 addition & 1 deletion demo/src/Audio/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class Chat
public function __construct(
private readonly PlatformInterface $platform,
private readonly RequestStack $requestStack,
#[Autowire(service: 'symfony_ai.agent.audio')]
#[Autowire(service: 'ai.agent.audio')]
private readonly AgentInterface $agent,
) {
}
Expand Down
2 changes: 1 addition & 1 deletion demo/src/Blog/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class Chat

public function __construct(
private readonly RequestStack $requestStack,
#[Autowire(service: 'symfony_ai.agent.blog')]
#[Autowire(service: 'ai.agent.blog')]
private readonly AgentInterface $agent,
) {
}
Expand Down
2 changes: 1 addition & 1 deletion demo/src/Wikipedia/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class Chat

public function __construct(
private readonly RequestStack $requestStack,
#[Autowire(service: 'symfony_ai.agent.wikipedia')]
#[Autowire(service: 'ai.agent.wikipedia')]
private readonly AgentInterface $agent,
) {
}
Expand Down
2 changes: 1 addition & 1 deletion demo/src/YouTube/Chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ final class Chat

public function __construct(
private readonly RequestStack $requestStack,
#[Autowire(service: 'symfony_ai.agent.youtube')]
#[Autowire(service: 'ai.agent.youtube')]
private readonly AgentInterface $agent,
private readonly TranscriptFetcher $transcriptFetcher,
) {
Expand Down
4 changes: 2 additions & 2 deletions src/ai-bundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ CHANGELOG
* Add Symfony bundle for integrating Platform, Agent, and Store components
* Add service configuration:
- Agent services with configurable platforms and system prompts
- Tool registration via `#[AsTool]` attribute and `symfony_ai.tool` tag
- Input/Output processor registration via `symfony_ai.agent.input_processor` and `symfony_ai.agent.output_processor` tags
- Tool registration via `#[AsTool]` attribute and `ai.tool` tag
- Input/Output processor registration via `ai.agent.input_processor` and `ai.agent.output_processor` tags
- Abstract service definitions for extensibility
* Add Symfony Profiler integration for monitoring AI interactions
* Add security integration:
Expand Down
22 changes: 11 additions & 11 deletions src/ai-bundle/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
->set(ResponseFormatFactory::class)
->alias(ResponseFormatFactoryInterface::class, ResponseFormatFactory::class)
->set(StructureOutputProcessor::class)
->tag('symfony_ai.agent.input_processor')
->tag('symfony_ai.agent.output_processor')
->tag('ai.agent.input_processor')
->tag('ai.agent.output_processor')

// tools
->set('symfony_ai.toolbox.abstract')
->set('ai.toolbox.abstract')
->class(Toolbox::class)
->autowire()
->abstract()
Expand All @@ -47,37 +47,37 @@
'$tools' => abstract_arg('Collection of tools'),
])
->set(Toolbox::class)
->parent('symfony_ai.toolbox.abstract')
->parent('ai.toolbox.abstract')
->args([
'$tools' => tagged_iterator('symfony_ai.tool'),
'$tools' => tagged_iterator('ai.tool'),
])
->alias(ToolboxInterface::class, Toolbox::class)
->set(ReflectionToolFactory::class)
->alias(ToolFactoryInterface::class, ReflectionToolFactory::class)
->set(ToolResultConverter::class)
->set(ToolCallArgumentResolver::class)
->set('symfony_ai.tool.agent_processor.abstract')
->set('ai.tool.agent_processor.abstract')
->class(ToolProcessor::class)
->abstract()
->args([
'$toolbox' => abstract_arg('Toolbox'),
])
->set(ToolProcessor::class)
->parent('symfony_ai.tool.agent_processor.abstract')
->tag('symfony_ai.agent.input_processor')
->tag('symfony_ai.agent.output_processor')
->parent('ai.tool.agent_processor.abstract')
->tag('ai.agent.input_processor')
->tag('ai.agent.output_processor')
->args([
'$toolbox' => service(ToolboxInterface::class),
'$eventDispatcher' => service('event_dispatcher')->nullOnInvalid(),
])
->set('symfony_ai.security.is_granted_attribute_listener', IsGrantedToolAttributeListener::class)
->set('ai.security.is_granted_attribute_listener', IsGrantedToolAttributeListener::class)
->tag('kernel.event_listener')

// profiler
->set(DataCollector::class)
->tag('data_collector')
->set(TraceableToolbox::class)
->decorate(ToolboxInterface::class)
->tag('symfony_ai.traceable_toolbox')
->tag('ai.traceable_toolbox')
;
};
10 changes: 5 additions & 5 deletions src/ai-bundle/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Configuration
api_key: '%env(GOOGLE_API_KEY)%'
agent:
rag:
platform: 'symfony_ai.platform.azure.gpt_deployment'
platform: 'ai.platform.azure.gpt_deployment'
structured_output: false # Disables support for "output_structure" option, default is true
model:
class: 'Symfony\AI\Platform\Bridge\OpenAI\GPT'
Expand All @@ -72,12 +72,12 @@ Configuration
method: 'foo' # Optional with default value '__invoke'

# Referencing a agent => agent in agent 🤯
- service: 'symfony_ai.agent.research'
- service: 'ai.agent.research'
name: 'wikipedia_research'
description: 'Can research on Wikipedia'
is_agent: true
research:
platform: 'symfony_ai.platform.anthropic'
platform: 'ai.platform.anthropic'
model:
class: 'Symfony\AI\Platform\Bridge\Anthropic\Claude'
name: !php/const Symfony\AI\Platform\Bridge\Anthropic\Claude::SONNET_37
Expand All @@ -92,8 +92,8 @@ Configuration
collection: 'my_collection'
indexer:
default:
# platform: 'symfony_ai.platform.mistral'
# store: 'symfony_ai.store.chroma_db.default'
# platform: 'ai.platform.mistral'
# store: 'ai.store.chroma_db.default'
model:
class: 'Symfony\AI\Platform\Bridge\Mistral\Embeddings'
name: !php/const Symfony\AI\Platform\Bridge\Mistral\Embeddings::MISTRAL_EMBED
Expand Down
Loading