Skip to content

Conversation

fengluo97
Copy link
Contributor

Describe what this PR does / why we need it

Completed refactoring and optimization of the spring ai alibaba starter tool rolling jsonprocessor module and spring ai alibaba starter tool rolling time module.

Does this pull request fix one issue?

For issue #849.

Describe how you did it

Refactor the code according to the specifications in the completed module and RAEDME file.

Describe how to verify it

Run the unit test code in the test package.

Special notes for reviews

NONE

@CLAassistant
Copy link

CLAassistant commented May 27, 2025

CLA assistant check
All committers have signed the CLA.

@fengluo97
Copy link
Contributor Author

@VLSMB hello, if you have time, please help me review the code

@VLSMB
Copy link
Collaborator

VLSMB commented May 27, 2025

@VLSMB hello, if you have time, please help me review the code

I recommend that all Services in the jsonprocessor-tool could leverage the methods from the JsonParseTool in the common module. For any methods not currently existing in JsonParseTool, you may implement them directly within it.

@yuluo-yx yuluo-yx changed the title Feature/refactor time&jsonprocessor feat: Feature/refactor time&jsonprocessor Jun 1, 2025
@github-actions github-actions bot added area/tools SAA Tool Calling module area/community SAA community module labels Jun 1, 2025
@fengluo97
Copy link
Contributor Author

@VLSMB hello, if you have time, please help me review the code

I recommend that all Services in the jsonprocessor-tool could leverage the methods from the JsonParseTool in the common module. For any methods not currently existing in JsonParseTool, you may implement them directly within it.

@VLSMB hello, I have already made the modifications, please help me review them again

Copy link
Collaborator

@VLSMB VLSMB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for you contribution. Please have a look at the suggested modifications mentioned.


<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, since the existing JsonParseTool already utilizes the Jackson deserialization library, we do not recommend introducing the Gson library. In fact, one of the goals of this issue is to unify the deserialization libraries. Please migrate all Gson usages to Jackson.

* @author 北极星
*/
public class JsonInsertService implements Function<JsonInsertService.JsonInsertRequest, Object> {
public class JsonProcessorInsertService implements Function<JsonProcessorInsertService.JsonInsertRequest, Object> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take it as an example, you can first use the existing public String setFieldValue(String json, String fieldName, String value) method in JsonPraseTool to obtain the processed JSON string, then convert it to Jackson's JsonNode using jsonToObject(String json, JsonNode.class) and return it. You can directly call these two functions, or write a JsonNode setFieldValue(String json, String fieldName, String value) method within JsonPraseTool. The other codes are the same.

@fengluo97
Copy link
Contributor Author

thx for you contribution. Please have a look at the suggested modifications mentioned.

okay, I will revise it according to your suggestion

Aias00 and others added 7 commits June 9, 2025 06:45
…ssor' into feature/refactor-time&jsonprocessor
# Conflicts:
#	community/tool-calls/spring-ai-alibaba-starter-tool-calling-jsonprocessor/src/main/java/com/alibaba/cloud/ai/toolcalling/jsonprocessor/JsonAutoConfiguration.java
#	community/tool-calls/spring-ai-alibaba-starter-tool-calling-time/src/main/java/com/alibaba/cloud/ai/toolcalling/time/TimeAutoConfiguration.java
@fengluo97
Copy link
Contributor Author

thx for you contribution. Please have a look at the suggested modifications mentioned.
@VLSMB hi, please help me review again

Copy link
Collaborator

@VLSMB VLSMB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx for your contribution. ptal @yuluo-yx

yuluo-yx
yuluo-yx previously approved these changes Jun 10, 2025
@yuluo-yx
Copy link
Collaborator

hi @fengluo97 pls fix ci.

@VLSMB
Copy link
Collaborator

VLSMB commented Jun 10, 2025

Hello, you need to run mvn spring-javaformat:apply from your local terminal in the project's root directory. And ensure that there is a new blank line at the end of each code file.

@fengluo97
Copy link
Contributor Author

Hello, you need to run mvn spring-javaformat:apply from your local terminal in the project's root directory. And ensure that there is a new blank line at the end of each code file.

@VLSMB Thank you for the reminder. I have already made the necessary changes. Could you please help me take a look again

@fengluo97 fengluo97 requested review from VLSMB and yuluo-yx June 12, 2025 07:41
Copy link
Collaborator

@VLSMB VLSMB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, ptal @yuluo-yx

Copy link
Collaborator

@yuluo-yx yuluo-yx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for you contribution

@yuluo-yx yuluo-yx merged commit 50990bb into alibaba:main Jun 12, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/community SAA community module area/core SAA Core module area/tools SAA Tool Calling module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants