AgentPlatformPropertiesLoader

Loads agent platform properties into Spring's Environment for library-wide availability.

This configuration class uses pure Spring Framework features (@PropertySource, @Order) to ensure compatibility with both Spring Boot and pure Spring applications.

Design Rationale

Library-Friendly Approach

  • @PropertySource: Core Spring Framework feature (since 3.1) - works in any Spring environment

  • @Order(HIGHEST_PRECEDENCE): Ensures properties are loaded before other @Configuration classes

  • No Spring Boot dependencies: Works with Spring WebMVC, WebFlux, standalone contexts

Processing Order Guarantee

1. AgentPlatformPropertiesLoader processes first → Properties loaded into Environment
2. Other @Configuration classes process → Properties available for @ConfigurationProperties binding
3. @ConfigurationProperties beans created → Automatic property binding occurs

Property Binding Flow

  • agent-platform.properties → Spring Environment → @ConfigurationProperties classes

  • Enables: AnthropicProperties, OpenAiProperties, AgentPlatformProperties, Migration system configs

Usage Impact

After this loader is active:

  • AnthropicProperties: Will bind from embabel.agent.platform.models.anthropic.* (no longer defaults)

  • OpenAiProperties: Will bind from embabel.agent.platform.models.openai.* (no longer defaults)

  • Migration system: Properties will be loaded for conditional bean creation

  • AgentPlatformProperties: Will bind actual values instead of being dormant

Since

1.x

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun init()