Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add Regex FC 、JsonProcessor FC & code format #187

Merged
merged 6 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Feature request
name: Feature Request
about: Suggest an idea for this project
title: ''
labels: ''
Expand All @@ -24,4 +24,4 @@ A clear and concise description of what you want to happen.
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature regexRequest here.
8 changes: 4 additions & 4 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ The Spring AI Alibaba project management committee (PMC), is the only governance

Committers MUST remain active. If they are unresponsive for >6 months, they will be automatically removed unless a <a href="https://en.wikipedia.org/wiki/Supermajority#Two-thirds_vote" target="_blank">super-majority</a> of the other project committers agrees to extend the period to be greater than 6 months.

New committers can be added to the project by receiving at least 3 votes from the existing [PMC members](./PMC_MEMBERS.md). A potential committer may be nominated by an existing PMC member. A vote is conducted in private between the current PMC members over the course of a one week voting period. At the end of the week, votes are counted and a pull request is made on the repo adding the new committer to the [COMMITTERS](./COMMITTERS.md) file.
New committers can be added to the project by receiving at least 3 votes from the existing [PMC members](./PMC_MEMBERS.md). A potential committer may be nominated by an existing PMC member. A vote is conducted in private between the current PMC members over the course of a one week voting period. At the end of the week, votes are counted and a pull regexRequest is made on the repo adding the new committer to the [COMMITTERS](./COMMITTERS.md) file.

A committer may step down by submitting an issue stating their intent.

### PMC Member
Existing PMC members can initiate a vote for a new committer. The vote is conducted in a non-public mailing list or chatting group. To become a committer there must have at least 3 +1 votes from the existing PMC members. New committers can be added to the [COMMITTERS](./COMMITTERS.md) file in the form of pull request.
Existing PMC members can initiate a vote for a new committer. The vote is conducted in a non-public mailing list or chatting group. To become a committer there must have at least 3 +1 votes from the existing PMC members. New committers can be added to the [COMMITTERS](./COMMITTERS.md) file in the form of pull regexRequest.

Existing PMC members can initiate a vote for a new PMC member. The vote is conducted in a non-public mailing list or chatting group. A committer can become a PMC member if at least 3 existing PMC members vote in favor. New members can be added to the [PMC_MEMBERS](./PMC_MEMBERS.md) file in the form of pull request.
Existing PMC members can initiate a vote for a new PMC member. The vote is conducted in a non-public mailing list or chatting group. A committer can become a PMC member if at least 3 existing PMC members vote in favor. New members can be added to the [PMC_MEMBERS](./PMC_MEMBERS.md) file in the form of pull regexRequest.

If a PMC member does not have involve in any project or community activities for more than one year, he/she will automatically be listed as the emeritus member. Emeritus members do not participate in any voting decisions of the community. Emeritus members will be permanently retained. To become PMC members from emeritus members, a voting process is required.

Expand All @@ -60,4 +60,4 @@ A PMC member may step down by submitting an issue stating their intent.

This project has adopted the [Contributor Covenant Code of Conduct](./CODE_OF_CONDUCT.md)

Changes to this GOVERNANCE document require a pull request with approval from at least 3 of the current [PMC members](./PMC_MEMBERS.md).
Changes to this GOVERNANCE document require a pull regexRequest with approval from at least 3 of the current [PMC members](./PMC_MEMBERS.md).
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.alibaba.cloud.ai</groupId>
Expand All @@ -29,77 +29,41 @@
<name>spring-ai-alibaba-starter-plugin-baidusearch</name>

<description>Baidu search tool for Spring AI Alibaba</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
<jsoup-version>1.18.1</jsoup-version>
</properties>

<dependencies>
<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>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.18.1</version>
<version>${jsoup-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
<finalName>spring-ai-alibaba-plugin-baidusearch</finalName>
</build>

<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,17 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;

/**
* .
*
* @author: KrakenZJC
* @since : 2024-11-18
* @author KrakenZJC
**/

@Configuration
@ConditionalOnClass(BaiduSearchService.class)
public class BaiduSearchPluginConfiguration {
public class BaiduSearchAutoConfiguration {

@Bean
@ConditionalOnMissingBean
@Description("Use baidu search engine to query for the latest news.") // function
// description
@Description("Use baidu search engine to query for the latest news.")
public BaiduSearchService baiduSearchService() {
return new BaiduSearchService();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.alibaba.cloud.ai.plugin.baidu;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand All @@ -16,8 +15,10 @@
* limitations under the License.
*/

import com.fasterxml.jackson.annotation.JsonInclude;
package com.alibaba.cloud.ai.plugin.baidu;

import com.fasterxml.jackson.annotation.JsonClassDescription;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import org.jsoup.Jsoup;
Expand All @@ -37,12 +38,8 @@
import java.util.function.Function;

/**
* .
*
* @author: KrakenZJC
* @since : 2024-11-18
* @author KrakenZJC
**/

public class BaiduSearchService implements Function<BaiduSearchService.Request, BaiduSearchService.Response> {

private static final Logger logger = LoggerFactory.getLogger(BaiduSearchService.class);
Expand All @@ -51,14 +48,14 @@ public class BaiduSearchService implements Function<BaiduSearchService.Request,

private static final int MAX_RESULTS = 20;

private final WebClient webClient;

private static final int Memory_Size = 5;

private static final int Memory_Unit = 1024;

private static final int Max_Memory_In_MB = Memory_Size * Memory_Unit * Memory_Unit;

private final WebClient webClient;

public BaiduSearchService() {
this.webClient = WebClient.builder()
.defaultHeader(HttpHeaders.USER_AGENT,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
com.alibaba.cloud.ai.plugin.baidu.BaiduSearchPluginConfiguration
com.alibaba.cloud.ai.plugin.baidu.BaiduSearchAutoConfiguration

This file was deleted.

138 changes: 56 additions & 82 deletions community/plugins/spring-ai-alibaba-starter-plugin-bingsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,89 +17,63 @@
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.alibaba.cloud.ai</groupId>
<artifactId>spring-ai-alibaba</artifactId>
<version>${revision}</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>spring-ai-alibaba-starter-plugin-bingsearch</artifactId>
<name>spring-ai-alibaba-starter-plugin-bingsearch</name>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.alibaba.cloud.ai</groupId>
<artifactId>spring-ai-alibaba</artifactId>
<version>${revision}</version>
<relativePath>../../../pom.xml</relativePath>
</parent>
<artifactId>spring-ai-alibaba-starter-plugin-bingsearch</artifactId>
<name>spring-ai-alibaba-starter-plugin-bingsearch</name>

<description>Bing search tool for Spring AI Alibaba</description>
<description>Bing search tool for Spring AI Alibaba</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
</properties>

<dependencies>
<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>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>

<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
</properties>

<dependencies>
<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>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>

<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<finalName>spring-ai-alibaba-plugin-bingsearch</finalName>
</build>
</project>
Loading
Loading