本文主要研究一下Spring AI 1.0.0-SNAPSHOT的变更
示例
<!-- BEFORE -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-openai-spring-boot-starter</artifactId>
</dependency>
<!-- AFTER -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-model-openai</artifactId>
</dependency>
Spring AI Autoconfiguration从单体模块变更为每个model、vector-store等独立的autoconfiguration,拆开的目的就是避免引入没必要的依赖,减少冲突风险:
<!-- NO LONGER AVAILABLE -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-spring-boot-autoconfigure</artifactId>
<version>${project.version}</version>
</dependency>
取而代之的是:
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-autoconfigure-model-openai</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-autoconfigure-model-anthropic</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-autoconfigure-model-vertex-ai</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-autoconfigure-vector-store-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-autoconfigure-vector-store-pgvector</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-autoconfigure-vector-store-chroma</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-autoconfigure-mcp-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-autoconfigure-mcp-server</artifactId>
</dependency>
org.springframework.ai.transformer
变更到org.springframework.ai.chat.transformer
org.springframework.ai.model
变更到org.springframework.ai.content
之前是所有的都在spring-ai-core,现在拆分到具体的领域模块来减少不必要的依赖,如下:
Document
、TextSplitter
ChatModel
、EmbeddingModel
、ImageModel
、ToolDefinition
、ToolCallback
VectorStore
,提供了SimpleVectorStore
便于内存使用ChatClient
、ChatMemory
、OutputConverter
QuestionAnswerAdvisor
、VectorStoreChatMemoryAdvisor
CassandraChatMemory
RetrievalAugmentationAdvisor
Dependency Structure变更如下:
Spring AI 1.0.0-SNAPSHOT主要是涉及了Artifact ID, Package, Module的变更;Spring AI Autoconfiguration从单体模块变更为每个model、vector-store等独立的autoconfiguration,拆开的目的就是避免引入没必要的依赖,减少冲突风险;KeywordMetadataEnricher、SummaryMetadataEnricher、Content、MediaContent以及Media涉及了包名的变更;模块的变更将spring-ai-core拆分到具体的领域模块来减少不必要的依赖。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有