- Remove @NestedConfigurationProperty and @ConstructorBinding annotations from model options classes
- Remove spring-boot dependency from spring-ai-openai module
- Add exclusion for spring-boot-autoconfigure in spring-cloud-function-context dependency
- Move configuration metadata to spring-ai-spring-boot-autoconfigure module
This change decouples the core AI model implementations from Spring Boot,
making the core modules more lightweight and allowing them to be used in
non-Spring Boot applications. Configuration properties are now handled by
the spring-ai-spring-boot-autoconfigure module instead.
Fixes#1540
This commit configures Maven to support compiling Kotlin
main and test classes, and adds a JacksonUtilsKotlinTests
class that ensures that serialization and deserialization
of Kotlin data classes works as expected.
The Maven configuration follows recommendations from
https://kotlinlang.org/docs/maven.html.
The static block was introducing side effects when doing scans of classpath
for AOT and seems to have been the cause of a failing test.
Updated github actions to use ~/.testcontainers.properties to enable
container resuse
Adds @EnabledIfEnvironmentVariable annotation to integration tests that
use OpenAI embeddings. Tests will be skipped if OPENAI_API_KEY is not set,
making the build process more reliable for contributors who don't have
access to OpenAI services.
The PostgresMLEmbeddingModel autoconfiguration previously always executed
"CREATE EXTENSION IF NOT EXISTS pgml" on startup. This could cause issues
for users without superuser privileges or those who manage extensions
through other means.
Added a new configuration property 'createExtension' (default false) to
make this behavior optional. Users can now explicitly enable extension
creation when needed.
Updated documentation to explain the new configuration option and its
implications for deployment.
This fix ensures proper inheritance of defaults while maintaining the
correct precedence order for both generic and StabilityAI-specific options.
Added tests to verify the merge behavior for runtime options, default options,
and generic ImageOptions cases.
All output parser functionality has already been migrated to the converter package
since milestone M1.
Changes:
- Replace all instances of 'parser' with 'converter' in variable names and test cases
- Delete (pre M1) deprecated parser package and all associated classes
- Remove Output Parsers section from README.md
- Update Javadoc comments to reference converters instead of parsers
ObjectMapper instantiation is costly, so unless its usage
is one-shot, it is better to create a reusable instance
for upcoming usage.
Also, before this commit, serialization of most Kotlin
classes was not supported due to the lack of proper
Jackson KotlinModule detection.
This commit:
- Avoids per invocation ObjectMapper instantiation when
relevant
- Automatically detects and enables well-known Jackson
modules including the Kotlin one
- Removes org.springframework.ai.vectorstore.JsonUtils
which looks not needed anymore
More optimizations are possible like reusing more
ObjectMapper instances, but this could introduce more breaking
changes so this commit intends to be a good first step.
Kotlin tests will be provided in a follow-up commit.
Additional changes:
- Update ModelOptionsUtils to use JacksonUtils.instantiateAvailableModules()
- Add missing license headers
- Add missing author Javadoc comments
Prevent external modification of internal state by returning unmodifiable
collections and adding defensive copies in setters and builders.
Co-authored-by: youngmoneee@users.noreply.github.com
- Adds special handling for BiFunction class types
- Adds test cases to verify BiFunction class type resolution
- Removes deprecated AbstractFunctionCallSupport class
- Cleans up unused imports in FunctionCallback
Resolves#1576
Add explicit model compatibility information to prevent failed deployments
with unsupported architectures. Point users to standard endpoints as
alternative for unsupported models.
- Convert TokenTextSplitter configuration parameters to final fields
- Add static Builder class for fluent construction
- Define default constants for configuration values
- Add unit tests validating builder and default configurations
- Test metadata handling and content splitting behavior
- Update Claude 3.5 Sonnet model version from 20240620 to 20241022 across:
- AnthropicApi model definitions
- Integration tests
- Sample events JSON
- Documentation pages
- Upgrade Ollama container to 0.3.14 in tests
- Add llama3.2:1b model to Ollama tests
- Convert Ollama functionCallTest to parameterized test
- Implement core vector store module for CosmosDB integration
- Add Spring Boot auto-configuration capabilities
- Integrate batch processing strategy for optimized operations
- Include comprehensive tests for core and auto-config modules
- Add reference docs for the CosmosDB vector store support
- Add PromptTokensDetails record to track cached tokens in prompt
- Update Usage record to include promptTokensDetails field
- Add getCachedTokens() method to OpenAiUsage
- Add test cases for cached tokens handling
Resolves#1506
- Update TextSplitter to filter out metadata entries with null keys or values
- Simplify text substring call in TextSplitterTests
- Add test case for document splitting with null metadata values
In order to support edge cases due to different naming formats, this PR introduced an explicit normalization logic to ensure the correct matching when checking for the availability of a certain model. Integration tests have been added to cover the different scenarios, including models from Ollama and from Hugging Face.
Also fix the container creation on the useTestcontainers flag (christian)
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
Consolidate the Ollama auto-pull logic at startup time, supporting the auto-pull for the default models specified via configuration properties and for optional models specified for initialization.
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>