Skip to content
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
1 change: 0 additions & 1 deletion demo/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"mrmysql/youtube-transcript": "^0.0.5",
"nyholm/psr7": "^1.8",
"php-http/discovery": "^1.20",
"symfony/ai-azure-platform": "@dev",
"symfony/ai-bundle": "@dev",
"symfony/ai-chroma-db-store": "@dev",
"symfony/ai-clock-tool": "@dev",
Expand Down
15 changes: 14 additions & 1 deletion demo/config/reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,16 @@
* version: string,
* http_client?: string, // Service ID of the HTTP client to use // Default: "http_client"
* },
* decart?: array{
* api_key: string,
* host?: string, // Default: "https://api.decart.ai/v1"
* http_client?: string, // Service ID of the HTTP client to use // Default: "http_client"
* },
* elevenlabs?: array{
* api_key: string,
* host?: string, // Default: "https://api.elevenlabs.io/v1"
* http_client?: string, // Service ID of the HTTP client to use // Default: "http_client"
* api_catalog?: bool, // If set, the ElevenLabs API will be used to build the catalog and retrieve models information, using this option leads to additional HTTP calls
* },
* gemini?: array{
* api_key: string,
Expand Down Expand Up @@ -236,7 +242,6 @@
* }>>,
* agent?: array<string, array{ // Default: []
* platform?: string, // Service name of platform // Default: "Symfony\\AI\\Platform\\PlatformInterface"
* track_token_usage?: bool, // Enable tracking of token usage for the agent // Default: true
* model?: mixed,
* memory?: mixed, // Memory configuration: string for static memory, or array with "service" key for service reference // Default: null
* prompt?: string|array{ // The system prompt configuration
Expand Down Expand Up @@ -355,6 +360,14 @@
* distance?: string, // Default: "cosine"
* quantization?: bool,
* }>,
* elasticsearch?: array<string, array{ // Default: []
* endpoint?: string,
* index_name?: string,
* vectors_field?: string, // Default: "_vectors"
* dimensions?: int, // Default: 1536
* similarity?: string, // Default: "cosine"
* http_client?: string, // Default: "http_client"
* }>,
* opensearch?: array<string, array{ // Default: []
* endpoint?: string,
* index_name?: string,
Expand Down
16 changes: 8 additions & 8 deletions src/ai-bundle/src/AiBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,11 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
}

if ('azure' === $type) {
if (!ContainerBuilder::willBeAvailable('symfony/ai-azure-platform', AzureOpenAiPlatformFactory::class, ['symfony/ai-bundle'])) {
throw new RuntimeException('Azure platform configuration requires "symfony/ai-azure-platform" package. Try running "composer require symfony/ai-azure-platform".');
}

foreach ($platform as $name => $config) {
if (!ContainerBuilder::willBeAvailable('symfony/ai-azure-platform', AzureOpenAiPlatformFactory::class, ['symfony/ai-bundle'])) {
throw new RuntimeException('Azure platform configuration requires "symfony/ai-azure-platform" package. Try running "composer require symfony/ai-azure-platform".');
}

$platformId = 'ai.platform.azure.'.$name;
$definition = (new Definition(Platform::class))
->setFactory(AzureOpenAiPlatformFactory::class.'::create')
Expand Down Expand Up @@ -536,11 +536,11 @@ private function processPlatformConfig(string $type, array $platform, ContainerB
}

if ('generic' === $type) {
if (!ContainerBuilder::willBeAvailable('symfony/ai-generic-platform', GenericPlatformFactory::class, ['symfony/ai-bundle'])) {
throw new RuntimeException('Generic platform configuration requires "symfony/ai-generic-platform" package. Try running "composer require symfony/ai-generic-platform".');
}

foreach ($platform as $name => $config) {
if (!ContainerBuilder::willBeAvailable('symfony/ai-generic-platform', GenericPlatformFactory::class, ['symfony/ai-bundle'])) {
throw new RuntimeException('Generic platform configuration requires "symfony/ai-generic-platform" package. Try running "composer require symfony/ai-generic-platform".');
}

$platformId = 'ai.platform.generic.'.$name;
$definition = (new Definition(Platform::class))
->setFactory(GenericPlatformFactory::class.'::create')
Expand Down