diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0086358d..b8bcd84b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,17 @@ +# +# Copyright 2024-2025 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# + blank_issues_enabled: true diff --git a/.github/dependbot.yml b/.github/dependbot.yml index 7d82a622..0be74062 100644 --- a/.github/dependbot.yml +++ b/.github/dependbot.yml @@ -1,5 +1,18 @@ -# `dependabot.yml` file with -# maven version update. +# +# Copyright 2024-2025 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# version: 2 updates: diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml new file mode 100644 index 00000000..254576a6 --- /dev/null +++ b/.github/workflows/code-check.yml @@ -0,0 +1,41 @@ +# +# Copyright 2024-2025 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# + +name: PR Check + +on: + pull_request: + branches: + - main + +jobs: + build: +# name: Build branch +# runs-on: ubuntu-latest +# steps: +# - name: Checkout source code +# uses: actions/checkout@v4 +# +# - name: Set up JDK 17 +# uses: actions/setup-java@v4 +# with: +# java-version: '17' +# distribution: 'temurin' +# cache: 'maven' +# +# - name: Run tests +# run: | +# ./mvnw test diff --git a/.github/workflows/code-format-check.yml b/.github/workflows/code-format-check.yml index 7ded317b..53468def 100644 --- a/.github/workflows/code-format-check.yml +++ b/.github/workflows/code-format-check.yml @@ -1,3 +1,19 @@ +# +# Copyright 2024-2025 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# + name: Source Code Format on: diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml new file mode 100644 index 00000000..6b5aaa52 --- /dev/null +++ b/.github/workflows/license-check.yml @@ -0,0 +1,34 @@ +# +# Copyright 2024-2025 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# + +name: License Check + +on: + pull_request: + branches: + - main + +jobs: + license-header: + name: License header + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Check license header + uses: apache/skywalking-eyes@5b7ee1731d036b5aac68f8bd3fc9e6f98ada082e diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 00000000..e8d70b6d --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,68 @@ +# +# Copyright 2024-2025 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# 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. +# + +header: + license: + copyright-owner: Spring AI Alibaba Community + software-name: Spring AI Alibaba + copyright-year: '2024-2025' + content: | + Copyright 2024-2025 the original author or authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + 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. + pattern: | + Copyright \d20{2}-\d20{2} the original author or authors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "ASIS" BASIS, + + paths-ignore: + - '.github/ISSUE_TEMPLATE' + - '.github/PULL_REQUEST_TEMPLATE' + - '**/.gitignore' + - '.mvn' + - 'docker/.env' + - 'licenses' + - '**/*.md' + - '**/*.json' + - '**/*.ftl' + - '**/target/**' + - '**/*.iml' + - '**/*.key' + - '**/*.txt' + - 'LICENSE' + - '**/*.imports' + - '**/*.bib' + - '**/*.st' + + # When a license check fails, the check result is displayed on the PR + comment: on-failure diff --git a/community/document-parsers/document-parser-apache-pdfbox/pom.xml b/community/document-parsers/document-parser-apache-pdfbox/pom.xml index f36fafad..86aea696 100644 --- a/community/document-parsers/document-parser-apache-pdfbox/pom.xml +++ b/community/document-parsers/document-parser-apache-pdfbox/pom.xml @@ -1,4 +1,20 @@ + + diff --git a/community/document-parsers/document-parser-apache-pdfbox/src/main/java/com/alibaba/cloud/ai/parser/apache/pdfbox/PagePdfDocumentParser.java b/community/document-parsers/document-parser-apache-pdfbox/src/main/java/com/alibaba/cloud/ai/parser/apache/pdfbox/PagePdfDocumentParser.java index 030a6419..1200553e 100644 --- a/community/document-parsers/document-parser-apache-pdfbox/src/main/java/com/alibaba/cloud/ai/parser/apache/pdfbox/PagePdfDocumentParser.java +++ b/community/document-parsers/document-parser-apache-pdfbox/src/main/java/com/alibaba/cloud/ai/parser/apache/pdfbox/PagePdfDocumentParser.java @@ -1,3 +1,19 @@ +/* + * Copyright 2024-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * 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.parser.apache.pdfbox; import java.awt.Rectangle; diff --git a/community/document-parsers/document-parser-apache-pdfbox/src/main/java/com/alibaba/cloud/ai/parser/apache/pdfbox/ParagraphPdfDocumentParser.java b/community/document-parsers/document-parser-apache-pdfbox/src/main/java/com/alibaba/cloud/ai/parser/apache/pdfbox/ParagraphPdfDocumentParser.java index 193cf5c9..efc44c89 100644 --- a/community/document-parsers/document-parser-apache-pdfbox/src/main/java/com/alibaba/cloud/ai/parser/apache/pdfbox/ParagraphPdfDocumentParser.java +++ b/community/document-parsers/document-parser-apache-pdfbox/src/main/java/com/alibaba/cloud/ai/parser/apache/pdfbox/ParagraphPdfDocumentParser.java @@ -1,3 +1,19 @@ +/* + * Copyright 2024-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * 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.parser.apache.pdfbox; import java.awt.Rectangle; diff --git a/community/document-parsers/document-parser-apache-pdfbox/src/test/java/com/alibaba/cloud/ai/parser/apache/pdfbox/PagePdfDocumentParserTests.java b/community/document-parsers/document-parser-apache-pdfbox/src/test/java/com/alibaba/cloud/ai/parser/apache/pdfbox/PagePdfDocumentParserTests.java index d004b94f..f5ed5dfd 100644 --- a/community/document-parsers/document-parser-apache-pdfbox/src/test/java/com/alibaba/cloud/ai/parser/apache/pdfbox/PagePdfDocumentParserTests.java +++ b/community/document-parsers/document-parser-apache-pdfbox/src/test/java/com/alibaba/cloud/ai/parser/apache/pdfbox/PagePdfDocumentParserTests.java @@ -1,3 +1,19 @@ +/* + * Copyright 2024-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * 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.parser.apache.pdfbox; import java.io.IOException; diff --git a/community/document-parsers/document-parser-apache-pdfbox/src/test/java/com/alibaba/cloud/ai/parser/apache/pdfbox/ParagraphPdfDocumentParserTests.java b/community/document-parsers/document-parser-apache-pdfbox/src/test/java/com/alibaba/cloud/ai/parser/apache/pdfbox/ParagraphPdfDocumentParserTests.java index a45be2e8..199f5f44 100644 --- a/community/document-parsers/document-parser-apache-pdfbox/src/test/java/com/alibaba/cloud/ai/parser/apache/pdfbox/ParagraphPdfDocumentParserTests.java +++ b/community/document-parsers/document-parser-apache-pdfbox/src/test/java/com/alibaba/cloud/ai/parser/apache/pdfbox/ParagraphPdfDocumentParserTests.java @@ -1,3 +1,19 @@ +/* + * Copyright 2024-2025 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * 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.parser.apache.pdfbox; import org.junit.jupiter.api.Test; diff --git a/community/document-parsers/document-parser-bibtex/pom.xml b/community/document-parsers/document-parser-bibtex/pom.xml index 67f055ea..c657dc9f 100644 --- a/community/document-parsers/document-parser-bibtex/pom.xml +++ b/community/document-parsers/document-parser-bibtex/pom.xml @@ -1,4 +1,20 @@ + + diff --git a/community/document-parsers/document-parser-bshtml/pom.xml b/community/document-parsers/document-parser-bshtml/pom.xml index 5dd04584..3af602ae 100644 --- a/community/document-parsers/document-parser-bshtml/pom.xml +++ b/community/document-parsers/document-parser-bshtml/pom.xml @@ -1,4 +1,20 @@ + + diff --git a/community/document-parsers/document-parser-bshtml/src/test/resources/example-utf8.html b/community/document-parsers/document-parser-bshtml/src/test/resources/example-utf8.html index f96e20fc..7465422f 100644 --- a/community/document-parsers/document-parser-bshtml/src/test/resources/example-utf8.html +++ b/community/document-parsers/document-parser-bshtml/src/test/resources/example-utf8.html @@ -1,3 +1,19 @@ + + Chew dad's slippers diff --git a/community/document-parsers/document-parser-bshtml/src/test/resources/factbook.xml b/community/document-parsers/document-parser-bshtml/src/test/resources/factbook.xml index d059ee9d..881bba4d 100644 --- a/community/document-parsers/document-parser-bshtml/src/test/resources/factbook.xml +++ b/community/document-parsers/document-parser-bshtml/src/test/resources/factbook.xml @@ -1,4 +1,20 @@ + + United States diff --git a/community/document-parsers/document-parser-markdown/pom.xml b/community/document-parsers/document-parser-markdown/pom.xml index 0b8b47ce..08193844 100644 --- a/community/document-parsers/document-parser-markdown/pom.xml +++ b/community/document-parsers/document-parser-markdown/pom.xml @@ -1,4 +1,20 @@ + + diff --git a/community/document-parsers/document-parser-tika/pom.xml b/community/document-parsers/document-parser-tika/pom.xml index 93492ee8..74ebb67a 100644 --- a/community/document-parsers/document-parser-tika/pom.xml +++ b/community/document-parsers/document-parser-tika/pom.xml @@ -1,4 +1,20 @@ + + diff --git a/community/document-parsers/document-parser-tika/src/test/resources/example-utf8.html b/community/document-parsers/document-parser-tika/src/test/resources/example-utf8.html index f96e20fc..7465422f 100644 --- a/community/document-parsers/document-parser-tika/src/test/resources/example-utf8.html +++ b/community/document-parsers/document-parser-tika/src/test/resources/example-utf8.html @@ -1,3 +1,19 @@ + + Chew dad's slippers diff --git a/community/document-parsers/document-parser-tika/src/test/resources/factbook.xml b/community/document-parsers/document-parser-tika/src/test/resources/factbook.xml index d059ee9d..881bba4d 100644 --- a/community/document-parsers/document-parser-tika/src/test/resources/factbook.xml +++ b/community/document-parsers/document-parser-tika/src/test/resources/factbook.xml @@ -1,4 +1,20 @@ + + United States diff --git a/community/document-readers/feishu-document-reader/pom.xml b/community/document-readers/feishu-document-reader/pom.xml index 2fcbc136..11f1e41c 100644 --- a/community/document-readers/feishu-document-reader/pom.xml +++ b/community/document-readers/feishu-document-reader/pom.xml @@ -1,4 +1,20 @@ + + 4.0.0 diff --git a/community/document-readers/feishu-document-reader/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports b/community/document-readers/feishu-document-reader/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports index 96128bdc..1e601f52 100644 --- a/community/document-readers/feishu-document-reader/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports +++ b/community/document-readers/feishu-document-reader/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports @@ -1 +1 @@ -com.alibaba.cloud.ai.reader.feishu.config.FeiShuPluginConfiguration \ No newline at end of file +com.alibaba.cloud.ai.reader.feishu.config.FeiShuPluginConfiguration diff --git a/community/document-readers/github-document-reader/pom.xml b/community/document-readers/github-document-reader/pom.xml index 3b9e3fba..29a486b5 100644 --- a/community/document-readers/github-document-reader/pom.xml +++ b/community/document-readers/github-document-reader/pom.xml @@ -1,4 +1,20 @@ + + diff --git a/community/document-readers/poi-document-reader/pom.xml b/community/document-readers/poi-document-reader/pom.xml index 1222c33f..b6869306 100644 --- a/community/document-readers/poi-document-reader/pom.xml +++ b/community/document-readers/poi-document-reader/pom.xml @@ -1,7 +1,23 @@ + + + diff --git a/community/document-readers/yuque-document-reader/pom.xml b/community/document-readers/yuque-document-reader/pom.xml index 0fc0388a..5f1d424a 100644 --- a/community/document-readers/yuque-document-reader/pom.xml +++ b/community/document-readers/yuque-document-reader/pom.xml @@ -1,4 +1,20 @@ + + diff --git a/community/function-calling/spring-ai-alibaba-starter-function-calling-alitranslate/pom.xml b/community/function-calling/spring-ai-alibaba-starter-function-calling-alitranslate/pom.xml index f993caf8..c32cdb0d 100644 --- a/community/function-calling/spring-ai-alibaba-starter-function-calling-alitranslate/pom.xml +++ b/community/function-calling/spring-ai-alibaba-starter-function-calling-alitranslate/pom.xml @@ -1,19 +1,19 @@ - - - - - - - - - - - - + ~ Copyright 2024-2025 the original author or authors. + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ https://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ 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. +--> - + + 4.0.0 diff --git a/community/function-calling/spring-ai-alibaba-starter-function-calling-time/pom.xml b/community/function-calling/spring-ai-alibaba-starter-function-calling-time/pom.xml index 516ca973..73c4dc09 100644 --- a/community/function-calling/spring-ai-alibaba-starter-function-calling-time/pom.xml +++ b/community/function-calling/spring-ai-alibaba-starter-function-calling-time/pom.xml @@ -1,19 +1,18 @@ - + + 4.0.0 diff --git a/community/function-calling/spring-ai-alibaba-starter-function-calling-weather/pom.xml b/community/function-calling/spring-ai-alibaba-starter-function-calling-weather/pom.xml index afc84264..f1d15d8a 100644 --- a/community/function-calling/spring-ai-alibaba-starter-function-calling-weather/pom.xml +++ b/community/function-calling/spring-ai-alibaba-starter-function-calling-weather/pom.xml @@ -1,19 +1,18 @@ - - - + + * Description Dashscope rerank model.
diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/dashscope/rerank/DashScopeRerankOptions.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/dashscope/rerank/DashScopeRerankOptions.java index 0cf6060f..5e726d8f 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/dashscope/rerank/DashScopeRerankOptions.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/dashscope/rerank/DashScopeRerankOptions.java @@ -13,21 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.dashscope.rerank; diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/document/DocumentWithScore.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/document/DocumentWithScore.java index cda0261f..6c4fbace 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/document/DocumentWithScore.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/document/DocumentWithScore.java @@ -13,21 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.document; diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankModel.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankModel.java index 9431d863..1079caa8 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankModel.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankModel.java @@ -13,21 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.model; diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankOptions.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankOptions.java index c6238d6d..24d24708 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankOptions.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankOptions.java @@ -13,21 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.model; diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankRequest.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankRequest.java index f1a86746..494899f9 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankRequest.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankRequest.java @@ -13,21 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.model; diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResponse.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResponse.java index 5ff1fb55..cf74094c 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResponse.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResponse.java @@ -13,31 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.model; +import java.util.List; + import com.alibaba.cloud.ai.document.DocumentWithScore; + import org.springframework.ai.model.ModelResponse; -import org.springframework.ai.model.ResponseMetadata; import org.springframework.util.CollectionUtils; -import java.util.List; - /** * Title rerank response.
* Description rerank response.
diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResponseMetadata.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResponseMetadata.java index ef9a2af0..3c89e0d3 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResponseMetadata.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResponseMetadata.java @@ -13,31 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.model; +import java.util.Map; + import org.springframework.ai.chat.metadata.EmptyUsage; import org.springframework.ai.chat.metadata.Usage; import org.springframework.ai.model.AbstractResponseMetadata; import org.springframework.ai.model.ResponseMetadata; -import java.util.Map; - /** * Title rerank response metadata.
* Description rerank response metadata.
diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResultMetadata.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResultMetadata.java index 00930c3c..d3cbf787 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResultMetadata.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/model/RerankResultMetadata.java @@ -13,21 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.model; diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/transformer/splitter/SentenceSplitter.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/transformer/splitter/SentenceSplitter.java index fa38e090..3516f85f 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/transformer/splitter/SentenceSplitter.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/transformer/splitter/SentenceSplitter.java @@ -13,39 +13,25 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.transformer.splitter; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + import com.knuddels.jtokkit.Encodings; import com.knuddels.jtokkit.api.Encoding; import com.knuddels.jtokkit.api.EncodingRegistry; import com.knuddels.jtokkit.api.EncodingType; import opennlp.tools.sentdetect.SentenceDetectorME; import opennlp.tools.sentdetect.SentenceModel; + import org.springframework.ai.transformer.splitter.TextSplitter; import org.springframework.util.Assert; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - /** * Title Sentence splitter with nlp model.
* Description Sentence splitter with nlp model.
diff --git a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/autoconfig/dashscope/DashScopeRerankProperties.java b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/autoconfig/dashscope/DashScopeRerankProperties.java index fb148d07..cc8b0052 100644 --- a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/autoconfig/dashscope/DashScopeRerankProperties.java +++ b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/autoconfig/dashscope/DashScopeRerankProperties.java @@ -13,21 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.autoconfig.dashscope; diff --git a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/dashscope/rerank/DashScopeRerankModelTest.java b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/dashscope/rerank/DashScopeRerankModelTest.java index d0935edf..ffa5c0bf 100644 --- a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/dashscope/rerank/DashScopeRerankModelTest.java +++ b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/dashscope/rerank/DashScopeRerankModelTest.java @@ -13,21 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.dashscope.rerank; diff --git a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/evaluation/EvaluationIT.java b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/evaluation/EvaluationIT.java index ea7b326c..5000f18a 100644 --- a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/evaluation/EvaluationIT.java +++ b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/evaluation/EvaluationIT.java @@ -13,8 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package com.alibaba.cloud.ai.evaluation; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; + import com.alibaba.cloud.ai.advisor.DocumentRetrievalAdvisor; import com.alibaba.cloud.ai.dashscope.api.DashScopeApi; import com.alibaba.cloud.ai.dashscope.chat.DashScopeChatModel; @@ -26,8 +32,8 @@ import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import org.springframework.ai.chat.client.ChatClient; -import org.springframework.ai.chat.messages.AssistantMessage; import org.springframework.ai.chat.model.ChatResponse; import org.springframework.ai.document.Document; import org.springframework.ai.evaluation.EvaluationRequest; @@ -40,11 +46,6 @@ import org.springframework.core.io.Resource; import org.springframework.test.context.TestPropertySource; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.List; - /** * Title React agent test cases.
* Description React agent test cases.
diff --git a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/transformer/splitter/SentenceSplitterTest.java b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/transformer/splitter/SentenceSplitterTest.java index c5eb4095..bf3c6358 100644 --- a/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/transformer/splitter/SentenceSplitterTest.java +++ b/spring-ai-alibaba-core/src/test/java/com/alibaba/cloud/ai/transformer/splitter/SentenceSplitterTest.java @@ -13,35 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* -* Copyright 2024 the original author or authors. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* https://www.apache.org/licenses/LICENSE-2.0 -* -* 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.transformer.splitter; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.List; + import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.core.io.Resource; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.List; - /** * Title SentenceSplitter test cases.
* Description SentenceSplitter test cases.
diff --git a/spring-ai-alibaba-core/src/test/resources/application-logging-test.properties b/spring-ai-alibaba-core/src/test/resources/application-logging-test.properties index 8e8b3b2c..abd3ff7b 100644 --- a/spring-ai-alibaba-core/src/test/resources/application-logging-test.properties +++ b/spring-ai-alibaba-core/src/test/resources/application-logging-test.properties @@ -1 +1,15 @@ +# Copyright 2024-2025 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# 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. + logging.level.org.springframework.ai.chat.client.advisor=DEBUG diff --git a/spring-ai-alibaba-core/src/test/resources/application.yml b/spring-ai-alibaba-core/src/test/resources/application.yml index 97b3ae0f..9adc285b 100644 --- a/spring-ai-alibaba-core/src/test/resources/application.yml +++ b/spring-ai-alibaba-core/src/test/resources/application.yml @@ -1,3 +1,17 @@ +# Copyright 2024-2025 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# 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. + spring: ai: dashscope: diff --git a/spring-ai-alibaba-starter/pom.xml b/spring-ai-alibaba-starter/pom.xml index deba3cb0..82da015a 100644 --- a/spring-ai-alibaba-starter/pom.xml +++ b/spring-ai-alibaba-starter/pom.xml @@ -1,19 +1,18 @@ -