mirror of
https://github.com/symfony/ai.git
synced 2026-03-23 23:42:18 +01:00
Split bundle options into smaller chunks
This commit is contained in:
25
.github/scripts/validate-bridge-naming.sh
vendored
25
.github/scripts/validate-bridge-naming.sh
vendored
@@ -56,12 +56,29 @@ for composer_file in ${BRIDGE_PATH}/composer.json; do
|
||||
# Expected config key should be lowercase without dashes/underscores
|
||||
expected_config_key=$(echo "$bridge_name" | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# Look for ->arrayNode('configkey') in the options file
|
||||
if ! grep -q -- "->arrayNode('$expected_config_key')" "$OPTIONS_FILE"; then
|
||||
echo "::error file=$OPTIONS_FILE::Missing or incorrect config key for bridge '$bridge_name'. Expected '->arrayNode('$expected_config_key')' in ${BRIDGE_TYPE} configuration"
|
||||
# First check if there's an $import for this bridge type
|
||||
options_dir=$(dirname "$OPTIONS_FILE")
|
||||
# Config directories use underscores (message_store) while bridge types use dashes (message-store)
|
||||
config_dir_name=$(echo "$BRIDGE_TYPE" | tr '-' '_')
|
||||
import_pattern="\$import('${config_dir_name}/${expected_config_key}')"
|
||||
|
||||
if ! grep -q -- "$import_pattern" "$OPTIONS_FILE"; then
|
||||
echo "::error file=$OPTIONS_FILE::Missing import for bridge '$bridge_name'. Expected \"\$import('${config_dir_name}/${expected_config_key}')\" in ${BRIDGE_TYPE} configuration"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
continue
|
||||
fi
|
||||
|
||||
# Import found, check if the imported file exists
|
||||
imported_file="${options_dir}/${config_dir_name}/${expected_config_key}.php"
|
||||
|
||||
if [[ ! -f "$imported_file" ]]; then
|
||||
echo "::error file=$OPTIONS_FILE::Import found for '$expected_config_key' but file '$imported_file' does not exist"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
elif ! grep -q -- "ArrayNodeDefinition('$expected_config_key')" "$imported_file"; then
|
||||
echo "::error file=$imported_file::Missing or incorrect config key for bridge '$bridge_name'. Expected \"ArrayNodeDefinition('$expected_config_key')\" in imported file"
|
||||
ERRORS=$((ERRORS + 1))
|
||||
else
|
||||
echo "✓ $bridge_name: config key '$expected_config_key' found in options.php"
|
||||
echo "✓ $bridge_name: import and config key '$expected_config_key' found in ${config_dir_name}/${expected_config_key}.php"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
26
src/ai-bundle/config/message_store/cache.php
Normal file
26
src/ai-bundle/config/message_store/cache.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('cache'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('service')->cannotBeEmpty()->defaultValue('cache.app')->end()
|
||||
->stringNode('key')
|
||||
->info('The name of the message store will be used if the key is not set')
|
||||
->end()
|
||||
->integerNode('ttl')->end()
|
||||
->end()
|
||||
->end();
|
||||
27
src/ai-bundle/config/message_store/cloudflare.php
Normal file
27
src/ai-bundle/config/message_store/cloudflare.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('cloudflare'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('account_id')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('namespace')->cannotBeEmpty()->end()
|
||||
->stringNode('endpoint_url')
|
||||
->info('If the version of the Cloudflare API is updated, use this key to support it.')
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
29
src/ai-bundle/config/message_store/doctrine.php
Normal file
29
src/ai-bundle/config/message_store/doctrine.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('doctrine'))
|
||||
->children()
|
||||
->arrayNode('dbal')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('connection')->cannotBeEmpty()->end()
|
||||
->stringNode('table_name')
|
||||
->info('The name of the message store will be used if the table_name is not set')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
24
src/ai-bundle/config/message_store/meilisearch.php
Normal file
24
src/ai-bundle/config/message_store/meilisearch.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('meilisearch'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end();
|
||||
22
src/ai-bundle/config/message_store/memory.php
Normal file
22
src/ai-bundle/config/message_store/memory.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('memory'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('identifier')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end();
|
||||
28
src/ai-bundle/config/message_store/mongodb.php
Normal file
28
src/ai-bundle/config/message_store/mongodb.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use MongoDB\Client as MongoDbClient;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('mongodb'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue(MongoDbClient::class)
|
||||
->end()
|
||||
->stringNode('database')->isRequired()->end()
|
||||
->stringNode('collection')->isRequired()->end()
|
||||
->end()
|
||||
->end();
|
||||
24
src/ai-bundle/config/message_store/pogocache.php
Normal file
24
src/ai-bundle/config/message_store/pogocache.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('pogocache'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('password')->cannotBeEmpty()->end()
|
||||
->stringNode('key')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end();
|
||||
39
src/ai-bundle/config/message_store/redis.php
Normal file
39
src/ai-bundle/config/message_store/redis.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('redis'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->variableNode('connection_parameters')
|
||||
->info('see https://github.com/phpredis/phpredis?tab=readme-ov-file#example-1')
|
||||
->cannotBeEmpty()
|
||||
->end()
|
||||
->stringNode('client')
|
||||
->info('a service id of a Redis client')
|
||||
->cannotBeEmpty()
|
||||
->end()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => !isset($v['connection_parameters']) && !isset($v['client']))
|
||||
->thenInvalid('Either "connection_parameters" or "client" must be configured.')
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => isset($v['connection_parameters']) && isset($v['client']))
|
||||
->thenInvalid('Either "connection_parameters" or "client" can be configured, but not both.')
|
||||
->end()
|
||||
->end();
|
||||
22
src/ai-bundle/config/message_store/session.php
Normal file
22
src/ai-bundle/config/message_store/session.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('session'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('identifier')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end();
|
||||
30
src/ai-bundle/config/message_store/surrealdb.php
Normal file
30
src/ai-bundle/config/message_store/surrealdb.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('surrealdb'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('username')->cannotBeEmpty()->end()
|
||||
->stringNode('password')->cannotBeEmpty()->end()
|
||||
->stringNode('namespace')->cannotBeEmpty()->end()
|
||||
->stringNode('database')->cannotBeEmpty()->end()
|
||||
->stringNode('table')->end()
|
||||
->booleanNode('namespaced_user')
|
||||
->info('Using a namespaced user is a good practice to prevent any undesired access to a specific table, see https://surrealdb.com/docs/surrealdb/reference-guide/security-best-practices')
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
@@ -11,288 +11,46 @@
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Codewithkyrian\ChromaDB\Client as ChromaDbClient;
|
||||
use MongoDB\Client as MongoDbClient;
|
||||
use Probots\Pinecone\Client as PineconeClient;
|
||||
use Symfony\AI\Platform\Capability;
|
||||
use Symfony\AI\Platform\Model;
|
||||
use Symfony\AI\Platform\PlatformInterface;
|
||||
use Symfony\AI\Store\Document\VectorizerInterface;
|
||||
use Symfony\AI\Store\StoreInterface;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
return static function (DefinitionConfigurator $configurator): void {
|
||||
$import = fn (string $resource): ArrayNodeDefinition => require __DIR__.'/'.$resource.'.php';
|
||||
|
||||
$configurator->rootNode()
|
||||
->children()
|
||||
->arrayNode('platform')
|
||||
->children()
|
||||
->arrayNode('albert')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('base_url')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('anthropic')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('version')->defaultNull()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('azure')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('base_url')->isRequired()->end()
|
||||
->stringNode('deployment')->isRequired()->end()
|
||||
->stringNode('api_version')->info('The used API version')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('bedrock')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('bedrock_runtime_client')
|
||||
->defaultNull()
|
||||
->info('Service ID of the Bedrock runtime client to use')
|
||||
->end()
|
||||
->stringNode('model_catalog')->defaultNull()->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('cache')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('platform')->isRequired()->end()
|
||||
->stringNode('service')
|
||||
->info('The cache service id as defined under the "cache" configuration key')
|
||||
->defaultValue('cache.app')
|
||||
->end()
|
||||
->stringNode('cache_key')
|
||||
->info('Key used to store platform results, if not set, the current platform name will be used, the "prompt_cache_key" can be set during platform call to override this value')
|
||||
->end()
|
||||
->integerNode('ttl')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('cartesia')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('version')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('decart')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('host')
|
||||
->defaultValue('https://api.decart.ai/v1')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('elevenlabs')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('host')
|
||||
->defaultValue('https://api.elevenlabs.io/v1')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->booleanNode('api_catalog')
|
||||
->info('If set, the ElevenLabs API will be used to build the catalog and retrieve models information, using this option leads to additional HTTP calls')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('failover')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->arrayNode('platforms')
|
||||
->scalarPrototype()->end()
|
||||
->end()
|
||||
->stringNode('rate_limiter')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('gemini')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('generic')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('base_url')->isRequired()->end()
|
||||
->stringNode('api_key')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->stringNode('model_catalog')
|
||||
->info('Service ID of the model catalog to use')
|
||||
->end()
|
||||
->booleanNode('supports_completions')->defaultTrue()->end()
|
||||
->booleanNode('supports_embeddings')->defaultTrue()->end()
|
||||
->stringNode('completions_path')->defaultValue('/v1/chat/completions')->end()
|
||||
->stringNode('embeddings_path')->defaultValue('/v1/embeddings')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('huggingface')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('provider')->defaultValue('hf-inference')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('vertexai')
|
||||
->children()
|
||||
->stringNode('location')->isRequired()->end()
|
||||
->stringNode('project_id')->isRequired()->end()
|
||||
->stringNode('api_key')->defaultNull()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('openai')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->scalarNode('region')
|
||||
->defaultNull()
|
||||
->validate()
|
||||
->ifNotInArray([null, 'EU', 'US'])
|
||||
->thenInvalid('The region must be either "EU" (https://eu.api.openai.com), "US" (https://us.api.openai.com) or null (https://api.openai.com)')
|
||||
->end()
|
||||
->info('The region for OpenAI API (EU, US, or null for default)')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('mistral')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('openrouter')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('lmstudio')
|
||||
->children()
|
||||
->stringNode('host_url')->defaultValue('http://127.0.0.1:1234')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('ollama')
|
||||
->children()
|
||||
->stringNode('host_url')->defaultValue('http://127.0.0.1:11434')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->booleanNode('api_catalog')
|
||||
->info('If set, the Ollama API will be used to build the catalog and retrieve models information, using this option leads to additional HTTP calls')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('cerebras')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('voyage')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('perplexity')
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('dockermodelrunner')
|
||||
->children()
|
||||
->stringNode('host_url')->defaultValue('http://127.0.0.1:12434')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('scaleway')
|
||||
->children()
|
||||
->scalarNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('transformersphp')
|
||||
->children()
|
||||
->end()
|
||||
->end()
|
||||
->append($import('platform/albert'))
|
||||
->append($import('platform/anthropic'))
|
||||
->append($import('platform/azure'))
|
||||
->append($import('platform/bedrock'))
|
||||
->append($import('platform/cache'))
|
||||
->append($import('platform/cartesia'))
|
||||
->append($import('platform/cerebras'))
|
||||
->append($import('platform/decart'))
|
||||
->append($import('platform/dockermodelrunner'))
|
||||
->append($import('platform/elevenlabs'))
|
||||
->append($import('platform/failover'))
|
||||
->append($import('platform/gemini'))
|
||||
->append($import('platform/generic'))
|
||||
->append($import('platform/huggingface'))
|
||||
->append($import('platform/lmstudio'))
|
||||
->append($import('platform/mistral'))
|
||||
->append($import('platform/ollama'))
|
||||
->append($import('platform/openai'))
|
||||
->append($import('platform/openrouter'))
|
||||
->append($import('platform/perplexity'))
|
||||
->append($import('platform/scaleway'))
|
||||
->append($import('platform/transformersphp'))
|
||||
->append($import('platform/vertexai'))
|
||||
->append($import('platform/voyage'))
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('model')
|
||||
@@ -581,553 +339,42 @@ return static function (DefinitionConfigurator $configurator): void {
|
||||
->end()
|
||||
->arrayNode('store')
|
||||
->children()
|
||||
->arrayNode('azuresearch')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->isRequired()->end()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('index_name')->isRequired()->end()
|
||||
->stringNode('api_version')->isRequired()->end()
|
||||
->stringNode('vector_field')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('cache')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('service')->cannotBeEmpty()->defaultValue('cache.app')->end()
|
||||
->stringNode('cache_key')
|
||||
->info('The name of the store will be used if the key is not set')
|
||||
->end()
|
||||
->stringNode('strategy')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('chromadb')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue(ChromaDbClient::class)
|
||||
->end()
|
||||
->stringNode('collection')->isRequired()->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('clickhouse')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('dsn')->cannotBeEmpty()->end()
|
||||
->stringNode('http_client')->cannotBeEmpty()->end()
|
||||
->stringNode('database')->isRequired()->cannotBeEmpty()->end()
|
||||
->stringNode('table')->isRequired()->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn ($v): bool => !isset($v['dsn']) && !isset($v['http_client']))
|
||||
->thenInvalid('Either "dsn" or "http_client" must be configured.')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('cloudflare')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('account_id')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('metric')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->stringNode('endpoint')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('manticoresearch')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('table')->end()
|
||||
->stringNode('field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->stringNode('type')
|
||||
->defaultValue('hnsw')
|
||||
->end()
|
||||
->stringNode('similarity')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('quantization')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('mariadb')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('connection')->cannotBeEmpty()->end()
|
||||
->stringNode('table_name')->end()
|
||||
->stringNode('index_name')->cannotBeEmpty()->end()
|
||||
->stringNode('vector_field_name')->cannotBeEmpty()->end()
|
||||
->arrayNode('setup_options')
|
||||
->children()
|
||||
->integerNode('dimensions')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('meilisearch')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->end()
|
||||
->stringNode('embedder')
|
||||
->defaultValue('default')
|
||||
->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->floatNode('semantic_ratio')
|
||||
->info('The ratio between semantic (vector) and full-text search (0.0 to 1.0). Default: 1.0 (100% semantic)')
|
||||
->defaultValue(1.0)
|
||||
->min(0.0)
|
||||
->max(1.0)
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('memory')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('strategy')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('milvus')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('database')->end()
|
||||
->stringNode('collection')->isRequired()->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('metric_type')
|
||||
->defaultValue('COSINE')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('mongodb')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue(MongoDbClient::class)
|
||||
->end()
|
||||
->stringNode('database')->isRequired()->end()
|
||||
->stringNode('collection')->end()
|
||||
->stringNode('index_name')->isRequired()->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('vector')
|
||||
->end()
|
||||
->booleanNode('bulk_write')
|
||||
->defaultValue(false)
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('neo4j')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('username')->cannotBeEmpty()->end()
|
||||
->stringNode('password')->cannotBeEmpty()->end()
|
||||
->stringNode('database')->end()
|
||||
->stringNode('vector_index_name')->cannotBeEmpty()->end()
|
||||
->stringNode('node_name')->cannotBeEmpty()->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('embeddings')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('distance')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->booleanNode('quantization')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('elasticsearch')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->end()
|
||||
->stringNode('vectors_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('similarity')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('opensearch')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->end()
|
||||
->stringNode('vectors_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('space_type')
|
||||
->defaultValue('l2')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('pinecone')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue(PineconeClient::class)
|
||||
->end()
|
||||
->stringNode('index_name')->isRequired()->end()
|
||||
->stringNode('namespace')->end()
|
||||
->arrayNode('filter')
|
||||
->scalarPrototype()
|
||||
->defaultValue([])
|
||||
->end()
|
||||
->end()
|
||||
->integerNode('top_k')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('postgres')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('dsn')->cannotBeEmpty()->end()
|
||||
->stringNode('username')->end()
|
||||
->stringNode('password')->end()
|
||||
->stringNode('table_name')->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('embedding')
|
||||
->end()
|
||||
->enumNode('distance')
|
||||
->info('Distance metric to use for vector similarity search')
|
||||
->values(['cosine', 'inner_product', 'l1', 'l2'])
|
||||
->defaultValue('l2')
|
||||
->end()
|
||||
->stringNode('dbal_connection')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => !isset($v['dsn']) && !isset($v['dbal_connection']))
|
||||
->thenInvalid('Either "dsn" or "dbal_connection" must be configured.')
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => isset($v['dsn'], $v['dbal_connection']))
|
||||
->thenInvalid('Either "dsn" or "dbal_connection" can be configured, but not both.')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('qdrant')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('collection_name')->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('distance')
|
||||
->defaultValue('Cosine')
|
||||
->end()
|
||||
->booleanNode('async')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('redis')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->variableNode('connection_parameters')
|
||||
->info('see https://github.com/phpredis/phpredis?tab=readme-ov-file#example-1')
|
||||
->cannotBeEmpty()
|
||||
->end()
|
||||
->stringNode('client')
|
||||
->info('a service id of a Redis client')
|
||||
->cannotBeEmpty()
|
||||
->end()
|
||||
->stringNode('index_name')->end()
|
||||
->stringNode('key_prefix')
|
||||
->defaultValue('vector:')
|
||||
->end()
|
||||
->enumNode('distance')
|
||||
->info('Distance metric to use for vector similarity search')
|
||||
->values(['COSINE', 'L2', 'IP'])
|
||||
->defaultValue('COSINE')
|
||||
->end()
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => !isset($v['connection_parameters']) && !isset($v['client']))
|
||||
->thenInvalid('Either "connection_parameters" or "client" must be configured.')
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => isset($v['connection_parameters']) && isset($v['client']))
|
||||
->thenInvalid('Either "connection_parameters" or "client" can be configured, but not both.')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('supabase')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('http_client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->stringNode('url')->isRequired()->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->isRequired()->cannotBeEmpty()->end()
|
||||
->stringNode('table')->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('embedding')
|
||||
->end()
|
||||
->integerNode('vector_dimension')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('function_name')
|
||||
->defaultValue('match_documents')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('surrealdb')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('username')->cannotBeEmpty()->end()
|
||||
->stringNode('password')->cannotBeEmpty()->end()
|
||||
->stringNode('namespace')->cannotBeEmpty()->end()
|
||||
->stringNode('database')->cannotBeEmpty()->end()
|
||||
->stringNode('table')->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->stringNode('strategy')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->booleanNode('namespaced_user')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('typesense')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('collection')->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('weaviate')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('collection')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->append($import('store/azuresearch'))
|
||||
->append($import('store/cache'))
|
||||
->append($import('store/chromadb'))
|
||||
->append($import('store/clickhouse'))
|
||||
->append($import('store/cloudflare'))
|
||||
->append($import('store/elasticsearch'))
|
||||
->append($import('store/manticoresearch'))
|
||||
->append($import('store/mariadb'))
|
||||
->append($import('store/meilisearch'))
|
||||
->append($import('store/memory'))
|
||||
->append($import('store/milvus'))
|
||||
->append($import('store/mongodb'))
|
||||
->append($import('store/neo4j'))
|
||||
->append($import('store/opensearch'))
|
||||
->append($import('store/pinecone'))
|
||||
->append($import('store/postgres'))
|
||||
->append($import('store/qdrant'))
|
||||
->append($import('store/redis'))
|
||||
->append($import('store/supabase'))
|
||||
->append($import('store/surrealdb'))
|
||||
->append($import('store/typesense'))
|
||||
->append($import('store/weaviate'))
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('message_store')
|
||||
->children()
|
||||
->arrayNode('cache')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('service')->cannotBeEmpty()->defaultValue('cache.app')->end()
|
||||
->stringNode('key')
|
||||
->info('The name of the message store will be used if the key is not set')
|
||||
->end()
|
||||
->integerNode('ttl')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('cloudflare')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('account_id')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('namespace')->cannotBeEmpty()->end()
|
||||
->stringNode('endpoint_url')
|
||||
->info('If the version of the Cloudflare API is updated, use this key to support it.')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('doctrine')
|
||||
->children()
|
||||
->arrayNode('dbal')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('connection')->cannotBeEmpty()->end()
|
||||
->stringNode('table_name')
|
||||
->info('The name of the message store will be used if the table_name is not set')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('meilisearch')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('memory')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('identifier')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('mongodb')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue(MongoDbClient::class)
|
||||
->end()
|
||||
->stringNode('database')->isRequired()->end()
|
||||
->stringNode('collection')->isRequired()->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('pogocache')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('password')->cannotBeEmpty()->end()
|
||||
->stringNode('key')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('redis')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->variableNode('connection_parameters')
|
||||
->info('see https://github.com/phpredis/phpredis?tab=readme-ov-file#example-1')
|
||||
->cannotBeEmpty()
|
||||
->end()
|
||||
->stringNode('client')
|
||||
->info('a service id of a Redis client')
|
||||
->cannotBeEmpty()
|
||||
->end()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => !isset($v['connection_parameters']) && !isset($v['client']))
|
||||
->thenInvalid('Either "connection_parameters" or "client" must be configured.')
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => isset($v['connection_parameters']) && isset($v['client']))
|
||||
->thenInvalid('Either "connection_parameters" or "client" can be configured, but not both.')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('session')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('identifier')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('surrealdb')
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('username')->cannotBeEmpty()->end()
|
||||
->stringNode('password')->cannotBeEmpty()->end()
|
||||
->stringNode('namespace')->cannotBeEmpty()->end()
|
||||
->stringNode('database')->cannotBeEmpty()->end()
|
||||
->stringNode('table')->end()
|
||||
->booleanNode('namespaced_user')
|
||||
->info('Using a namespaced user is a good practice to prevent any undesired access to a specific table, see https://surrealdb.com/docs/surrealdb/reference-guide/security-best-practices')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->append($import('message_store/cache'))
|
||||
->append($import('message_store/cloudflare'))
|
||||
->append($import('message_store/doctrine'))
|
||||
->append($import('message_store/meilisearch'))
|
||||
->append($import('message_store/memory'))
|
||||
->append($import('message_store/mongodb'))
|
||||
->append($import('message_store/pogocache'))
|
||||
->append($import('message_store/redis'))
|
||||
->append($import('message_store/session'))
|
||||
->append($import('message_store/surrealdb'))
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('chat')
|
||||
|
||||
24
src/ai-bundle/config/platform/albert.php
Normal file
24
src/ai-bundle/config/platform/albert.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('albert'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('base_url')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
24
src/ai-bundle/config/platform/anthropic.php
Normal file
24
src/ai-bundle/config/platform/anthropic.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('anthropic'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('version')->defaultNull()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
29
src/ai-bundle/config/platform/azure.php
Normal file
29
src/ai-bundle/config/platform/azure.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('azure'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('base_url')->isRequired()->end()
|
||||
->stringNode('deployment')->isRequired()->end()
|
||||
->stringNode('api_version')->info('The used API version')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
26
src/ai-bundle/config/platform/bedrock.php
Normal file
26
src/ai-bundle/config/platform/bedrock.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('bedrock'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('bedrock_runtime_client')
|
||||
->defaultNull()
|
||||
->info('Service ID of the Bedrock runtime client to use')
|
||||
->end()
|
||||
->stringNode('model_catalog')->defaultNull()->end()
|
||||
->end()
|
||||
->end();
|
||||
30
src/ai-bundle/config/platform/cache.php
Normal file
30
src/ai-bundle/config/platform/cache.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('cache'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('platform')->isRequired()->end()
|
||||
->stringNode('service')
|
||||
->info('The cache service id as defined under the "cache" configuration key')
|
||||
->defaultValue('cache.app')
|
||||
->end()
|
||||
->stringNode('cache_key')
|
||||
->info('Key used to store platform results, if not set, the current platform name will be used, the "prompt_cache_key" can be set during platform call to override this value')
|
||||
->end()
|
||||
->integerNode('ttl')->end()
|
||||
->end()
|
||||
->end();
|
||||
24
src/ai-bundle/config/platform/cartesia.php
Normal file
24
src/ai-bundle/config/platform/cartesia.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('cartesia'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('version')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
23
src/ai-bundle/config/platform/cerebras.php
Normal file
23
src/ai-bundle/config/platform/cerebras.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('cerebras'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
26
src/ai-bundle/config/platform/decart.php
Normal file
26
src/ai-bundle/config/platform/decart.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('decart'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('host')
|
||||
->defaultValue('https://api.decart.ai/v1')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
23
src/ai-bundle/config/platform/dockermodelrunner.php
Normal file
23
src/ai-bundle/config/platform/dockermodelrunner.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('dockermodelrunner'))
|
||||
->children()
|
||||
->stringNode('host_url')->defaultValue('http://127.0.0.1:12434')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
29
src/ai-bundle/config/platform/elevenlabs.php
Normal file
29
src/ai-bundle/config/platform/elevenlabs.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('elevenlabs'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('host')
|
||||
->defaultValue('https://api.elevenlabs.io/v1')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->booleanNode('api_catalog')
|
||||
->info('If set, the ElevenLabs API will be used to build the catalog and retrieve models information, using this option leads to additional HTTP calls')
|
||||
->end()
|
||||
->end();
|
||||
25
src/ai-bundle/config/platform/failover.php
Normal file
25
src/ai-bundle/config/platform/failover.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('failover'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->arrayNode('platforms')
|
||||
->scalarPrototype()->end()
|
||||
->end()
|
||||
->stringNode('rate_limiter')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end();
|
||||
23
src/ai-bundle/config/platform/gemini.php
Normal file
23
src/ai-bundle/config/platform/gemini.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('gemini'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
34
src/ai-bundle/config/platform/generic.php
Normal file
34
src/ai-bundle/config/platform/generic.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('generic'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('base_url')->isRequired()->end()
|
||||
->stringNode('api_key')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->stringNode('model_catalog')
|
||||
->info('Service ID of the model catalog to use')
|
||||
->end()
|
||||
->booleanNode('supports_completions')->defaultTrue()->end()
|
||||
->booleanNode('supports_embeddings')->defaultTrue()->end()
|
||||
->stringNode('completions_path')->defaultValue('/v1/chat/completions')->end()
|
||||
->stringNode('embeddings_path')->defaultValue('/v1/embeddings')->end()
|
||||
->end()
|
||||
->end();
|
||||
24
src/ai-bundle/config/platform/huggingface.php
Normal file
24
src/ai-bundle/config/platform/huggingface.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('huggingface'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('provider')->defaultValue('hf-inference')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
23
src/ai-bundle/config/platform/lmstudio.php
Normal file
23
src/ai-bundle/config/platform/lmstudio.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('lmstudio'))
|
||||
->children()
|
||||
->stringNode('host_url')->defaultValue('http://127.0.0.1:1234')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
23
src/ai-bundle/config/platform/mistral.php
Normal file
23
src/ai-bundle/config/platform/mistral.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('mistral'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
26
src/ai-bundle/config/platform/ollama.php
Normal file
26
src/ai-bundle/config/platform/ollama.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('ollama'))
|
||||
->children()
|
||||
->stringNode('host_url')->defaultValue('http://127.0.0.1:11434')->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->booleanNode('api_catalog')
|
||||
->info('If set, the Ollama API will be used to build the catalog and retrieve models information, using this option leads to additional HTTP calls')
|
||||
->end()
|
||||
->end();
|
||||
31
src/ai-bundle/config/platform/openai.php
Normal file
31
src/ai-bundle/config/platform/openai.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('openai'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->scalarNode('region')
|
||||
->defaultNull()
|
||||
->validate()
|
||||
->ifNotInArray([null, 'EU', 'US'])
|
||||
->thenInvalid('The region must be either "EU" (https://eu.api.openai.com), "US" (https://us.api.openai.com) or null (https://api.openai.com)')
|
||||
->end()
|
||||
->info('The region for OpenAI API (EU, US, or null for default)')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
23
src/ai-bundle/config/platform/openrouter.php
Normal file
23
src/ai-bundle/config/platform/openrouter.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('openrouter'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
23
src/ai-bundle/config/platform/perplexity.php
Normal file
23
src/ai-bundle/config/platform/perplexity.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('perplexity'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
23
src/ai-bundle/config/platform/scaleway.php
Normal file
23
src/ai-bundle/config/platform/scaleway.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('scaleway'))
|
||||
->children()
|
||||
->scalarNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
18
src/ai-bundle/config/platform/transformersphp.php
Normal file
18
src/ai-bundle/config/platform/transformersphp.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('transformersphp'))
|
||||
->children()
|
||||
->end();
|
||||
25
src/ai-bundle/config/platform/vertexai.php
Normal file
25
src/ai-bundle/config/platform/vertexai.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('vertexai'))
|
||||
->children()
|
||||
->stringNode('location')->isRequired()->end()
|
||||
->stringNode('project_id')->isRequired()->end()
|
||||
->stringNode('api_key')->defaultNull()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
23
src/ai-bundle/config/platform/voyage.php
Normal file
23
src/ai-bundle/config/platform/voyage.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('voyage'))
|
||||
->children()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->end();
|
||||
26
src/ai-bundle/config/store/azuresearch.php
Normal file
26
src/ai-bundle/config/store/azuresearch.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('azuresearch'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->isRequired()->end()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('index_name')->isRequired()->end()
|
||||
->stringNode('api_version')->isRequired()->end()
|
||||
->stringNode('vector_field')->end()
|
||||
->end()
|
||||
->end();
|
||||
26
src/ai-bundle/config/store/cache.php
Normal file
26
src/ai-bundle/config/store/cache.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('cache'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('service')->cannotBeEmpty()->defaultValue('cache.app')->end()
|
||||
->stringNode('cache_key')
|
||||
->info('The name of the store will be used if the key is not set')
|
||||
->end()
|
||||
->stringNode('strategy')->end()
|
||||
->end()
|
||||
->end();
|
||||
27
src/ai-bundle/config/store/chromadb.php
Normal file
27
src/ai-bundle/config/store/chromadb.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Codewithkyrian\ChromaDB\Client as ChromaDbClient;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('chromadb'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue(ChromaDbClient::class)
|
||||
->end()
|
||||
->stringNode('collection')->isRequired()->end()
|
||||
->end()
|
||||
->end();
|
||||
29
src/ai-bundle/config/store/clickhouse.php
Normal file
29
src/ai-bundle/config/store/clickhouse.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('clickhouse'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('dsn')->cannotBeEmpty()->end()
|
||||
->stringNode('http_client')->cannotBeEmpty()->end()
|
||||
->stringNode('database')->isRequired()->cannotBeEmpty()->end()
|
||||
->stringNode('table')->isRequired()->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn ($v): bool => !isset($v['dsn']) && !isset($v['http_client']))
|
||||
->thenInvalid('Either "dsn" or "http_client" must be configured.')
|
||||
->end()
|
||||
->end();
|
||||
31
src/ai-bundle/config/store/cloudflare.php
Normal file
31
src/ai-bundle/config/store/cloudflare.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('cloudflare'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('account_id')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('metric')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->stringNode('endpoint')->end()
|
||||
->end()
|
||||
->end();
|
||||
35
src/ai-bundle/config/store/elasticsearch.php
Normal file
35
src/ai-bundle/config/store/elasticsearch.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('elasticsearch'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->end()
|
||||
->stringNode('vectors_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('similarity')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
36
src/ai-bundle/config/store/manticoresearch.php
Normal file
36
src/ai-bundle/config/store/manticoresearch.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('manticoresearch'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('table')->end()
|
||||
->stringNode('field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->stringNode('type')
|
||||
->defaultValue('hnsw')
|
||||
->end()
|
||||
->stringNode('similarity')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('quantization')->end()
|
||||
->end()
|
||||
->end();
|
||||
30
src/ai-bundle/config/store/mariadb.php
Normal file
30
src/ai-bundle/config/store/mariadb.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('mariadb'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('connection')->cannotBeEmpty()->end()
|
||||
->stringNode('table_name')->end()
|
||||
->stringNode('index_name')->cannotBeEmpty()->end()
|
||||
->stringNode('vector_field_name')->cannotBeEmpty()->end()
|
||||
->arrayNode('setup_options')
|
||||
->children()
|
||||
->integerNode('dimensions')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
39
src/ai-bundle/config/store/meilisearch.php
Normal file
39
src/ai-bundle/config/store/meilisearch.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('meilisearch'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->end()
|
||||
->stringNode('embedder')
|
||||
->defaultValue('default')
|
||||
->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->floatNode('semantic_ratio')
|
||||
->info('The ratio between semantic (vector) and full-text search (0.0 to 1.0). Default: 1.0 (100% semantic)')
|
||||
->defaultValue(1.0)
|
||||
->min(0.0)
|
||||
->max(1.0)
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
22
src/ai-bundle/config/store/memory.php
Normal file
22
src/ai-bundle/config/store/memory.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('memory'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('strategy')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->end();
|
||||
34
src/ai-bundle/config/store/milvus.php
Normal file
34
src/ai-bundle/config/store/milvus.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('milvus'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('database')->end()
|
||||
->stringNode('collection')->isRequired()->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('metric_type')
|
||||
->defaultValue('COSINE')
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
35
src/ai-bundle/config/store/mongodb.php
Normal file
35
src/ai-bundle/config/store/mongodb.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use MongoDB\Client as MongoDbClient;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('mongodb'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue(MongoDbClient::class)
|
||||
->end()
|
||||
->stringNode('database')->isRequired()->end()
|
||||
->stringNode('collection')->end()
|
||||
->stringNode('index_name')->isRequired()->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('vector')
|
||||
->end()
|
||||
->booleanNode('bulk_write')
|
||||
->defaultValue(false)
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
37
src/ai-bundle/config/store/neo4j.php
Normal file
37
src/ai-bundle/config/store/neo4j.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('neo4j'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('username')->cannotBeEmpty()->end()
|
||||
->stringNode('password')->cannotBeEmpty()->end()
|
||||
->stringNode('database')->end()
|
||||
->stringNode('vector_index_name')->cannotBeEmpty()->end()
|
||||
->stringNode('node_name')->cannotBeEmpty()->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('embeddings')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('distance')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->booleanNode('quantization')->end()
|
||||
->end()
|
||||
->end();
|
||||
35
src/ai-bundle/config/store/opensearch.php
Normal file
35
src/ai-bundle/config/store/opensearch.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('opensearch'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('index_name')->end()
|
||||
->stringNode('vectors_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('space_type')
|
||||
->defaultValue('l2')
|
||||
->end()
|
||||
->stringNode('http_client')
|
||||
->defaultValue('http_client')
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
34
src/ai-bundle/config/store/pinecone.php
Normal file
34
src/ai-bundle/config/store/pinecone.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Probots\Pinecone\Client as PineconeClient;
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('pinecone'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue(PineconeClient::class)
|
||||
->end()
|
||||
->stringNode('index_name')->isRequired()->end()
|
||||
->stringNode('namespace')->end()
|
||||
->arrayNode('filter')
|
||||
->scalarPrototype()
|
||||
->defaultValue([])
|
||||
->end()
|
||||
->end()
|
||||
->integerNode('top_k')->end()
|
||||
->end()
|
||||
->end();
|
||||
42
src/ai-bundle/config/store/postgres.php
Normal file
42
src/ai-bundle/config/store/postgres.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('postgres'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('dsn')->cannotBeEmpty()->end()
|
||||
->stringNode('username')->end()
|
||||
->stringNode('password')->end()
|
||||
->stringNode('table_name')->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('embedding')
|
||||
->end()
|
||||
->enumNode('distance')
|
||||
->info('Distance metric to use for vector similarity search')
|
||||
->values(['cosine', 'inner_product', 'l1', 'l2'])
|
||||
->defaultValue('l2')
|
||||
->end()
|
||||
->stringNode('dbal_connection')->cannotBeEmpty()->end()
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => !isset($v['dsn']) && !isset($v['dbal_connection']))
|
||||
->thenInvalid('Either "dsn" or "dbal_connection" must be configured.')
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => isset($v['dsn'], $v['dbal_connection']))
|
||||
->thenInvalid('Either "dsn" or "dbal_connection" can be configured, but not both.')
|
||||
->end()
|
||||
->end();
|
||||
31
src/ai-bundle/config/store/qdrant.php
Normal file
31
src/ai-bundle/config/store/qdrant.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('qdrant'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->cannotBeEmpty()->end()
|
||||
->stringNode('collection_name')->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('distance')
|
||||
->defaultValue('Cosine')
|
||||
->end()
|
||||
->booleanNode('async')->end()
|
||||
->end()
|
||||
->end();
|
||||
46
src/ai-bundle/config/store/redis.php
Normal file
46
src/ai-bundle/config/store/redis.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('redis'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->variableNode('connection_parameters')
|
||||
->info('see https://github.com/phpredis/phpredis?tab=readme-ov-file#example-1')
|
||||
->cannotBeEmpty()
|
||||
->end()
|
||||
->stringNode('client')
|
||||
->info('a service id of a Redis client')
|
||||
->cannotBeEmpty()
|
||||
->end()
|
||||
->stringNode('index_name')->end()
|
||||
->stringNode('key_prefix')
|
||||
->defaultValue('vector:')
|
||||
->end()
|
||||
->enumNode('distance')
|
||||
->info('Distance metric to use for vector similarity search')
|
||||
->values(['COSINE', 'L2', 'IP'])
|
||||
->defaultValue('COSINE')
|
||||
->end()
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => !isset($v['connection_parameters']) && !isset($v['client']))
|
||||
->thenInvalid('Either "connection_parameters" or "client" must be configured.')
|
||||
->end()
|
||||
->validate()
|
||||
->ifTrue(static fn (array $v): bool => isset($v['connection_parameters']) && isset($v['client']))
|
||||
->thenInvalid('Either "connection_parameters" or "client" can be configured, but not both.')
|
||||
->end()
|
||||
->end();
|
||||
38
src/ai-bundle/config/store/supabase.php
Normal file
38
src/ai-bundle/config/store/supabase.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('supabase'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('http_client')
|
||||
->cannotBeEmpty()
|
||||
->defaultValue('http_client')
|
||||
->info('Service ID of the HTTP client to use')
|
||||
->end()
|
||||
->stringNode('url')->isRequired()->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->isRequired()->cannotBeEmpty()->end()
|
||||
->stringNode('table')->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('embedding')
|
||||
->end()
|
||||
->integerNode('vector_dimension')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->stringNode('function_name')
|
||||
->defaultValue('match_documents')
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
37
src/ai-bundle/config/store/surrealdb.php
Normal file
37
src/ai-bundle/config/store/surrealdb.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('surrealdb'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('username')->cannotBeEmpty()->end()
|
||||
->stringNode('password')->cannotBeEmpty()->end()
|
||||
->stringNode('namespace')->cannotBeEmpty()->end()
|
||||
->stringNode('database')->cannotBeEmpty()->end()
|
||||
->stringNode('table')->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->stringNode('strategy')
|
||||
->defaultValue('cosine')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->booleanNode('namespaced_user')->end()
|
||||
->end()
|
||||
->end();
|
||||
30
src/ai-bundle/config/store/typesense.php
Normal file
30
src/ai-bundle/config/store/typesense.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('typesense'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('collection')->end()
|
||||
->stringNode('vector_field')
|
||||
->defaultValue('_vectors')
|
||||
->end()
|
||||
->integerNode('dimensions')
|
||||
->defaultValue(1536)
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
24
src/ai-bundle/config/store/weaviate.php
Normal file
24
src/ai-bundle/config/store/weaviate.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\Config\Definition\Configurator;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
|
||||
|
||||
return (new ArrayNodeDefinition('weaviate'))
|
||||
->useAttributeAsKey('name')
|
||||
->arrayPrototype()
|
||||
->children()
|
||||
->stringNode('endpoint')->cannotBeEmpty()->end()
|
||||
->stringNode('api_key')->isRequired()->end()
|
||||
->stringNode('collection')->end()
|
||||
->end()
|
||||
->end();
|
||||
Reference in New Issue
Block a user