-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Feature/refactor time&jsonprocessor #1000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Feature/refactor time&jsonprocessor #1000
Conversation
@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. |
…ssor' into feature/refactor-time&jsonprocessor
@VLSMB hello, I have already made the modifications, please help me review them again |
There was a problem hiding this 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> |
There was a problem hiding this comment.
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> { |
There was a problem hiding this comment.
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.
...-calling-time/src/main/java/com/alibaba/cloud/ai/toolcalling/time/TimeAutoConfiguration.java
Outdated
Show resolved
Hide resolved
okay, I will revise it according to your suggestion |
…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
|
There was a problem hiding this 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
hi @fengluo97 pls fix ci. |
Hello, you need to run |
…ssor' into feature/refactor-time&jsonprocessor
@VLSMB Thank you for the reminder. I have already made the necessary changes. Could you please help me take a look again |
There was a problem hiding this 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
There was a problem hiding this 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
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