1212 * that conditionally excludes certain Spring AI Azure/OpenAI auto-configurations from being
1313 * loaded into the application context.
1414 * <p>
15- * This filter checks the value of the property defined by
16- * {@link Constants#HYPERION_ENABLED_PROPERTY_NAME}. If the property is {@code false} or absent,
17- * all auto-configuration fully qualified class names starting with org.springframework.ai will be
18- * filtered out and not applied. If the property is {@code true}, the filter allows all
15+ * This filter checks whether Hyperion or Atlas modules are enabled. If both are disabled,
16+ * all autoconfiguration fully qualified class names starting with org.springframework.ai will be
17+ * filtered out and not applied. If either module is enabled, the filter allows all
1918 * auto-configurations to proceed (it does not re-include anything excluded elsewhere such
2019 * as through {@code spring.autoconfigure.exclude} in YAML).
2120 * <p>
22- * This mechanism is useful to prevent unnecessary bean creation when the
23- * "Hyperion" feature is disabled, while still permitting the application to start normally.
21+ * This mechanism is useful to prevent unnecessary bean creation when both the
22+ * "Hyperion" and "Atlas" features are disabled, while still permitting the application to start normally.
2423 * <p>
2524 * Note that this filter only affects the specified classes. Other exclusions (e.g. via
2625 * {@code spring.autoconfigure.exclude} in {@code application.yml}) still apply independently.
@@ -38,6 +37,8 @@ public class SpringAIAutoConfigurationFilter implements AutoConfigurationImportF
3837 @ Override
3938 public boolean [] match (String [] autoConfigurationClasses , AutoConfigurationMetadata metadata ) {
4039 boolean hyperionEnabled = env .getProperty (Constants .HYPERION_ENABLED_PROPERTY_NAME , Boolean .class , false );
40+ boolean atlasEnabled = env .getProperty (Constants .ATLAS_ENABLED_PROPERTY_NAME , Boolean .class , false );
41+ boolean springAIEnabled = hyperionEnabled || atlasEnabled ;
4142
4243 boolean [] matches = new boolean [autoConfigurationClasses .length ];
4344 for (int i = 0 ; i < autoConfigurationClasses .length ; i ++) {
@@ -48,9 +49,9 @@ public boolean[] match(String[] autoConfigurationClasses, AutoConfigurationMetad
4849 continue ;
4950 }
5051
51- matches [i ] = hyperionEnabled || !fullyQualifiedClassName .startsWith ("org.springframework.ai" );
52+ matches [i ] = springAIEnabled || !fullyQualifiedClassName .startsWith ("org.springframework.ai" );
5253 if (!matches [i ]) {
53- log .debug ("Excluding auto-configuration: {} because Hyperion is disabled" , fullyQualifiedClassName );
54+ log .debug ("Excluding auto-configuration: {} because Hyperion and Atlas are disabled" , fullyQualifiedClassName );
5455 }
5556 }
5657 return matches ;
0 commit comments