Skip to content

Commit fd4f753

Browse files
authored
feat(search): support prepend_search_result option (#155)
1 parent cee5f88 commit fd4f753

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

samples/GenerationStreamCall.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,14 @@ public static void streamCallWithSearchOptions()
109109
.prompt("联网搜索明天杭州天气如何?")
110110
.enableSearch(true)
111111
.resultFormat("message")
112+
.incrementalOutput(true)
112113
.searchOptions(SearchOptions.builder()
113114
.enableSource(true)
114115
.enableCitation(true)
115116
.citationFormat("[ref_<number>]")
116117
.searchStrategy("pro_max")
117118
.forcedSearch(true)
119+
.prependSearchResult(true)
118120
.build())
119121
.build();
120122
Flowable<GenerationResult> result = gen.streamCall(param);

src/main/java/com/alibaba/dashscope/aigc/generation/SearchOptions.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,13 @@ public class SearchOptions {
3333
/** 搜索互联网信息的数量。standard:在请求时搜索5条互联网信息; pro:在请求时搜索10条互联网信息。 默认值为standard */
3434
@SerializedName("search_strategy")
3535
private String searchStrategy;
36+
37+
/**
38+
* Whether the first data packet in streaming output contains only
39+
* search source information. Only effective when enable_source is
40+
* true and in streaming mode. Default is false.
41+
*/
42+
@SerializedName("prepend_search_result")
43+
@Builder.Default
44+
private Boolean prependSearchResult = null;
3645
}

0 commit comments

Comments
 (0)