feat(ai): 新增多模态与结构化输出功能支持

- 引入 Cassandra作为聊天记忆存储后端
- 配置 DashScope 多模态模型支持图文输入- 新增结构化输出控制器,支持 Bean、Map、List 等格式转换
- 添加文生图接口,集成阿里百炼图像生成能力
- 更新应用配置以支持多模态及持久化聊天记录
- 升级依赖项,引入 DashScope SDK 和 Cassandra 支持库
- 创建 ActorFilmography 和 Book 数据模型用于结构化响应
- 调整 ChatClient 配置以适配新的多模态与记忆逻辑
This commit is contained in:
2025-10-27 22:11:08 +08:00
parent d12334fe36
commit 594adcc48d
11 changed files with 331 additions and 10 deletions

20
pom.xml
View File

@@ -55,14 +55,28 @@
<groupId>com.alibaba.cloud.ai</groupId>
<artifactId>spring-ai-alibaba-starter-dashscope</artifactId>
</dependency>
<!-- Cassandra -->
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-model-chat-memory-repository-cassandra</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- 阿里百炼 SDK -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>dashscope-sdk-java</artifactId>
<version>2.21.13</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>