community/tool-calls/spring-ai-alibaba-starter-tool-calling-jsonprocessor/src/main/java/com/alibaba/cloud/ai/toolcalling/jsonprocessor/JsonReplaceService.java [32:45]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	public Object apply(JsonReplaceRequest request) {
		String content = request.content;
		String field = request.field;
		JsonElement value = request.value;
		JsonElement jsonElement = JsonParser.parseString(content);
		if (!jsonElement.isJsonObject()) {
			throw new IllegalArgumentException("Content is not a valid JSON object .");
		}
		JsonObject jsonObject = jsonElement.getAsJsonObject();
		Assert.notNull(field, "replace json field can not be null");
		Assert.notNull(value, "replace json fieldValue can not be null");
		jsonObject.add(field, value);
		return jsonObject;
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



community/tool-calls/spring-ai-alibaba-starter-tool-calling-jsonprocessor/src/main/java/com/alibaba/cloud/ai/toolcalling/jsonprocessor/JsonInsertService.java [32:45]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
	public Object apply(JsonInsertRequest request) {
		String content = request.content;
		String field = request.field;
		JsonElement value = request.value;
		JsonElement jsonElement = JsonParser.parseString(content);
		if (!jsonElement.isJsonObject()) {
			throw new IllegalArgumentException("Content is not a valid JSON object .");
		}
		JsonObject jsonObject = jsonElement.getAsJsonObject();
		Assert.notNull(field, "insert json field can not be null");
		Assert.notNull(value, "insert json fieldValue can not be null");
		jsonObject.add(field, value);
		return jsonObject;
	}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



