From 9978e7a80f1b4cf68dfedb8458eac6192776987e Mon Sep 17 00:00:00 2001 From: yuluo-yx Date: Fri, 3 Jan 2025 21:55:05 +0800 Subject: [PATCH 1/4] infra: add license check action Signed-off-by: yuluo-yx --- .github/workflows/license-check.yml | 18 ++++ .licenserc.yaml | 146 ++++++++++++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 .github/workflows/license-check.yml create mode 100644 .licenserc.yaml diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml new file mode 100644 index 000000000..11e2d89d3 --- /dev/null +++ b/.github/workflows/license-check.yml @@ -0,0 +1,18 @@ +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 000000000..991ccf826 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,146 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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 +# +# http://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: + spdx-id: Apache-2.0 + copyright-owner: Apache Software Foundation + + paths-ignore: + - '.github/ISSUE_TEMPLATE' + - '.github/PULL_REQUEST_TEMPLATE' + - '**/.gitignore' + - '.gitmodules' + - '.lift' + - '.mvn' + - 'apm-protocol/apm-network/src/main/proto/.gitignore' + - 'codeStyle.xml' + - 'docker/.env' + - 'dist' + - 'licenses' + - 'dist-material/release-docs' + - '**/*.md' + - '**/*.json' + - '**/*.ftl' + - '**/target/**' + - '**/*.iml' + - '**/*.ini' + - '**/*.crt' + - '**/*.pem' + - '**/*.key' + - '**/*.txt' + - 'LICENSE' + - 'NOTICE' + - 'skywalking-ui/dist' + - 'skywalking-ui/node_modules' + - 'skywalking-ui/node' + - 'skywalking-ui/.browserslistrc' + - 'skywalking-ui/.prettierrc' + - 'skywalking-ui/src/types/auto-imports.d.ts' + - 'skywalking-ui/src/types/components.d.ts' + - '**/src/main/fbs/istio/**' + - '**/src/main/proto/envoy/**' + - '**/src/main/proto/udpa/**' + - '**/src/main/proto/google/**' + - '**/src/main/proto/istio/**' + - '**/src/main/proto/jaeger/**' + - '**/src/main/proto/mixer/**' + - '**/src/main/proto/policy/**' + - '**/src/main/proto/cilium/**' + - '**/src/main/proto/prometheus/client_model/metrics.proto' + - '**/src/main/proto/protoc-gen-swagger/**' + - '**/src/main/proto/validate/validate.proto' + - '**/src/main/proto/opentelemetry/**' + - 'oap-server/server-starter/src/main/resources/version.properties' + - '**/mockito-extensions/**' + - 'oap-server/server-library/library-async-profiler-jfr-parser' + + comment: on-failure + +dependency: + files: + - pom.xml + - skywalking-ui/package.json + excludes: + - name: org.openjdk.jmh:jmh-core # We don't distribute the dependencies, they are just for the build process + recursive: true + - name: org.apache.skywalking:* # Exclude self dependencies + - name: org.apache.skywalking:microbench + recursive: true + licenses: + - name: org.slf4j:slf4j-api + version: 1.7.30,1.7.32 + license: MIT + - name: com.squareup.okhttp3:okhttp + version: 3.14.9,3.12.2 + license: Apache-2.0 + - name: com.google.guava:listenablefuture + version: 9999.0-empty-to-avoid-conflict-with-guava + license: Apache-2.0 + - name: io.swagger:swagger-annotations + version: 1.6.9 + license: Apache-2.0 + - name: com.squareup.okio:okio + version: 1.15.0,1.17.2 + license: Apache-2.0 + - name: com.squareup.retrofit2:retrofit + version: 2.3.0,2.5.0 + license: Apache-2.0 + - name: com.squareup.retrofit2:converter-jackson + version: 2.3.0,2.5.0 + license: Apache-2.0 + - name: com.fasterxml.jackson.module:jackson-module-kotlin + version: 2.13.4 + license: Apache-2.0 + - name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 + version: 2.17.1 + license: Apache-2.0 + - name: com.fasterxml.jackson.datatype:jackson-datatype-jdk8 + version: 2.17.1 + license: Apache-2.0 + - name: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml + version: 2.15.2 + license: Apache-2.0 + - name: com.graphql-java:graphql-java-extended-scalars + version: 18.1 + license: MIT + - name: com.graphql-java:graphql-java + version: 21.0 + license: MIT + - name: com.github.luben:zstd-jni + version: 1.4.3-1 + license: BSD-2-Clause + - name: org.antlr:antlr4-runtime + version: 4.11.1 + license: BSD-3-Clause + - name: com.google.flatbuffers:flatbuffers-java + version: 1.12.0 + license: Apache-2.0 + - name: build.buf.protoc-gen-validate:pgv-java-stub + version: 0.6.13 + license: Apache-2.0 + - name: build.buf.protoc-gen-validate:protoc-gen-validate + version: 0.6.13 + license: Apache-2.0 + - name: com.aayushatharva.brotli4j:service + version: 1.16.0 + license: Apache-2.0 + - name: io.vertx:vertx-grpc + version: 4.5.9 + license: EPL-2.0 + \ No newline at end of file From 6318aa632d15322a397102de28de31d07ad66976 Mon Sep 17 00:00:00 2001 From: yuluo-yx Date: Fri, 3 Jan 2025 22:57:01 +0800 Subject: [PATCH 2/4] feat: update license header Signed-off-by: yuluo-yx --- .github/ISSUE_TEMPLATE/config.yml | 16 ++ .github/dependbot.yml | 17 +- .github/workflows/code-format-check.yml | 16 ++ .github/workflows/license-check.yml | 16 ++ .licenserc.yaml | 166 +++++------------- .../document-parser-apache-pdfbox/pom.xml | 16 ++ .../apache/pdfbox/PagePdfDocumentParser.java | 16 ++ .../pdfbox/ParagraphPdfDocumentParser.java | 16 ++ .../pdfbox/PagePdfDocumentParserTests.java | 16 ++ .../ParagraphPdfDocumentParserTests.java | 16 ++ .../document-parser-bibtex/pom.xml | 16 ++ .../document-parser-bshtml/pom.xml | 16 ++ .../src/test/resources/example-utf8.html | 16 ++ .../src/test/resources/factbook.xml | 16 ++ .../document-parser-markdown/pom.xml | 16 ++ .../document-parser-tika/pom.xml | 16 ++ .../src/test/resources/example-utf8.html | 16 ++ .../src/test/resources/factbook.xml | 16 ++ .../feishu-document-reader/pom.xml | 16 ++ ...ot.autoconfigure.AutoConfiguration.imports | 2 +- .../github-document-reader/pom.xml | 16 ++ .../poi-document-reader/pom.xml | 18 +- .../tencent-cos-document-reader/pom.xml | 16 ++ .../yuque-document-reader/pom.xml | 16 ++ .../pom.xml | 26 +-- .../pom.xml | 27 ++- .../pom.xml | 27 ++- .../baidumap/BaiDuMapAutoConfiguration.java | 14 +- .../baidumap/BaiDuMapProperties.java | 13 +- .../baidumap/MapSearchService.java | 13 +- .../ai/functioncalling/baidumap/MapTools.java | 13 +- .../pom.xml | 27 ++- .../pom.xml | 27 ++- .../pom.xml | 27 ++- .../pom.xml | 27 ++- .../pom.xml | 27 ++- .../pom.xml | 27 ++- .../pom.xml | 26 +-- .../pom.xml | 27 ++- .../pom.xml | 27 ++- .../pom.xml | 27 ++- .../pom.xml | 29 ++- .../pom.xml | 27 ++- .../pom.xml | 16 ++ .../pom.xml | 27 ++- .../pom.xml | 16 ++ .../pom.xml | 27 ++- .../pom.xml | 27 ++- mvnw | 25 ++- mvnw.cmd | 31 ++-- pom.xml | 27 ++- spring-ai-alibaba-autoconfigure/pom.xml | 18 +- .../dashscope/DashScopeRerankProperties.java | 16 +- spring-ai-alibaba-core/pom.xml | 27 ++- .../ai/advisor/RetrievalRerankAdvisor.java | 16 +- .../ai/dashscope/chat/MessageFormat.java | 16 +- .../ai/dashscope/rag/OpenSearchConfig.java | 16 ++ .../ai/dashscope/rag/OpenSearchVector.java | 16 ++ .../rerank/DashScopeRerankModel.java | 28 +-- .../rerank/DashScopeRerankOptions.java | 16 +- .../cloud/ai/document/DocumentWithScore.java | 16 +- .../alibaba/cloud/ai/model/RerankModel.java | 15 -- .../alibaba/cloud/ai/model/RerankOptions.java | 15 -- .../alibaba/cloud/ai/model/RerankRequest.java | 16 +- .../cloud/ai/model/RerankResponse.java | 21 +-- .../ai/model/RerankResponseMetadata.java | 19 +- .../cloud/ai/model/RerankResultMetadata.java | 15 -- .../splitter/SentenceSplitter.java | 28 +-- .../dashscope/DashScopeRerankProperties.java | 15 -- .../rerank/DashScopeRerankModelTest.java | 16 +- .../cloud/ai/evaluation/EvaluationIT.java | 13 +- .../splitter/SentenceSplitterTest.java | 24 +-- .../application-logging-test.properties | 14 ++ .../src/test/resources/application.yml | 14 ++ spring-ai-alibaba-starter/pom.xml | 27 ++- 75 files changed, 868 insertions(+), 746 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 0086358db..b8bcd84bc 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 7d82a6222..0be740627 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-format-check.yml b/.github/workflows/code-format-check.yml index 7ded317b6..53468defa 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 index 11e2d89d3..6b5aaa52d 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-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: License Check on: diff --git a/.licenserc.yaml b/.licenserc.yaml index 991ccf826..e8d70b6d0 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -1,146 +1,68 @@ # -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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 +# Copyright 2024-2025 the original author or authors. # -# http://www.apache.org/licenses/LICENSE-2.0 +# 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 # -# 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. +# 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: - spdx-id: Apache-2.0 - copyright-owner: Apache Software Foundation + 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' - - '.gitmodules' - - '.lift' - '.mvn' - - 'apm-protocol/apm-network/src/main/proto/.gitignore' - - 'codeStyle.xml' - 'docker/.env' - - 'dist' - 'licenses' - - 'dist-material/release-docs' - '**/*.md' - '**/*.json' - '**/*.ftl' - '**/target/**' - '**/*.iml' - - '**/*.ini' - - '**/*.crt' - - '**/*.pem' - '**/*.key' - '**/*.txt' - 'LICENSE' - - 'NOTICE' - - 'skywalking-ui/dist' - - 'skywalking-ui/node_modules' - - 'skywalking-ui/node' - - 'skywalking-ui/.browserslistrc' - - 'skywalking-ui/.prettierrc' - - 'skywalking-ui/src/types/auto-imports.d.ts' - - 'skywalking-ui/src/types/components.d.ts' - - '**/src/main/fbs/istio/**' - - '**/src/main/proto/envoy/**' - - '**/src/main/proto/udpa/**' - - '**/src/main/proto/google/**' - - '**/src/main/proto/istio/**' - - '**/src/main/proto/jaeger/**' - - '**/src/main/proto/mixer/**' - - '**/src/main/proto/policy/**' - - '**/src/main/proto/cilium/**' - - '**/src/main/proto/prometheus/client_model/metrics.proto' - - '**/src/main/proto/protoc-gen-swagger/**' - - '**/src/main/proto/validate/validate.proto' - - '**/src/main/proto/opentelemetry/**' - - 'oap-server/server-starter/src/main/resources/version.properties' - - '**/mockito-extensions/**' - - 'oap-server/server-library/library-async-profiler-jfr-parser' + - '**/*.imports' + - '**/*.bib' + - '**/*.st' + # When a license check fails, the check result is displayed on the PR comment: on-failure - -dependency: - files: - - pom.xml - - skywalking-ui/package.json - excludes: - - name: org.openjdk.jmh:jmh-core # We don't distribute the dependencies, they are just for the build process - recursive: true - - name: org.apache.skywalking:* # Exclude self dependencies - - name: org.apache.skywalking:microbench - recursive: true - licenses: - - name: org.slf4j:slf4j-api - version: 1.7.30,1.7.32 - license: MIT - - name: com.squareup.okhttp3:okhttp - version: 3.14.9,3.12.2 - license: Apache-2.0 - - name: com.google.guava:listenablefuture - version: 9999.0-empty-to-avoid-conflict-with-guava - license: Apache-2.0 - - name: io.swagger:swagger-annotations - version: 1.6.9 - license: Apache-2.0 - - name: com.squareup.okio:okio - version: 1.15.0,1.17.2 - license: Apache-2.0 - - name: com.squareup.retrofit2:retrofit - version: 2.3.0,2.5.0 - license: Apache-2.0 - - name: com.squareup.retrofit2:converter-jackson - version: 2.3.0,2.5.0 - license: Apache-2.0 - - name: com.fasterxml.jackson.module:jackson-module-kotlin - version: 2.13.4 - license: Apache-2.0 - - name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 - version: 2.17.1 - license: Apache-2.0 - - name: com.fasterxml.jackson.datatype:jackson-datatype-jdk8 - version: 2.17.1 - license: Apache-2.0 - - name: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml - version: 2.15.2 - license: Apache-2.0 - - name: com.graphql-java:graphql-java-extended-scalars - version: 18.1 - license: MIT - - name: com.graphql-java:graphql-java - version: 21.0 - license: MIT - - name: com.github.luben:zstd-jni - version: 1.4.3-1 - license: BSD-2-Clause - - name: org.antlr:antlr4-runtime - version: 4.11.1 - license: BSD-3-Clause - - name: com.google.flatbuffers:flatbuffers-java - version: 1.12.0 - license: Apache-2.0 - - name: build.buf.protoc-gen-validate:pgv-java-stub - version: 0.6.13 - license: Apache-2.0 - - name: build.buf.protoc-gen-validate:protoc-gen-validate - version: 0.6.13 - license: Apache-2.0 - - name: com.aayushatharva.brotli4j:service - version: 1.16.0 - license: Apache-2.0 - - name: io.vertx:vertx-grpc - version: 4.5.9 - license: EPL-2.0 - \ No newline at end of file diff --git a/community/document-parsers/document-parser-apache-pdfbox/pom.xml b/community/document-parsers/document-parser-apache-pdfbox/pom.xml index f36fafad1..86aea6966 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 030a64199..1200553ed 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 193cf5c94..efc44c895 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 d004b94f2..f5ed5dfda 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 a45be2e80..199f5f445 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 67f055eab..c657dc9f2 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 5dd04584c..3af602ae8 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 f96e20fce..7465422f4 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 d059ee9d0..881bba4d9 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 0b8b47ce9..081938440 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 93492ee87..74ebb67aa 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 f96e20fce..7465422f4 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 d059ee9d0..881bba4d9 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 2fcbc136e..11f1e41cf 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 96128bdcb..1e601f523 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 3b9e3fba5..29a486b52 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 1222c33fb..b68693062 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 0fc0388ac..5f1d424a3 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 f993caf89..c32cdb0de 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 516ca9731..73c4dc099 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 afc842641..f1d15d8a3 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 0cf6060f3..f62ab49d4 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,7 @@ * 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 cda0261f4..5c48c5019 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,7 @@ * 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 9431d8636..1079caa8c 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 c6238d6de..24d247081 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 f1a867460..8a1c2ec1e 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,7 @@ * 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 5ff1fb551..cf74094cc 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 ef9a2af00..3c89e0d3b 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 00930c3c9..d3cbf787d 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 fa38e0905..3516f85f3 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 fb148d07c..cc8b0052e 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 d0935edf6..88fcfa413 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,7 @@ * 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 ea7b326c6..5000f18a1 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 c5eb40958..bf3c6358f 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 8e8b3b2c3..abd3ff7ba 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 97b3ae0fc..9adc285b3 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 deba3cb05..82da015a7 100644 --- a/spring-ai-alibaba-starter/pom.xml +++ b/spring-ai-alibaba-starter/pom.xml @@ -1,19 +1,18 @@ - Date: Fri, 3 Jan 2025 22:59:51 +0800 Subject: [PATCH 3/4] fix: fix code style Signed-off-by: yuluo-yx --- .../ai/autoconfigure/dashscope/DashScopeRerankProperties.java | 1 - .../com/alibaba/cloud/ai/advisor/RetrievalRerankAdvisor.java | 1 - .../java/com/alibaba/cloud/ai/dashscope/chat/MessageFormat.java | 1 - .../cloud/ai/dashscope/rerank/DashScopeRerankOptions.java | 1 - .../java/com/alibaba/cloud/ai/document/DocumentWithScore.java | 1 - .../src/main/java/com/alibaba/cloud/ai/model/RerankRequest.java | 1 - .../cloud/ai/dashscope/rerank/DashScopeRerankModelTest.java | 1 - 7 files changed, 7 deletions(-) diff --git a/spring-ai-alibaba-autoconfigure/src/main/java/com/alibaba/cloud/ai/autoconfigure/dashscope/DashScopeRerankProperties.java b/spring-ai-alibaba-autoconfigure/src/main/java/com/alibaba/cloud/ai/autoconfigure/dashscope/DashScopeRerankProperties.java index a94dfe545..8a939b16e 100644 --- a/spring-ai-alibaba-autoconfigure/src/main/java/com/alibaba/cloud/ai/autoconfigure/dashscope/DashScopeRerankProperties.java +++ b/spring-ai-alibaba-autoconfigure/src/main/java/com/alibaba/cloud/ai/autoconfigure/dashscope/DashScopeRerankProperties.java @@ -14,7 +14,6 @@ * limitations under the License. */ - package com.alibaba.cloud.ai.autoconfigure.dashscope; import com.alibaba.cloud.ai.dashscope.rerank.DashScopeRerankOptions; diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/advisor/RetrievalRerankAdvisor.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/advisor/RetrievalRerankAdvisor.java index 1ee0da5b4..0ed763c70 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/advisor/RetrievalRerankAdvisor.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/advisor/RetrievalRerankAdvisor.java @@ -14,7 +14,6 @@ * limitations under the License. */ - package com.alibaba.cloud.ai.advisor; import com.alibaba.cloud.ai.document.DocumentWithScore; diff --git a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/dashscope/chat/MessageFormat.java b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/dashscope/chat/MessageFormat.java index 394a3a727..e4d466361 100644 --- a/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/dashscope/chat/MessageFormat.java +++ b/spring-ai-alibaba-core/src/main/java/com/alibaba/cloud/ai/dashscope/chat/MessageFormat.java @@ -14,7 +14,6 @@ * limitations under the License. */ - package com.alibaba.cloud.ai.dashscope.chat; /** 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 f62ab49d4..5e726d8f4 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 @@ -14,7 +14,6 @@ * limitations under the License. */ - package com.alibaba.cloud.ai.dashscope.rerank; import com.alibaba.cloud.ai.model.RerankOptions; 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 5c48c5019..6c4fbace4 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 @@ -14,7 +14,6 @@ * limitations under the License. */ - package com.alibaba.cloud.ai.document; import com.alibaba.cloud.ai.model.RerankResultMetadata; 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 8a1c2ec1e..494899f9b 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 @@ -14,7 +14,6 @@ * limitations under the License. */ - package com.alibaba.cloud.ai.model; import org.springframework.ai.document.Document; 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 88fcfa413..ffa5c0bf0 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 @@ -14,7 +14,6 @@ * limitations under the License. */ - package com.alibaba.cloud.ai.dashscope.rerank; import com.alibaba.cloud.ai.dashscope.DashscopeAiTestConfiguration; From fa4359167cb185f0a275ce9c6d9fef934a7f715b Mon Sep 17 00:00:00 2001 From: yuluo-yx Date: Fri, 3 Jan 2025 23:06:30 +0800 Subject: [PATCH 4/4] infra: add pr test actions Signed-off-by: yuluo-yx --- .github/workflows/code-check.yml | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/code-check.yml diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml new file mode 100644 index 000000000..254576a60 --- /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