Skip to content

Commit f17ee20

Browse files
committed
fixed merge with main
1 parent 7422708 commit f17ee20

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed

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

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@
5555
import org.springframework.web.reactive.function.client.WebClient;
5656

5757
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
58-
import com.fasterxml.jackson.annotation.JsonInclude;
59-
import com.fasterxml.jackson.annotation.JsonInclude.Include;
60-
import com.fasterxml.jackson.annotation.JsonProperty;
61-
import com.fasterxml.jackson.annotation.JsonSubTypes;
62-
import com.fasterxml.jackson.annotation.JsonTypeInfo;
63-
64-
import reactor.core.publisher.Flux;
65-
import reactor.core.publisher.Mono;
6658

6759
/**
6860
* The Anthropic API client.
@@ -777,9 +769,9 @@ public record ContentBlock(
777769
@JsonProperty("content") String content,
778770

779771
// cache object
780-
@JsonProperty("cache_control") CacheControl cacheControl
772+
@JsonProperty("cache_control") CacheControl cacheControl,
781773

782-
// Thinking only
774+
// Thinking only
783775
@JsonProperty("signature") String signature,
784776
@JsonProperty("thinking") String thinking,
785777

@@ -819,11 +811,11 @@ public ContentBlock(Source source) {
819811
* @param text The text of the content.
820812
*/
821813
public ContentBlock(String text) {
822-
this(Type.TEXT, null, text, null, null, null, null, null, null, null);
814+
this(Type.TEXT, null, text, null, null, null, null, null, null, null, null, null, null);
823815
}
824816

825817
public ContentBlock(String text, CacheControl cache) {
826-
this(Type.TEXT, null, text, null, null, null, null, null, null, cache null, null);
818+
this(Type.TEXT, null, text, null, null, null, null, null, null, cache, null, null, null);
827819
}
828820

829821
// Tool result

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ else if (event.type().equals(EventType.CONTENT_BLOCK_START)) {
159159
}
160160
else if (contentBlockStartEvent.contentBlock() instanceof ContentBlockThinking thinkingBlock) {
161161
ContentBlock cb = new ContentBlock(Type.THINKING, null, null, contentBlockStartEvent.index(), null,
162-
null, null, null, null, null, thinkingBlock.thinking(), null);
162+
null, null, null, null, null, null, thinkingBlock.thinking(), null);
163163
contentBlockReference.get().withType(event.type().name()).withContent(List.of(cb));
164164
}
165165
else {
@@ -176,12 +176,12 @@ else if (event.type().equals(EventType.CONTENT_BLOCK_DELTA)) {
176176
}
177177
else if (contentBlockDeltaEvent.delta() instanceof ContentBlockDeltaThinking thinking) {
178178
ContentBlock cb = new ContentBlock(Type.THINKING_DELTA, null, null, contentBlockDeltaEvent.index(),
179-
null, null, null, null, null, null, thinking.thinking(), null);
179+
null, null, null, null, null, null,null, thinking.thinking(), null);
180180
contentBlockReference.get().withType(event.type().name()).withContent(List.of(cb));
181181
}
182182
else if (contentBlockDeltaEvent.delta() instanceof ContentBlockDeltaSignature sig) {
183183
ContentBlock cb = new ContentBlock(Type.SIGNATURE_DELTA, null, null, contentBlockDeltaEvent.index(),
184-
null, null, null, null, null, sig.signature(), null, null);
184+
null, null, null, null, null, null, sig.signature(), null, null);
185185
contentBlockReference.get().withType(event.type().name()).withContent(List.of(cb));
186186
}
187187
else {

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public UserMessage(Resource resource, String cache) {
6565
}
6666

6767
public UserMessage(String textContent, List<Media> media) {
68-
this(MessageType.USER, textContent, media, Map.of());
68+
this(MessageType.USER, textContent, media, Map.of(), null);
6969
}
7070

7171
@Override
@@ -100,12 +100,6 @@ public List<Media> getMedia(String... dummy) {
100100
return this.media;
101101
}
102102

103-
@Override
104-
public String toString() {
105-
return "UserMessage{" + "content='" + getText() + '\'' + ", properties=" + this.metadata + ", messageType="
106-
+ this.messageType + '}';
107-
}
108-
109103
public Builder mutate() {
110104
return new Builder().text(getText()).media(List.copyOf(getMedia())).metadata(Map.copyOf(getMetadata()));
111105
}

0 commit comments

Comments
 (0)