Skip to content

Commit 9386934

Browse files
committed
fixed lint error
Signed-off-by: “claudio-code” <[email protected]>
1 parent 36d0cdf commit 9386934

File tree

2 files changed

+19
-19
lines changed
  • models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic/api
  • spring-ai-model/src/main/java/org/springframework/ai/chat/messages

2 files changed

+19
-19
lines changed

models/spring-ai-anthropic/src/main/java/org/springframework/ai/anthropic/api/StreamHelper.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ public StreamEvent mergeToolUseEvents(StreamEvent previousEvent, StreamEvent eve
9090
ContentBlockToolUse cbToolUse = (ContentBlockToolUse) contentBlockStart.contentBlock();
9191

9292
return eventAggregator.withIndex(contentBlockStart.index())
93-
.withId(cbToolUse.id())
94-
.withName(cbToolUse.name())
95-
.appendPartialJson(""); // CB START always has empty JSON.
93+
.withId(cbToolUse.id())
94+
.withName(cbToolUse.name())
95+
.appendPartialJson(""); // CB START always has empty JSON.
9696
}
9797
}
9898
else if (event.type() == EventType.CONTENT_BLOCK_DELTA) {
9999
ContentBlockDeltaEvent contentBlockDelta = (ContentBlockDeltaEvent) event;
100100
if (ContentBlock.Type.INPUT_JSON_DELTA.getValue().equals(contentBlockDelta.delta().type())) {
101101
return eventAggregator
102-
.appendPartialJson(((ContentBlockDeltaJson) contentBlockDelta.delta()).partialJson());
102+
.appendPartialJson(((ContentBlockDeltaJson) contentBlockDelta.delta()).partialJson());
103103
}
104104
}
105105
else if (event.type() == EventType.CONTENT_BLOCK_STOP) {
@@ -121,7 +121,7 @@ else if (event.type() == EventType.CONTENT_BLOCK_STOP) {
121121
* @return A ChatCompletionResponse representing the processed chunk.
122122
*/
123123
public ChatCompletionResponse eventToChatCompletionResponse(StreamEvent event,
124-
AtomicReference<ChatCompletionResponseBuilder> contentBlockReference) {
124+
AtomicReference<ChatCompletionResponseBuilder> contentBlockReference) {
125125

126126
// https://docs.anthropic.com/claude/reference/messages-streaming
127127

@@ -131,22 +131,22 @@ public ChatCompletionResponse eventToChatCompletionResponse(StreamEvent event,
131131
MessageStartEvent messageStartEvent = (MessageStartEvent) event;
132132

133133
contentBlockReference.get()
134-
.withType(event.type().name())
135-
.withId(messageStartEvent.message().id())
136-
.withRole(messageStartEvent.message().role())
137-
.withModel(messageStartEvent.message().model())
138-
.withUsage(messageStartEvent.message().usage())
139-
.withContent(new ArrayList<>());
134+
.withType(event.type().name())
135+
.withId(messageStartEvent.message().id())
136+
.withRole(messageStartEvent.message().role())
137+
.withModel(messageStartEvent.message().model())
138+
.withUsage(messageStartEvent.message().usage())
139+
.withContent(new ArrayList<>());
140140
}
141141
else if (event.type().equals(EventType.TOOL_USE_AGGREGATE)) {
142142
ToolUseAggregationEvent eventToolUseBuilder = (ToolUseAggregationEvent) event;
143143

144144
if (!CollectionUtils.isEmpty(eventToolUseBuilder.getToolContentBlocks())) {
145145

146146
List<ContentBlock> content = eventToolUseBuilder.getToolContentBlocks()
147-
.stream()
148-
.map(tooToUse -> new ContentBlock(Type.TOOL_USE, tooToUse.id(), tooToUse.name(), tooToUse.input()))
149-
.toList();
147+
.stream()
148+
.map(tooToUse -> new ContentBlock(Type.TOOL_USE, tooToUse.id(), tooToUse.name(), tooToUse.input()))
149+
.toList();
150150
contentBlockReference.get().withContent(content);
151151
}
152152
}
@@ -216,10 +216,10 @@ else if (event.type().equals(EventType.MESSAGE_STOP)) {
216216
// with an updated event type and general information like: model, message
217217
// type, id and usage
218218
contentBlockReference.get()
219-
.withType(event.type().name())
220-
.withContent(List.of())
221-
.withStopReason(null)
222-
.withStopSequence(null);
219+
.withType(event.type().name())
220+
.withContent(List.of())
221+
.withStopReason(null)
222+
.withStopSequence(null);
223223
}
224224
else {
225225
// Any other event types that should propagate upwards without content

spring-ai-model/src/main/java/org/springframework/ai/chat/messages/UserMessage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public UserMessage(String textContent, String cache) {
4545
}
4646

4747
public UserMessage(MessageType messageType, String textContent, Collection<Media> media,
48-
Map<String, Object> metadata, String cache) {
48+
Map<String, Object> metadata, String cache) {
4949
super(messageType, textContent, metadata, cache);
5050
Assert.notNull(media, "media data must not be null");
5151
this.media = new ArrayList<>(media);

0 commit comments

Comments
 (0)