-
Notifications
You must be signed in to change notification settings - Fork 178
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: add baidu map plugin #219
Conversation
Hi, this issue should related to #98 |
Thx noticing me, and I've added it😘 |
…mplement regional surrounding information retrieval
@PolarishT Additionally, I've moved the dirs and files into |
community/function-calling/spring-ai-alibaba-starter-function-calling-baidumap/pom.xml
Outdated
Show resolved
Hide resolved
community/plugins/spring-ai-alibaba-starter-plugin-baidumap/pom.xml
Outdated
Show resolved
Hide resolved
...lugin-baidumap/src/main/java/com/alibaba/cloud/ai/plugin/baidumap/BaiDuMapConfiguration.java
Outdated
Show resolved
Hide resolved
...r-plugin-baidumap/src/main/java/com/alibaba/cloud/ai/plugin/baidumap/BaiDuMapProperties.java
Outdated
Show resolved
Hide resolved
community/function-calling/spring-ai-alibaba-starter-function-calling-baidumap/pom.xml
Outdated
Show resolved
Hide resolved
...dumap/src/main/java/com/alibaba/cloud/ai/functioncalling/baidumap/BaiDuMapConfiguration.java
Outdated
Show resolved
Hide resolved
看插件怎么定义了,我看用了 fastjson 所以顺带说了一下
…On Tue, Dec 24, 2024 at 12:32 Polarish ***@***.***> wrote:
***@***.**** requested changes on this pull request.
------------------------------
In community/plugins/spring-ai-alibaba-starter-plugin-baidumap/pom.xml
<#219 (comment)>
:
> + <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-configuration-processor</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
+ <groupId>com.alibaba</groupId>
+ <artifactId>fastjson</artifactId>
+ <version>1.2.83</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <finalName>spring-ai-alibaba-plugin-baidumap</finalName>
please update pom.xml we renamed plugin nodule to functionCalling module
for example, it should be *spring-ai-alibaba-function-calling-baidumap*
------------------------------
In
community/plugins/spring-ai-alibaba-starter-plugin-baidumap/src/main/java/com/alibaba/cloud/ai/plugin/baidumap/BaiDuMapConfiguration.java
<#219 (comment)>
:
> +import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Description;
+
+/**
+ * @author Carbon
+ */
***@***.***
***@***.***(BaiDuMapProperties.class)
***@***.***(prefix = "spring.ai.alibaba.plugin.baidumap", name = "enabled", havingValue = "true")
+public class BaiDuMapConfiguration {
+
+ @bean
+ @ConditionalOnMissingBean
+ @description("Get weather information according to address.")
+ public WeatherSearchService baiDuMapGetAddressWeatherFunction(BaiDuMapProperties baiDuMapProperties) {
bean should end with Function. Forexample, microsoftTranslateFuntion
------------------------------
In
community/plugins/spring-ai-alibaba-starter-plugin-baidumap/src/main/java/com/alibaba/cloud/ai/plugin/baidumap/BaiDuMapProperties.java
<#219 (comment)>
:
> + *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.alibaba.cloud.ai.plugin.baidumap;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+/**
+ * @author Carbon
+ */
***@***.***(prefix = "spring.ai.alibaba.plugin.baidumap")
it should be spring.ai.alibaba.functioncalling.baidumap
------------------------------
In
community/function-calling/spring-ai-alibaba-starter-function-calling-baidumap/src/main/java/com/alibaba/cloud/ai/functioncalling/baidumap/BaiDuMapConfiguration.java
<#219 (comment)>
:
> +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Description;
+
+/**
+ * @author Carbon
+ */
***@***.***
***@***.***(MapSearchService.class)
***@***.***(BaiDuMapProperties.class)
***@***.***(prefix = "spring.ai.alibaba.functioncalling.baidumap", name = "enabled", havingValue = "true")
+public class BaiDuMapConfiguration {
命名不规范?这里按照规范应该是BaiDuMapAutoConfiguration
------------------------------
In
community/plugins/spring-ai-alibaba-starter-plugin-baidumap/src/main/java/com/alibaba/cloud/ai/plugin/baidumap/BaiDuMapConfiguration.java
<#219 (comment)>
:
> +import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Description;
+
+/**
+ * @author Carbon
+ */
***@***.***
***@***.***(BaiDuMapProperties.class)
***@***.***(prefix = "spring.ai.alibaba.plugin.baidumap", name = "enabled", havingValue = "true")
+public class BaiDuMapConfiguration {
+
+ @bean
+ @ConditionalOnMissingBean
+ @description("Get weather information according to address.")
+ public WeatherSearchService baiDuMapGetAddressWeatherFunction(BaiDuMapProperties baiDuMapProperties) {
the class should named as XxxAutoConfiguration
------------------------------
In
community/function-calling/spring-ai-alibaba-starter-function-calling-baidumap/pom.xml
<#219 (comment)>
:
> + <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-annotations</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.ai</groupId>
+ <artifactId>spring-ai-spring-boot-autoconfigure</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-configuration-processor</artifactId>
+ <optional>true</optional>
+ </dependency>
+
+ <dependency>
都是用jackson吗?那估计有些functionCalling Impl 得从 gson 转移到 jackjson了
—
Reply to this email directly, view it on GitHub
<#219 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASS2GCPMEY5CAKIKJE6C36D2HDPVXAVCNFSM6AAAAABT326IQ6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKMJTHEZTKNZUGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
统一使用JackSon吧~ 我们和Spring的生态对齐 |
稍后我去改一下,辛苦二位的CR! |
…astjson with jackson
Done. 辛苦大佬们有空再帮忙 CR 看下有没有什么问题。 |
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
Describe what this PR does / why we need it
Baidu Map is also one of the commonly used apps in daily life, so it is necessary to provide some support for it.
Does this pull request fix one issue?
#98
Describe how you did it
With Baidu Map Open APIs
Describe how to verify it
Originally, there was an example here, but I noticed that this part of the file has been moved to another repository. I will also add it to the new one as soon as possible
The part of original example:
Special notes for reviews