Call with stream response(Http SSE) sample @throws NoApiKeyException Can not find api key @throws InputRequiredException Missing inputs.
()
| 181 | * @throws InputRequiredException Missing inputs. |
| 182 | */ |
| 183 | public static void streamCall() throws NoApiKeyException, InputRequiredException { |
| 184 | ApplicationParam param = ApplicationParam.builder() |
| 185 | .appId(APP_ID) |
| 186 | .prompt("如何做土豆炖猪脚?") |
| 187 | .topP(0.8) |
| 188 | .incrementalOutput(true) |
| 189 | .build(); |
| 190 | |
| 191 | Application application = new Application(); |
| 192 | Flowable<ApplicationResult> result = application.streamCall(param); |
| 193 | result.blockingForEach(data -> System.out.printf(data.getOutput().getText())); |
| 194 | System.out.print("\n"); |
| 195 | } |
| 196 | |
| 197 | /** |
| 198 | * Call with workspace sample |
nothing calls this directly
no test coverage detected