【新增】AI:流式发送消息的微调,统一成单接口

This commit is contained in:
YunaiV
2024-05-15 23:06:18 +08:00
parent 20657ccaf3
commit b31e919d52
9 changed files with 124 additions and 136 deletions

View File

@ -94,7 +94,10 @@ public class YiYanChatClient implements ChatClient, StreamingChatClient {
String a = ";";
}
});
return response.map(res -> new ChatResponse(List.of(new Generation(res.getResult()))));
return response.map(res -> {
// TODO @fan这里缺少了 usage 的封装
return new ChatResponse(List.of(new Generation(res.getResult())));
});
}
private YiYanChatCompletionRequest createRequest(Prompt prompt, boolean stream) {