Migrate Anthropic from Gson to Jackson (#1043)
This commit is contained in:
parent
cea41bd60a
commit
f00b48e961
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -9,6 +10,7 @@ import java.util.Map;
|
|||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
||||
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicContent {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -17,6 +18,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
@AllArgsConstructor
|
||||
@Builder(toBuilder = true)
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicCreateMessageRequest {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -9,6 +10,7 @@ import java.util.List;
|
|||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
||||
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicCreateMessageResponse {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -7,6 +8,7 @@ import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
|||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
||||
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicDelta {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -11,6 +12,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
@ToString
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicImageContent extends AnthropicMessageContent {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -9,6 +10,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
|
||||
@AllArgsConstructor
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicImageContentSource {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -15,6 +16,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicMessage {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -9,6 +10,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
|
||||
@EqualsAndHashCode
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public abstract class AnthropicMessageContent {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -9,6 +10,7 @@ import java.util.List;
|
|||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
||||
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicResponseMessage {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -7,6 +8,7 @@ import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
|||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
||||
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicStreamingData {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -11,6 +12,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
@ToString
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicTextContent extends AnthropicMessageContent {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -13,6 +14,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
@ToString
|
||||
@EqualsAndHashCode
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicTool {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -11,6 +12,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
@ToString
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicToolResultContent extends AnthropicMessageContent {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -16,6 +17,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
@ToString
|
||||
@EqualsAndHashCode
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicToolSchema {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -14,6 +15,7 @@ import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
|||
@ToString
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicToolUseContent extends AnthropicMessageContent {
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package dev.langchain4j.model.anthropic.internal.api;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies.SnakeCaseStrategy;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
|
@ -7,6 +8,7 @@ import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
|||
import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
|
||||
|
||||
@JsonInclude(NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonNaming(SnakeCaseStrategy.class)
|
||||
public class AnthropicUsage {
|
||||
|
||||
|
|
Loading…
Reference in New Issue