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

Method callWithMemory

samples/ApplicationCalls.java:225–238  ·  view source on GitHub ↗

Application call with long term memory sample @throws NoApiKeyException Can not find api key @throws ApiException The request failed, possibly due to a network or data error. @throws InputRequiredException Missing inputs.

()

Source from the content-addressed store, hash-verified

223 * @throws InputRequiredException Missing inputs.
224 */
225 public static void callWithMemory()
226 throws ApiException, NoApiKeyException, InputRequiredException {
227 ApplicationParam param = ApplicationParam.builder()
228 .appId(APP_ID)
229 .prompt("我想去新疆")
230 .memoryId("mem_123")
231 .topP(0.2)
232 .build();
233
234 Application application = new Application();
235 ApplicationResult result = application.call(param);
236
237 System.out.printf("requestId: %s, text: %s\n", result.getRequestId(), result.getOutput().getText());
238 }
239
240 public static void callWithAssistantServing() throws NoApiKeyException, InputRequiredException {
241 JsonObject metadataFilter = new JsonObject();

Callers

nothing calls this directly

Calls 3

callMethod · 0.95
builderMethod · 0.80
buildMethod · 0.65

Tested by

no test coverage detected