MCPcopy Create free account
hub / github.com/dashscope/dashscope-sdk-java / streamCall

Method streamCall

samples/ApplicationCalls.java:183–195  ·  view source on GitHub ↗

Call with stream response(Http SSE) sample @throws NoApiKeyException Can not find api key @throws InputRequiredException Missing inputs.

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

streamCallMethod · 0.95
builderMethod · 0.80
buildMethod · 0.65

Tested by

no test coverage detected