Skip to content

Commit 7fe3b38

Browse files
committed
Fix checkstyle errors
1 parent 1c156e9 commit 7fe3b38

File tree

78 files changed

+562
-429
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+562
-429
lines changed

models/spring-ai-mistral-ai/src/main/java/org/springframework/ai/mistralai/MistralAiChatModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
import io.micrometer.observation.contextpropagation.ObservationThreadLocalAccessor;
3030
import org.slf4j.Logger;
3131
import org.slf4j.LoggerFactory;
32-
import org.springframework.ai.model.Media;
33-
import org.springframework.util.MimeType;
3432
import reactor.core.publisher.Flux;
3533
import reactor.core.publisher.Mono;
3634

@@ -62,6 +60,7 @@
6260
import org.springframework.ai.mistralai.api.MistralAiApi.ChatCompletionMessage.ToolCall;
6361
import org.springframework.ai.mistralai.api.MistralAiApi.ChatCompletionRequest;
6462
import org.springframework.ai.mistralai.metadata.MistralAiUsage;
63+
import org.springframework.ai.model.Media;
6564
import org.springframework.ai.model.ModelOptionsUtils;
6665
import org.springframework.ai.model.function.FunctionCallback;
6766
import org.springframework.ai.model.function.FunctionCallbackResolver;
@@ -71,6 +70,7 @@
7170
import org.springframework.retry.support.RetryTemplate;
7271
import org.springframework.util.Assert;
7372
import org.springframework.util.CollectionUtils;
73+
import org.springframework.util.MimeType;
7474

7575
/**
7676
* Represents a Mistral AI Chat Model.

models/spring-ai-mistral-ai/src/test/java/org/springframework/ai/mistralai/MistralAiChatModelIT.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@
1616

1717
package org.springframework.ai.mistralai;
1818

19+
import java.io.IOException;
20+
import java.net.URL;
21+
import java.util.ArrayList;
22+
import java.util.Arrays;
23+
import java.util.List;
24+
import java.util.Map;
25+
import java.util.stream.Collectors;
26+
1927
import org.junit.jupiter.api.Test;
2028
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
2129
import org.junit.jupiter.params.ParameterizedTest;
2230
import org.junit.jupiter.params.provider.ValueSource;
2331
import org.slf4j.Logger;
2432
import org.slf4j.LoggerFactory;
33+
import reactor.core.publisher.Flux;
34+
2535
import org.springframework.ai.chat.messages.AssistantMessage;
2636
import org.springframework.ai.chat.messages.Message;
2737
import org.springframework.ai.chat.messages.UserMessage;
@@ -46,15 +56,6 @@
4656
import org.springframework.core.io.ClassPathResource;
4757
import org.springframework.core.io.Resource;
4858
import org.springframework.util.MimeTypeUtils;
49-
import reactor.core.publisher.Flux;
50-
51-
import java.io.IOException;
52-
import java.net.URL;
53-
import java.util.ArrayList;
54-
import java.util.Arrays;
55-
import java.util.List;
56-
import java.util.Map;
57-
import java.util.stream.Collectors;
5859

5960
import static org.assertj.core.api.Assertions.assertThat;
6061

models/spring-ai-mistral-ai/src/test/java/org/springframework/ai/mistralai/api/tool/PaymentStatusFunctionCallingIT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.fasterxml.jackson.annotation.JsonProperty;
2525
import com.fasterxml.jackson.core.JsonProcessingException;
2626
import com.fasterxml.jackson.databind.ObjectMapper;
27-
import org.junit.jupiter.api.Disabled;
2827
import org.junit.jupiter.api.Test;
2928
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
3029
import org.slf4j.Logger;

models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -672,15 +672,15 @@ public record ChatResponse(
672672
}
673673

674674
public Duration getTotalDuration() {
675-
return (this.totalDuration() != null)? Duration.ofNanos(this.totalDuration()) : null;
675+
return (this.totalDuration() != null) ? Duration.ofNanos(this.totalDuration()) : null;
676676
}
677677

678678
public Duration getLoadDuration() {
679-
return (this.loadDuration() != null)? Duration.ofNanos(this.loadDuration()) : null;
679+
return (this.loadDuration() != null) ? Duration.ofNanos(this.loadDuration()) : null;
680680
}
681681

682682
public Duration getPromptEvalDuration() {
683-
return (this.promptEvalDuration() != null)? Duration.ofNanos(this.promptEvalDuration()) : null;
683+
return (this.promptEvalDuration() != null) ? Duration.ofNanos(this.promptEvalDuration()) : null;
684684
}
685685

686686
public Duration getEvalDuration() {

models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/api/OllamaApiHelper.java

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
/*
2-
* Copyright 2024 - 2024 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
2+
* Copyright 2024-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
1617
package org.springframework.ai.ollama.api;
1718

1819
import java.time.Instant;
@@ -28,6 +29,10 @@
2829
*/
2930
public final class OllamaApiHelper {
3031

32+
private OllamaApiHelper() {
33+
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
34+
}
35+
3136
/**
3237
* @param ollamaChatResponse the Ollama chat response chunk to check
3338
* @return true if the chunk is a streaming tool call.

models/spring-ai-ollama/src/main/java/org/springframework/ai/ollama/management/OllamaModelManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void pullModel(String modelName, PullModelStrategy pullModelStrategy) {
117117
logger.info("Pulling the '{}' model - Status: {}", modelName, progressResponses.get(progressResponses.size() - 1).status());
118118
}
119119
})
120-
.takeUntil(progressResponses ->
120+
.takeUntil(progressResponses ->
121121
progressResponses.get(0) != null && "success".equals(progressResponses.get(0).status()))
122122
.timeout(this.options.timeout())
123123
.retryWhen(Retry.backoff(this.options.maxRetries(), Duration.ofSeconds(5)))

models/spring-ai-ollama/src/test/java/org/springframework/ai/ollama/api/OllamaDurationFieldsTests.java

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
/*
2-
* Copyright 2024 - 2024 the original author or authors.
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* https://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
2+
* Copyright 2024-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
1617
package org.springframework.ai.ollama.api;
1718

1819
import com.fasterxml.jackson.core.JsonProcessingException;

models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiChatOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,15 @@ public void setN(Integer n) {
325325
}
326326

327327
public List<String> getOutputModalities() {
328-
return outputModalities;
328+
return this.outputModalities;
329329
}
330330

331331
public void setOutputModalities(List<String> modalities) {
332332
this.outputModalities = modalities;
333333
}
334334

335335
public AudioParameters getOutputAudio() {
336-
return outputAudio;
336+
return this.outputAudio;
337337
}
338338

339339
public void setOutputAudio(AudioParameters audio) {

models/spring-ai-openai/src/main/java/org/springframework/ai/openai/OpenAiImageOptions.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616

1717
package org.springframework.ai.openai;
1818

19+
import java.util.Objects;
20+
1921
import com.fasterxml.jackson.annotation.JsonInclude;
2022
import com.fasterxml.jackson.annotation.JsonProperty;
21-
import org.springframework.ai.image.ImageOptions;
2223

23-
import java.util.Objects;
24+
import org.springframework.ai.image.ImageOptions;
2425

2526
/**
2627
* OpenAI Image API options. OpenAiImageOptions.java

models/spring-ai-openai/src/main/java/org/springframework/ai/openai/api/OpenAiApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,7 @@ public enum AudioResponseFormat {
960960
@JsonProperty("mp3") MP3,
961961
/** FLAC format */
962962
@JsonProperty("flac") FLAC,
963-
/** OPUS format */
963+
/** OPUS format */
964964
@JsonProperty("opus") OPUS,
965965
/** PCM16 format */
966966
@JsonProperty("pcm16") PCM16,

0 commit comments

Comments
 (0)