feat: Add Spring Boot auto-configuration for lm-lib modules
- Introduced auto-configuration classes for profile, client, agent, and prompt modules. - Updated README to reflect new modular architecture and configuration properties. - Added selective enabling/disabling of modules via application properties. - Refactored existing services and strategies to remove unnecessary Spring annotations. - Enhanced test configurations to utilize auto-configuration. - Updated META-INF imports to include new auto-configuration classes.
This commit is contained in:
@@ -10,11 +10,9 @@ import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.core.env.ConfigurableEnvironment;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.io.support.ResourcePropertySource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import de.extio.lmlib.profile.ModelProfile.ModelProvider;
|
||||
|
||||
@Service
|
||||
public class ModelProfileService {
|
||||
|
||||
private final Environment environment;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package de.extio.lmlib.profile;
|
||||
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
@AutoConfiguration
|
||||
@ConditionalOnProperty(prefix = "lmlib.profile", name = "enabled", havingValue = "true", matchIfMissing = true)
|
||||
public class ProfileAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
ModelProfileService modelProfileService(final Environment environment) {
|
||||
return new ModelProfileService(environment);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user