This commit makes several improvements to the OpenAiImageOptions class:
1. Remove all deprecated methods from OpenAiImageOptions.Builder:
- Removed withN(), withModel(), withQuality(), withResponseFormat(),
withWidth(), withHeight(), withStyle(), and withUser() methods
- These were marked as @Deprecated(forRemoval = true, since = "1.0.0-M8")
2. Align OpenAiImageOptions structure with OpenAiChatOptions:
- Added fromOptions() static method for creating copies
- Added copy() instance method
- Updated Builder class to match pattern in OpenAiChatOptions
- Changed Builder field from private final to protected
- Added Builder constructor that takes an existing options object
3. Enhance setSize() method to maintain consistency:
- Updated setSize() to parse the size string and update width/height properties
- Added proper error handling for invalid formats
- Ensures consistent state between size, width, and height properties
4. Comprehensive test coverage improvements:
- Added tests for builder pattern with all fields
- Added tests for copy functionality
- Added tests for all setter methods
- Added tests for default values
- Added tests for equals(), hashCode(), and toString() methods
- Added specific tests for the updated setSize() behavior
- Fixed test expectations to match actual implementation behavior
These changes improve code consistency, maintainability, and test coverage
while removing deprecated methods that were scheduled for removal.
Signed-off-by: jonghoonpark <dev@jonghoonpark.com>
* Remove deprecated APIs for JdbcChatMemory.
* Improve documentation about chat memory vs. chat history.
* Fix mismatch between docs vs code for max messages in MessageWindowChatMemory.
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
- Remove deprecated constructor method Media(MimeType mimeType, URL url) from Media
- Remove deprecated builder method data(URL url) from Media builder
- Update references to use the builder and the data(URI) methods
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
- Remove the deprecated constructors from PromptTemplate and replace the references using the builder methods
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
- Remove deprecated constructors from OllamaApi and AnthropicApi
- Modify AnthropicApi's public constructor to be private so that only the builder method can use it to construct
- Update OllamApiAutoConfiguration and AnthropicChatAutoconfiguration to use the builder methods to construct the respective
Apis
- Fix other constructor usages to builder methods
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
Remove deprecated DocumentCompressor/Ranker/Selector
- These are replaced by the org.springframework.ai.rag.postretrieval.document.DocumentPostProcessor
Remove deprecated Chatclient/DefaultChatClient methods
In ChatClient:
- Remove defaultTools and tools as these are replaced by defaultToolCallbacks and defaultToolNames respectively.
In DefaultChatClient:
- Remove tools method implementation
- Remove unused DefaultCallPromptResponseSpec and DefaultStreamPromptResponseSpec
Remove deprecated addMessage from Prompt
Remove deprecated isInternalToolExecutionEnabled() from ToolCallingChatOptions
- This is replaced by getInternalToolExecutionEnabled()
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
- Improve the jsonToStruct method in VertexAiGeminiChatModel to handle JSON arrays
in addition to JSON objects. When a JSON array is detected, it's now properly
converted to a Protobuf Struct with an items field containing the array elements.
- Added test
Resolves#2647 , #2849
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This PR introduces support for streamUsage in the AzureOpenAiChatOptions.
- Set com.azure.ai.openai.models.ChatCompletionStreamOptions#includeUsage via AzureOpenAiChatOptions.
Additionally:
- Updates the unit test AzureOpenAiChatOptionsTests to reflect the changes.
- Updates the documentation in azure-openai-chat.adoc.
Signed-off-by: Andres da Silva Santos <40636137+andresssantos@users.noreply.github.com>
This ensures that validation errors are caught early during object construction
rather than later when methods are called, providing better error feedback.
- Add validation for tool-annotated methods during construction
- Validate duplicate tool names in constructor instead of only at getToolCallbacks() time
- Add comprehensive test suite for MethodToolCallbackProvider
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Output format instructions should not be included until the very last advisor runs, otherwise there's a risk of templating failure if more than one advisor tries to render the prompt template. This change guarantees the output format instructions are always included right before calling the chat model, without the risk of previous advisors interfering with it.
Signed-off-by: Thomas Vitale <ThomasVitale@users.noreply.github.com>
Add unit tests to verify that the WebFlux server transport is properly configured
with a custom ObjectMapper that ignores unknown properties. This ensures that the
MCP server can handle JSON payloads containing fields not defined in the model
classes, which is important for forward compatibility.
Signed-off-by: Hari Ohm Prasath <hariohmprasath@gmail.com>
Signed-off-by: Hari Ohm Prasth Rajagopal <harrajag@amazon.com>
- Add new connections.[name].sse-endpoint property with default value /sse
- Update table format to include default values column
- Clarify that connections.[name].url is a base URL endpoint
Related to #2724
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
- Prevent projects depending on `mcp-server-webmvc` or `mcp-server-webflux` from exceptions when `spring.ai.mcp.server.enabled` is set to `false`.
- Add unit tests to verify.
Signed-off-by: YunKui Lu <luyunkui95@gmail.com>
Enhance MCP client transports with configurable SSE endpoint support:
- Add sseEndpoint parameter to SseParameters record
- Update HttpClientSseClientTransport to use builder pattern with sseEndpoint support
- Update WebFluxSseClientTransport to use builder pattern with sseEndpoint support
- Set default SSE endpoint to /sse when not explicitly configured
- Add tests for MCP client properties
- Enhance MCP client transport tests and refactor config
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Add repository element to the distributionManagement for Spring AI BOM
Add sonatype profile to Spring AI BOM
Add developer info to Spring AI BOM
Remove javadoc skip at spring-ai-spring-boot-testcontainers POM
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
- Move evaluation core classes (Request, Response, Evaluator) to spring-ai-commons.
- Move chat-specific evaluators (FactChecking, Relevancy) to spring-ai-client-chat#evaluation package.
- Move OutputConverter implementations and related classes to spring-ai-model#converter package.
- Move MetadataEnricher transformer classes to spring-ai-model#transformer package.
- Move PromptAssert utility to spring-ai-rag#util package.
- Update relevant pom.xml files and adjust imports in affected classes.
- Document class movements in upgrade-notes.adoc for M8 release.
This refactoring improves module organization and separation of concerns.
Signed-off-by: Mark Pollack <mark.pollack@broadcom.com>
Renames the ambiguous overloaded `tools` methods in `ChatClient.PromptRequestSpec`
to `toolNames` and `toolCallbacks` respectively. This improves clarity
and prevents potential issues with method dispatching based on argument types.
Updates relevant code examples and adds documentation to upgrade notes.
Signed-off-by: Mark Pollack <mark.pollack@broadcom.com>
This reverts commit 4eeeb83d3f.
Revert "Make ImageOptions non-null when constructing ImagePrompt"
This reverts commit 0c0787b849.
Need to review more the impact of making these options not null.
Signed-off-by: Ilayaperumal Gopinathan <ilayaperumal.gopinathan@broadcom.com>
- Comment out AsyncCompletionSpecification and SyncCompletionSpecification imports
- Comment out completion parameters and processing in both sync and async server creation methods
- Downgrade MCP SDK version from 0.10.0-SNAPSHOT to 0.9.0
Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>