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.
()
| 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(); |