Skip to content

Commit 3ea3e83

Browse files
committed
feat: compelate weh search
Signed-off-by: yuluo-yx <yuluo08290126@gmail.com>
1 parent a9835e2 commit 3ea3e83

File tree

5 files changed

+435
-429
lines changed

5 files changed

+435
-429
lines changed

spring-ai-alibaba-integration-example/backend/src/main/java/com/alibaba/cloud/ai/application/service/SAAWebSearchService.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public class SAAWebSearchService {
4141

4242
private final WebSearchRetriever webSearchRetriever;
4343

44+
private static final String DEFAULT_WEB_SEARCH_MODEL = "deepseek-r1";
45+
4446
public SAAWebSearchService(
4547
ChatClient.Builder chatClientBuilder,
4648
QueryTransformer queryTransformer,
@@ -62,8 +64,9 @@ public SAAWebSearchService(
6264
this.chatClient = chatClientBuilder
6365
.defaultOptions(
6466
DashScopeChatOptions.builder()
65-
.withModel("qwen-plus")
66-
.withIncrementalOutput(false)
67+
.withModel(DEFAULT_WEB_SEARCH_MODEL)
68+
// stream 模式下是否开启增量输出
69+
.withIncrementalOutput(true)
6770
.build())
6871
.build();
6972

spring-ai-alibaba-integration-example/docker/docker-compose.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ services:
22

33
backend:
44
container_name: spring-ai-alibaba-playground
5-
image: spring-ai-alibaba-playground:08aa4c6
5+
image: spring-ai-alibaba-playground:a9835e2
66
environment:
77
- AI_DASHSCOPE_API_KEY=${AI_DASHSCOPE_API_KEY}
88
- WEB_SEARCH_API_KEY=${WEB_SEARCH_API_KEY}
9+
# 服务测试暴露端口,部署时应该关闭,不对外暴露
910
ports:
1011
- "8080:8080"
1112
networks:
@@ -19,6 +20,8 @@ services:
1920
- ./nginx/html:/usr/share/nginx/html
2021
ports:
2122
- "9000:80"
23+
depends_on:
24+
- backend
2225
networks:
2326
- spring-ai-alibaba
2427

0 commit comments

Comments
 (0)