Skip to content

Commit d65cb21

Browse files
authored
feat(deepresearch): changed InteractiveHTMLController.buildInteractiveHTML parameter (alibaba#1337)
feat: changed InteractiveHTMLController.buildInteractiveHTML parameter 1. InteractiveHTMLController. buildInteractiveHTML method parameter changed from ReportId to ThreadId 2. Enhance code logic and add verification to check if report data is empty Co-authored-by: Gfangxin <29532977+Gfangxin@users.noreply.github.com>
1 parent 7533675 commit d65cb21

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

spring-ai-alibaba-deepresearch/src/main/java/com/alibaba/cloud/ai/example/deepresearch/controller/InteractiveHtmlController.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,25 @@ public class InteractiveHtmlController {
4646

4747
/**
4848
* building an interactive html report(构建交互式HTML报告)
49-
* @param reportId 报告ID
49+
* @param threadId 线程ID
5050
* @return Return a Flux stream containing events from the build
5151
* process(返回一个Flux流,包含构建过程中的事件)
5252
*/
5353
@RequestMapping(value = "/build", method = RequestMethod.GET, produces = MediaType.TEXT_EVENT_STREAM_VALUE)
54-
public Flux<ChatResponse> buildInteractiveHtml(String reportId) {
55-
if (reportId == null || reportId.isEmpty()) {
56-
log.error("Report ID is null or empty");
57-
return Flux.error(new IllegalArgumentException("Report ID cannot be null or empty"));
54+
public Flux<ChatResponse> buildInteractiveHtml(String threadId) {
55+
if (threadId == null || threadId.isEmpty()) {
56+
log.error("threadId is null or empty");
57+
return Flux.error(new IllegalArgumentException("threadId cannot be null or empty"));
58+
}
59+
String reportInfo = reportService.getReport(threadId);
60+
if (reportInfo == null) {
61+
log.error("Report with threadId {} not found", threadId);
62+
return Flux.error(new IllegalArgumentException("Report not found"));
63+
}
64+
else {
65+
log.debug("Found report for threadId: {} ,Report info: {}", threadId, reportInfo);
5866
}
5967
log.info("Building interactive HTML report");
60-
String reportInfo = reportService.getReport(reportId);
6168
// 使用ChatClient来构建HTML报告
6269
return interactionAgent.prompt(reportInfo).stream().chatResponse();
6370
}

0 commit comments

Comments
 (0)