mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 17:21:53 +08:00
增加 阿里 千问参数说明
This commit is contained in:
parent
0f73b61db2
commit
26afa04e80
@ -57,8 +57,10 @@ public class QianWenApi {
|
|||||||
public ResponseEntity<CompletionsResponse> chatCompletionEntity(ChatRequestMessage message) {
|
public ResponseEntity<CompletionsResponse> chatCompletionEntity(ChatRequestMessage message) {
|
||||||
// 创建request
|
// 创建request
|
||||||
CompletionsRequest request = new CompletionsRequest()
|
CompletionsRequest request = new CompletionsRequest()
|
||||||
|
// 设置 appid
|
||||||
.setAppId(appId)
|
.setAppId(appId)
|
||||||
.setMessages(List.of(message))
|
.setMessages(List.of(message))
|
||||||
|
// 返回choice message结果
|
||||||
.setParameters(new CompletionsRequest.Parameter().setResultFormat("message"));
|
.setParameters(new CompletionsRequest.Parameter().setResultFormat("message"));
|
||||||
//
|
//
|
||||||
CompletionsResponse response = client.completions(request);
|
CompletionsResponse response = client.completions(request);
|
||||||
@ -74,8 +76,10 @@ public class QianWenApi {
|
|||||||
public Flux<CompletionsResponse> chatCompletionStream(ChatRequestMessage message) {
|
public Flux<CompletionsResponse> chatCompletionStream(ChatRequestMessage message) {
|
||||||
return client.streamCompletions(
|
return client.streamCompletions(
|
||||||
new CompletionsRequest()
|
new CompletionsRequest()
|
||||||
|
// 设置 appid
|
||||||
.setAppId(appId)
|
.setAppId(appId)
|
||||||
.setMessages(List.of(message))
|
.setMessages(List.of(message))
|
||||||
|
//开启增量输出模式,后面输出不会包含已经输出的内容
|
||||||
.setParameters(new CompletionsRequest.Parameter().setIncrementalOutput(true))
|
.setParameters(new CompletionsRequest.Parameter().setIncrementalOutput(true))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user