Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.function.Consumer;
import java.util.function.Predicate;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -699,6 +700,7 @@ public record AnthropicMessage(
* response.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlock(
// @formatter:off
@JsonProperty("type") Type type,
Expand Down Expand Up @@ -958,6 +960,7 @@ public record Tool(
* @param usage Input and output token usage.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ChatCompletionResponse(
// @formatter:off
@JsonProperty("id") String id,
Expand All @@ -980,6 +983,7 @@ public record ChatCompletionResponse(
* @param outputTokens The number of output tokens which were used. completion).
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record Usage(
// @formatter:off
@JsonProperty("input_tokens") Integer inputTokens,
Expand Down Expand Up @@ -1078,6 +1082,7 @@ public String toString() {
* @param contentBlock The content block body.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlockStartEvent(
// @formatter:off
@JsonProperty("type") EventType type,
Expand All @@ -1100,6 +1105,7 @@ public interface ContentBlockBody {
* @param input The tool use input.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlockToolUse(
@JsonProperty("type") String type,
@JsonProperty("id") String id,
Expand All @@ -1113,6 +1119,7 @@ public record ContentBlockToolUse(
* @param text The text content.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlockText(
@JsonProperty("type") String type,
@JsonProperty("text") String text) implements ContentBlockBody {
Expand All @@ -1130,6 +1137,7 @@ public record ContentBlockText(
* @param delta The content block delta body.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlockDeltaEvent(
// @formatter:off
@JsonProperty("type") EventType type,
Expand All @@ -1153,6 +1161,7 @@ public interface ContentBlockDeltaBody {
* @param text The text content.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlockDeltaText(
@JsonProperty("type") String type,
@JsonProperty("text") String text) implements ContentBlockDeltaBody {
Expand All @@ -1164,6 +1173,7 @@ public record ContentBlockDeltaText(
* @param partialJson The partial JSON content.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlockDeltaJson(
@JsonProperty("type") String type,
@JsonProperty("partial_json") String partialJson) implements ContentBlockDeltaBody {
Expand All @@ -1174,6 +1184,8 @@ public record ContentBlockDeltaJson(
* @param type The content block type.
* @param thinking The thinking content.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlockDeltaThinking(
@JsonProperty("type") String type,
@JsonProperty("thinking") String thinking) implements ContentBlockDeltaBody {
Expand All @@ -1184,6 +1196,8 @@ public record ContentBlockDeltaThinking(
* @param type The content block type.
* @param signature The signature content.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlockDeltaSignature(
@JsonProperty("type") String type,
@JsonProperty("signature") String signature) implements ContentBlockDeltaBody {
Expand All @@ -1200,6 +1214,7 @@ public record ContentBlockDeltaSignature(
* @param index The index of the content block.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ContentBlockStopEvent(
// @formatter:off
@JsonProperty("type") EventType type,
Expand All @@ -1214,6 +1229,7 @@ public record ContentBlockStopEvent(
* @param message The message body.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record MessageStartEvent(// @formatter:off
@JsonProperty("type") EventType type,
@JsonProperty("message") ChatCompletionResponse message) implements StreamEvent {
Expand All @@ -1228,6 +1244,7 @@ public record MessageStartEvent(// @formatter:off
* @param usage The message delta usage.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record MessageDeltaEvent(
// @formatter:off
@JsonProperty("type") EventType type,
Expand All @@ -1239,6 +1256,7 @@ public record MessageDeltaEvent(
* @param stopSequence The stop sequence.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record MessageDelta(
@JsonProperty("stop_reason") String stopReason,
@JsonProperty("stop_sequence") String stopSequence) {
Expand All @@ -1249,6 +1267,7 @@ public record MessageDelta(
* @param outputTokens The output tokens.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record MessageDeltaUsage(
@JsonProperty("output_tokens") Integer outputTokens) {
}
Expand All @@ -1261,6 +1280,7 @@ public record MessageDeltaUsage(
* @param type The event type.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record MessageStopEvent(
//@formatter:off
@JsonProperty("type") EventType type) implements StreamEvent {
Expand All @@ -1277,6 +1297,7 @@ public record MessageStopEvent(
* @param error The error body.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ErrorEvent(
// @formatter:off
@JsonProperty("type") EventType type,
Expand All @@ -1288,6 +1309,7 @@ public record ErrorEvent(
* @param message The error message.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record Error(
@JsonProperty("type") String type,
@JsonProperty("message") String message) {
Expand All @@ -1304,6 +1326,7 @@ public record Error(
* @param type The event type.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record PingEvent(
// @formatter:off
@JsonProperty("type") EventType type) implements StreamEvent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.nio.charset.StandardCharsets;
import java.time.Duration;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
Expand Down Expand Up @@ -331,6 +331,7 @@ protected Flux<SO> internalInvocationStream(I request, Class<SO> clazz) {
* @param invocationLatency The time in milliseconds between the request being sent and the response being received.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record AmazonBedrockInvocationMetrics(
@JsonProperty("inputTokenCount") Long inputTokenCount,
@JsonProperty("firstByteLatency") Long firstByteLatency,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.time.Duration;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -233,6 +234,7 @@ public enum Truncate {
* doesn't return invocationMetrics for the cohere embedding model.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record CohereEmbeddingResponse(@JsonProperty("id") String id,
@JsonProperty("embeddings") List<float[]> embeddings, @JsonProperty("texts") List<String> texts,
@JsonProperty("response_type") String responseType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.time.Duration;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -174,6 +175,7 @@ public TitanEmbeddingRequest build() {
* @param message No idea what this is.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record TitanEmbeddingResponse(
@JsonProperty("embedding") float[] embedding,
@JsonProperty("inputTextTokenCount") Integer inputTextTokenCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.util.function.Predicate;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down Expand Up @@ -654,6 +655,7 @@ public record ResponseFormat(
* {@link Role#ASSISTANT} role and null otherwise.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ChatCompletionMessage(
@JsonProperty("content") Object rawContent,
@JsonProperty("role") Role role,
Expand Down Expand Up @@ -719,6 +721,7 @@ public enum Role {
* images by adding multiple image_url content parts.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record MediaContent(
@JsonProperty("type") String type,
@JsonProperty("text") String text,
Expand Down Expand Up @@ -748,6 +751,7 @@ public MediaContent(ImageUrl imageUrl) {
* @param detail Specifies the detail level of the image.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ImageUrl(
@JsonProperty("url") String url,
@JsonProperty("detail") String detail) {
Expand All @@ -766,6 +770,7 @@ public ImageUrl(String url) {
* @param function The function definition.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ToolCall(
@JsonProperty("id") String id,
@JsonProperty("type") String type,
Expand All @@ -779,6 +784,7 @@ public record ToolCall(
* @param arguments The arguments that the model expects you to pass to the function.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ChatCompletionFunction(
@JsonProperty("name") String name,
@JsonProperty("arguments") String arguments) {
Expand All @@ -800,6 +806,7 @@ public record ChatCompletionFunction(
* @param usage Usage statistics for the completion request.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ChatCompletion(
@JsonProperty("id") String id,
@JsonProperty("choices") List<Choice> choices,
Expand All @@ -821,6 +828,7 @@ public record ChatCompletion(
* @param logprobs Log probability information for the choice.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record Choice(
@JsonProperty("finish_reason") ChatCompletionFinishReason finishReason,
@JsonProperty("index") Integer index,
Expand All @@ -829,6 +837,8 @@ public record Choice(
@JsonProperty("logprobs") LogProbs logprobs) {
}

@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record BaseResponse(
@JsonProperty("status_code") Long statusCode,
@JsonProperty("status_msg") String message
Expand All @@ -841,6 +851,7 @@ public record BaseResponse(
* @param content A list of message content tokens with log probability information.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record LogProbs(
@JsonProperty("content") List<Content> content) {

Expand All @@ -858,6 +869,7 @@ public record LogProbs(
* requested top_logprobs returned.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record Content(
@JsonProperty("token") String token,
@JsonProperty("logprob") Float logprob,
Expand All @@ -875,6 +887,7 @@ public record Content(
* text representation. Can be null if there is no bytes representation for the token.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record TopLogProbs(
@JsonProperty("token") String token,
@JsonProperty("logprob") Float logprob,
Expand All @@ -891,6 +904,7 @@ public record TopLogProbs(
* @param totalTokens Total number of tokens used in the request (prompt + completion).
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record Usage(
@JsonProperty("completion_tokens") Integer completionTokens,
@JsonProperty("prompt_tokens") Integer promptTokens,
Expand All @@ -912,6 +926,7 @@ public record Usage(
* @param object The object type, which is always 'chat.completion.chunk'.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ChatCompletionChunk(
@JsonProperty("id") String id,
@JsonProperty("choices") List<ChunkChoice> choices,
Expand All @@ -929,6 +944,7 @@ public record ChatCompletionChunk(
* @param logprobs Log probability information for the choice.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record ChunkChoice(
@JsonProperty("finish_reason") ChatCompletionFinishReason finishReason,
@JsonProperty("index") Integer index,
Expand Down Expand Up @@ -1021,6 +1037,7 @@ public EmbeddingRequest(List<String> texts, EmbeddingType type) {
* @param totalTokens Usage tokens the request.
*/
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public record EmbeddingList(
@JsonProperty("vectors") List<float[]> vectors,
@JsonProperty("model") String model,
Expand Down
Loading