Skip to content

Conversation

james-huangzhen
Copy link
Contributor

feat(deepresearch): 添加 Redis 支持并更新 ReporterNode 逻辑

  • 在 pom.xml 中添加 spring-boot-starter-data-redis 依赖。
  • 更新 DeepResearchConfiguration,注入 ReportRedisService。
  • 修改 ReporterNode,增加将报告保存到 Redis 的功能,并记录线程 ID。
  • 在 application.yml 中添加 Redis 配置。

@CLAassistant
Copy link

CLAassistant commented Jun 19, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ james-huangzhen
✅ Aias00
❌ huangzhen


huangzhen seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions github-actions bot added the area/deepresearch SAA Deepresearch module label Jun 19, 2025
@Aias00 Aias00 changed the title 添加 Redis 支持并更新 ReporterNode 逻辑 feat(deepreasearch): add Redis Support and update ReporterNode logic Jun 20, 2025
…可读性更高。同时,调整了 ReporterNode 中的异常处理逻辑,增强了代码的健壮性。
@james-huangzhen
Copy link
Contributor Author

mvn spring-javaformat:apply

.mapResult(response -> {
String finalReport = Objects.requireNonNull(response.getResult().getOutput().getText());
try {
reportRedisService.saveReport(threadId, finalReport);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

给Redis配置设个开关吧。开启了才向Redis里写入报告,这样可以不阻碍其他人的开发进度,要求他们配置redis了

/**
* 基础响应类
*/
public static class BaseResponse {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

controller的请求、响应类之类的这里还是放到model目录下,方便管理

application:
name: spring-ai-alibaba-deepresearch
# Redis 配置
data:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

前缀为:spring.ai.alibaba.deepresearch.redis
设置一个enabled开关,来控制Redis服务的加载

huangzhen and others added 6 commits June 20, 2025 19:24
在 DeepResearchConfiguration 和 ReporterNode 中用 ReportService 替换 ReportRedisService,统一报告处理方式

更新 ReportController 改用 ReportService 进行报告操作

在 RedisConfig 和 ReportRedisService 中引入 ConditionalOnProperty 注解,根据配置启用/禁用 Redis 支持

修改 application.yml 默认将 Redis 启用属性设为 false
Copy link
Collaborator

@GTyingzi GTyingzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yuluo-yx yuluo-yx merged commit a3c2939 into alibaba:main Jun 20, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/deepresearch SAA Deepresearch module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants