diff --git a/README.md b/README.md index 38a88f8..7a01ce4 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ The official Java library for accessing ModelArk on Volcengine and BytePlus. It com.volcengine ark-runtime - 0.15.0 + 0.16.0 ``` ### Gradle ```groovy -implementation 'com.volcengine:ark-runtime:0.15.0' +implementation 'com.volcengine:ark-runtime:0.16.0' ``` ## Choose Volcengine or BytePlus diff --git a/VERSION b/VERSION index a551051..04a373e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.15.0 +0.16.0 diff --git a/pom.xml b/pom.xml index bcbabe3..2a643e6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.volcengine ark-runtime - 0.15.0 + 0.16.0 jar ark-runtime diff --git a/src/main/java/com/volcengine/ark/runtime/models/audio_generation/AudioURL.java b/src/main/java/com/volcengine/ark/runtime/models/audio_generation/AudioURL.java index 727066d..169654e 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/audio_generation/AudioURL.java +++ b/src/main/java/com/volcengine/ark/runtime/models/audio_generation/AudioURL.java @@ -43,7 +43,7 @@ public AudioURL url(@javax.annotation.Nonnull String url) { } /** - * Public HTTP(S) URL, speaker://<id>, file://<file_id> for registered reference audio, or data:audio/{wav,mp3};base64,<payload>. Decoded base64 audio is limited to 15 MiB for reference generation; separation uses a 90 MiB source-audio limit. A speaker reference cannot be used for separation. + * Public HTTP(S) URL, speaker://<id> for a preset speaker, file://<file_id> for a custom voice registered through the Files API, or data:audio/{wav,mp3};base64,<payload>. Voice-cloning speaker IDs are not supported. Decoded base64 audio is limited to 15 MiB for reference generation; separation uses a 90 MiB source-audio limit. A speaker reference cannot be used for separation. * @return url */ @javax.annotation.Nonnull diff --git a/src/main/java/com/volcengine/ark/runtime/models/audio_generation/VideoURL.java b/src/main/java/com/volcengine/ark/runtime/models/audio_generation/VideoURL.java index 81d5f9d..e53a258 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/audio_generation/VideoURL.java +++ b/src/main/java/com/volcengine/ark/runtime/models/audio_generation/VideoURL.java @@ -43,7 +43,7 @@ public VideoURL url(@javax.annotation.Nonnull String url) { } /** - * Public HTTP(S) URL or tos://<bucket>/<key>. Base64 and speaker references are not supported. Media properties and size are validated by the server. + * Public HTTP(S) URL or tos://<bucket>/<key>. Supported video resolutions: 360p, 480p, 720p and 1080p; minimum total pixel count (width * height): 172800. Base64 and speaker references are not supported. Media properties and size are validated by the server. * @return url */ @javax.annotation.Nonnull diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/FunctionTool.java b/src/main/java/com/volcengine/ark/runtime/models/responses/FunctionTool.java index 6b3dbed..dd6dc9a 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/responses/FunctionTool.java +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/FunctionTool.java @@ -30,10 +30,11 @@ FunctionTool.JSON_PROPERTY_NAME, FunctionTool.JSON_PROPERTY_PARAMETERS, FunctionTool.JSON_PROPERTY_TYPE, - FunctionTool.JSON_PROPERTY_DESCRIPTION + FunctionTool.JSON_PROPERTY_DESCRIPTION, + FunctionTool.JSON_PROPERTY_DEFER_LOADING }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") -public class FunctionTool implements Tool { +public class FunctionTool implements Tool, ToolSearchResultTool { public static final String JSON_PROPERTY_NAME = "name"; @javax.annotation.Nonnull private String name; @@ -50,6 +51,10 @@ public class FunctionTool implements Tool { @javax.annotation.Nullable private String description; + public static final String JSON_PROPERTY_DEFER_LOADING = "defer_loading"; + @javax.annotation.Nullable + private Boolean deferLoading; + public FunctionTool() { } @@ -161,6 +166,31 @@ public void setDescription(@javax.annotation.Nullable String description) { this.description = description; } + public FunctionTool deferLoading(@javax.annotation.Nullable Boolean deferLoading) { + + this.deferLoading = deferLoading; + return this; + } + + /** + * Defer the full schema until tool_search loads this function. Defaults to false. + * @return deferLoading + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DEFER_LOADING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDeferLoading() { + return deferLoading; + } + + + @JsonProperty(value = JSON_PROPERTY_DEFER_LOADING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeferLoading(@javax.annotation.Nullable Boolean deferLoading) { + this.deferLoading = deferLoading; + } + @Override public boolean equals(Object o) { @@ -174,12 +204,13 @@ public boolean equals(Object o) { return Objects.equals(this.name, functionTool.name) && Objects.equals(this.parameters, functionTool.parameters) && Objects.equals(this.type, functionTool.type) && - Objects.equals(this.description, functionTool.description); + Objects.equals(this.description, functionTool.description) && + Objects.equals(this.deferLoading, functionTool.deferLoading); } @Override public int hashCode() { - return Objects.hash(name, parameters, type, description); + return Objects.hash(name, parameters, type, description, deferLoading); } @Override @@ -190,6 +221,7 @@ public String toString() { sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" deferLoading: ").append(toIndentedString(deferLoading)).append("\n"); sb.append("}"); return sb.toString(); } @@ -230,6 +262,10 @@ public FunctionTool.Builder description(String description) { this.instance.description = description; return this; } + public FunctionTool.Builder deferLoading(Boolean deferLoading) { + this.instance.deferLoading = deferLoading; + return this; + } /** @@ -267,7 +303,8 @@ public FunctionTool.Builder toBuilder() { .name(getName()) .parameters(getParameters()) .type(getType()) - .description(getDescription()); + .description(getDescription()) + .deferLoading(getDeferLoading()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/InputItem.java b/src/main/java/com/volcengine/ark/runtime/models/responses/InputItem.java index 9079259..3d58534 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/responses/InputItem.java +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/InputItem.java @@ -30,6 +30,8 @@ @JsonSubTypes.Type(value = ItemFunctionMcpListTools.class, name = "mcp_list_tools"), @JsonSubTypes.Type(value = ItemEasyMessage.class, name = "message"), @JsonSubTypes.Type(value = ItemReasoning.class, name = "reasoning"), + @JsonSubTypes.Type(value = ItemToolSearchCall.class, name = "tool_search_call"), + @JsonSubTypes.Type(value = ItemToolSearchOutput.class, name = "tool_search_output"), }) @com.volcengine.ark.runtime.utils.UnknownVariantFallback(UnknownInputItem.class) diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/ItemFunctionToolCall.java b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemFunctionToolCall.java index c29f45a..7bdb3c8 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/responses/ItemFunctionToolCall.java +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemFunctionToolCall.java @@ -30,6 +30,7 @@ ItemFunctionToolCall.JSON_PROPERTY_ARGUMENTS, ItemFunctionToolCall.JSON_PROPERTY_CALL_ID, ItemFunctionToolCall.JSON_PROPERTY_NAME, + ItemFunctionToolCall.JSON_PROPERTY_NAMESPACE, ItemFunctionToolCall.JSON_PROPERTY_STATUS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") @@ -54,6 +55,10 @@ public class ItemFunctionToolCall implements InputItem, OutputItem { @javax.annotation.Nullable private String name; + public static final String JSON_PROPERTY_NAMESPACE = "namespace"; + @javax.annotation.Nullable + private String namespace; + public static final String JSON_PROPERTY_STATUS = "status"; @javax.annotation.Nullable private ItemStatus status; @@ -186,6 +191,31 @@ public void setName(@javax.annotation.Nullable String name) { this.name = name; } + public ItemFunctionToolCall namespace(@javax.annotation.Nullable String namespace) { + + this.namespace = namespace; + return this; + } + + /** + * Namespace of the called function, omitted for top-level functions. + * @return namespace + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAMESPACE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNamespace() { + return namespace; + } + + + @JsonProperty(value = JSON_PROPERTY_NAMESPACE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespace(@javax.annotation.Nullable String namespace) { + this.namespace = namespace; + } + public ItemFunctionToolCall status(@javax.annotation.Nullable ItemStatus status) { this.status = status; @@ -226,12 +256,13 @@ public boolean equals(Object o) { Objects.equals(this.arguments, itemFunctionToolCall.arguments) && Objects.equals(this.callId, itemFunctionToolCall.callId) && Objects.equals(this.name, itemFunctionToolCall.name) && + Objects.equals(this.namespace, itemFunctionToolCall.namespace) && Objects.equals(this.status, itemFunctionToolCall.status); } @Override public int hashCode() { - return Objects.hash(id, type, arguments, callId, name, status); + return Objects.hash(id, type, arguments, callId, name, namespace, status); } @Override @@ -243,6 +274,7 @@ public String toString() { sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); sb.append(" callId: ").append(toIndentedString(callId)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append("}"); return sb.toString(); @@ -288,6 +320,10 @@ public ItemFunctionToolCall.Builder name(String name) { this.instance.name = name; return this; } + public ItemFunctionToolCall.Builder namespace(String namespace) { + this.instance.namespace = namespace; + return this; + } public ItemFunctionToolCall.Builder status(ItemStatus status) { this.instance.status = status; return this; @@ -331,6 +367,7 @@ public ItemFunctionToolCall.Builder toBuilder() { .arguments(getArguments()) .callId(getCallId()) .name(getName()) + .namespace(getNamespace()) .status(getStatus()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/ItemFunctionToolCallOutput.java b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemFunctionToolCallOutput.java index a84a54d..c50fefd 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/responses/ItemFunctionToolCallOutput.java +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemFunctionToolCallOutput.java @@ -25,6 +25,7 @@ * ItemFunctionToolCallOutput */ @JsonPropertyOrder({ + ItemFunctionToolCallOutput.JSON_PROPERTY_NAMESPACE, ItemFunctionToolCallOutput.JSON_PROPERTY_TYPE, ItemFunctionToolCallOutput.JSON_PROPERTY_CALL_ID, ItemFunctionToolCallOutput.JSON_PROPERTY_OUTPUT, @@ -33,6 +34,10 @@ }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class ItemFunctionToolCallOutput implements InputItem { + public static final String JSON_PROPERTY_NAMESPACE = "namespace"; + @javax.annotation.Nullable + private String namespace; + public static final String JSON_PROPERTY_TYPE = "type"; @javax.annotation.Nonnull private ItemType type = ItemType.FUNCTION_CALL_OUTPUT; @@ -56,6 +61,31 @@ public class ItemFunctionToolCallOutput implements InputItem { public ItemFunctionToolCallOutput() { } + public ItemFunctionToolCallOutput namespace(@javax.annotation.Nullable String namespace) { + + this.namespace = namespace; + return this; + } + + /** + * Namespace of the function whose result is being supplied. + * @return namespace + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_NAMESPACE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getNamespace() { + return namespace; + } + + + @JsonProperty(value = JSON_PROPERTY_NAMESPACE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespace(@javax.annotation.Nullable String namespace) { + this.namespace = namespace; + } + public ItemFunctionToolCallOutput type(@javax.annotation.Nonnull ItemType type) { this.type = type; @@ -191,7 +221,8 @@ public boolean equals(Object o) { return false; } ItemFunctionToolCallOutput itemFunctionToolCallOutput = (ItemFunctionToolCallOutput) o; - return Objects.equals(this.type, itemFunctionToolCallOutput.type) && + return Objects.equals(this.namespace, itemFunctionToolCallOutput.namespace) && + Objects.equals(this.type, itemFunctionToolCallOutput.type) && Objects.equals(this.callId, itemFunctionToolCallOutput.callId) && Objects.equals(this.output, itemFunctionToolCallOutput.output) && Objects.equals(this.id, itemFunctionToolCallOutput.id) && @@ -200,13 +231,14 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(type, callId, output, id, status); + return Objects.hash(namespace, type, callId, output, id, status); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ItemFunctionToolCallOutput {\n"); + sb.append(" namespace: ").append(toIndentedString(namespace)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" callId: ").append(toIndentedString(callId)).append("\n"); sb.append(" output: ").append(toIndentedString(output)).append("\n"); @@ -236,6 +268,10 @@ protected Builder(ItemFunctionToolCallOutput instance) { this.instance = instance; } + public ItemFunctionToolCallOutput.Builder namespace(String namespace) { + this.instance.namespace = namespace; + return this; + } public ItemFunctionToolCallOutput.Builder type(ItemType type) { this.instance.type = type; return this; @@ -290,6 +326,7 @@ public static ItemFunctionToolCallOutput.Builder builder() { */ public ItemFunctionToolCallOutput.Builder toBuilder() { return new ItemFunctionToolCallOutput.Builder() + .namespace(getNamespace()) .type(getType()) .callId(getCallId()) .output(getOutput()) diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/ItemToolSearchCall.java b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemToolSearchCall.java new file mode 100644 index 0000000..3417f5e --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemToolSearchCall.java @@ -0,0 +1,344 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Responses API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.responses; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Map; +import java.util.Objects; + +/** + * ItemToolSearchCall + */ +@JsonPropertyOrder({ + ItemToolSearchCall.JSON_PROPERTY_TYPE, + ItemToolSearchCall.JSON_PROPERTY_ID, + ItemToolSearchCall.JSON_PROPERTY_STATUS, + ItemToolSearchCall.JSON_PROPERTY_ARGUMENTS, + ItemToolSearchCall.JSON_PROPERTY_CALL_ID, + ItemToolSearchCall.JSON_PROPERTY_EXECUTION +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ItemToolSearchCall implements InputItem, OutputItem { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ItemType type = ItemType.TOOL_SEARCH_CALL; + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable + private String id; + + public static final String JSON_PROPERTY_STATUS = "status"; + @javax.annotation.Nullable + private ItemStatus status; + + public static final String JSON_PROPERTY_ARGUMENTS = "arguments"; + @javax.annotation.Nonnull + private Map arguments; + + public static final String JSON_PROPERTY_CALL_ID = "call_id"; + @javax.annotation.Nullable + private String callId; + + public static final String JSON_PROPERTY_EXECUTION = "execution"; + @javax.annotation.Nullable + private ToolSearchExecution execution; + + public ItemToolSearchCall() { + } + + public ItemToolSearchCall type(@javax.annotation.Nonnull ItemType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ItemType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ItemType type) { + this.type = type; + } + + public ItemToolSearchCall id(@javax.annotation.Nullable String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + public ItemToolSearchCall status(@javax.annotation.Nullable ItemStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ItemStatus getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@javax.annotation.Nullable ItemStatus status) { + this.status = status; + } + + public ItemToolSearchCall arguments(@javax.annotation.Nonnull Map arguments) { + + this.arguments = arguments; + return this; + } + + public ItemToolSearchCall putArgumentsItem(String key, Object argumentsItem) { + this.arguments.put(key, argumentsItem); + return this; + } + + /** + * JSON object (not an encoded string). Completed calls contain a nonempty paths array; added streaming items initially contain {}. + * @return arguments + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ARGUMENTS, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + + public Map getArguments() { + return arguments; + } + + + @JsonProperty(value = JSON_PROPERTY_ARGUMENTS, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setArguments(@javax.annotation.Nonnull Map arguments) { + this.arguments = arguments; + } + + public ItemToolSearchCall callId(@javax.annotation.Nullable String callId) { + + this.callId = callId; + return this; + } + + /** + * Get callId + * @return callId + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CALL_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallId() { + return callId; + } + + + @JsonProperty(value = JSON_PROPERTY_CALL_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallId(@javax.annotation.Nullable String callId) { + this.callId = callId; + } + + public ItemToolSearchCall execution(@javax.annotation.Nullable ToolSearchExecution execution) { + + this.execution = execution; + return this; + } + + /** + * Hosted search emits server. Omitted or empty execution defaults to server when replaying history. Client history is not supported. + * @return execution + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXECUTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ToolSearchExecution getExecution() { + return execution; + } + + + @JsonProperty(value = JSON_PROPERTY_EXECUTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExecution(@javax.annotation.Nullable ToolSearchExecution execution) { + this.execution = execution; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemToolSearchCall itemToolSearchCall = (ItemToolSearchCall) o; + return Objects.equals(this.type, itemToolSearchCall.type) && + Objects.equals(this.id, itemToolSearchCall.id) && + Objects.equals(this.status, itemToolSearchCall.status) && + Objects.equals(this.arguments, itemToolSearchCall.arguments) && + Objects.equals(this.callId, itemToolSearchCall.callId) && + Objects.equals(this.execution, itemToolSearchCall.execution); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, status, arguments, callId, execution); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemToolSearchCall {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" arguments: ").append(toIndentedString(arguments)).append("\n"); + sb.append(" callId: ").append(toIndentedString(callId)).append("\n"); + sb.append(" execution: ").append(toIndentedString(execution)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ItemToolSearchCall instance; + + public Builder() { + this(new ItemToolSearchCall()); + } + + protected Builder(ItemToolSearchCall instance) { + this.instance = instance; + } + + public ItemToolSearchCall.Builder type(ItemType type) { + this.instance.type = type; + return this; + } + public ItemToolSearchCall.Builder id(String id) { + this.instance.id = id; + return this; + } + public ItemToolSearchCall.Builder status(ItemStatus status) { + this.instance.status = status; + return this; + } + public ItemToolSearchCall.Builder arguments(Map arguments) { + this.instance.arguments = arguments; + return this; + } + public ItemToolSearchCall.Builder callId(String callId) { + this.instance.callId = callId; + return this; + } + public ItemToolSearchCall.Builder execution(ToolSearchExecution execution) { + this.instance.execution = execution; + return this; + } + + + /** + * returns a built ItemToolSearchCall instance. + * + * The builder is not reusable. + */ + public ItemToolSearchCall build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ItemToolSearchCall.Builder builder() { + return new ItemToolSearchCall.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ItemToolSearchCall.Builder toBuilder() { + return new ItemToolSearchCall.Builder() + .type(getType()) + .id(getId()) + .status(getStatus()) + .arguments(getArguments()) + .callId(getCallId()) + .execution(getExecution()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/ItemToolSearchOutput.java b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemToolSearchOutput.java new file mode 100644 index 0000000..b299b85 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemToolSearchOutput.java @@ -0,0 +1,348 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Responses API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.responses; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * ItemToolSearchOutput + */ +@JsonPropertyOrder({ + ItemToolSearchOutput.JSON_PROPERTY_TYPE, + ItemToolSearchOutput.JSON_PROPERTY_ID, + ItemToolSearchOutput.JSON_PROPERTY_STATUS, + ItemToolSearchOutput.JSON_PROPERTY_CALL_ID, + ItemToolSearchOutput.JSON_PROPERTY_EXECUTION, + ItemToolSearchOutput.JSON_PROPERTY_TOOLS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ItemToolSearchOutput implements InputItem, OutputItem { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ItemType type = ItemType.TOOL_SEARCH_OUTPUT; + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nullable + private String id; + + public static final String JSON_PROPERTY_STATUS = "status"; + @javax.annotation.Nullable + private ItemStatus status; + + public static final String JSON_PROPERTY_CALL_ID = "call_id"; + @javax.annotation.Nullable + private String callId; + + public static final String JSON_PROPERTY_EXECUTION = "execution"; + @javax.annotation.Nullable + private ToolSearchExecution execution; + + public static final String JSON_PROPERTY_TOOLS = "tools"; + @javax.annotation.Nonnull + private List tools; + + public ItemToolSearchOutput() { + } + + public ItemToolSearchOutput type(@javax.annotation.Nonnull ItemType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ItemType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ItemType type) { + this.type = type; + } + + public ItemToolSearchOutput id(@javax.annotation.Nullable String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + public ItemToolSearchOutput status(@javax.annotation.Nullable ItemStatus status) { + + this.status = status; + return this; + } + + /** + * Get status + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ItemStatus getStatus() { + return status; + } + + + @JsonProperty(value = JSON_PROPERTY_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(@javax.annotation.Nullable ItemStatus status) { + this.status = status; + } + + public ItemToolSearchOutput callId(@javax.annotation.Nullable String callId) { + + this.callId = callId; + return this; + } + + /** + * Get callId + * @return callId + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CALL_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCallId() { + return callId; + } + + + @JsonProperty(value = JSON_PROPERTY_CALL_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCallId(@javax.annotation.Nullable String callId) { + this.callId = callId; + } + + public ItemToolSearchOutput execution(@javax.annotation.Nullable ToolSearchExecution execution) { + + this.execution = execution; + return this; + } + + /** + * Hosted search emits server; omitted or empty execution defaults to server on replay. + * @return execution + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXECUTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ToolSearchExecution getExecution() { + return execution; + } + + + @JsonProperty(value = JSON_PROPERTY_EXECUTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExecution(@javax.annotation.Nullable ToolSearchExecution execution) { + this.execution = execution; + } + + public ItemToolSearchOutput tools(@javax.annotation.Nonnull List tools) { + + this.tools = tools; + return this; + } + + public ItemToolSearchOutput addToolsItem(ToolSearchResultTool toolsItem) { + if (this.tools == null) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + return this; + } + + /** + * Loaded definitions, including their complete parameter schemas. Replayed history requires a nonempty list following the corresponding search call. + * @return tools + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TOOLS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTools() { + return tools; + } + + + @JsonProperty(value = JSON_PROPERTY_TOOLS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTools(@javax.annotation.Nonnull List tools) { + this.tools = tools; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemToolSearchOutput itemToolSearchOutput = (ItemToolSearchOutput) o; + return Objects.equals(this.type, itemToolSearchOutput.type) && + Objects.equals(this.id, itemToolSearchOutput.id) && + Objects.equals(this.status, itemToolSearchOutput.status) && + Objects.equals(this.callId, itemToolSearchOutput.callId) && + Objects.equals(this.execution, itemToolSearchOutput.execution) && + Objects.equals(this.tools, itemToolSearchOutput.tools); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, status, callId, execution, tools); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemToolSearchOutput {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" callId: ").append(toIndentedString(callId)).append("\n"); + sb.append(" execution: ").append(toIndentedString(execution)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ItemToolSearchOutput instance; + + public Builder() { + this(new ItemToolSearchOutput()); + } + + protected Builder(ItemToolSearchOutput instance) { + this.instance = instance; + } + + public ItemToolSearchOutput.Builder type(ItemType type) { + this.instance.type = type; + return this; + } + public ItemToolSearchOutput.Builder id(String id) { + this.instance.id = id; + return this; + } + public ItemToolSearchOutput.Builder status(ItemStatus status) { + this.instance.status = status; + return this; + } + public ItemToolSearchOutput.Builder callId(String callId) { + this.instance.callId = callId; + return this; + } + public ItemToolSearchOutput.Builder execution(ToolSearchExecution execution) { + this.instance.execution = execution; + return this; + } + public ItemToolSearchOutput.Builder tools(List tools) { + this.instance.tools = tools; + return this; + } + + + /** + * returns a built ItemToolSearchOutput instance. + * + * The builder is not reusable. + */ + public ItemToolSearchOutput build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ItemToolSearchOutput.Builder builder() { + return new ItemToolSearchOutput.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ItemToolSearchOutput.Builder toBuilder() { + return new ItemToolSearchOutput.Builder() + .type(getType()) + .id(getId()) + .status(getStatus()) + .callId(getCallId()) + .execution(getExecution()) + .tools(getTools()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/ItemType.java b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemType.java index b4b4af9..c529c36 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/responses/ItemType.java +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/ItemType.java @@ -52,6 +52,10 @@ public enum ItemType { REASONING("reasoning"), + TOOL_SEARCH_CALL("tool_search_call"), + + TOOL_SEARCH_OUTPUT("tool_search_output"), + TRANSCRIPTION("transcription"), WEB_SEARCH_CALL("web_search_call"); diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/NamespaceTool.java b/src/main/java/com/volcengine/ark/runtime/models/responses/NamespaceTool.java new file mode 100644 index 0000000..a844a7d --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/NamespaceTool.java @@ -0,0 +1,274 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Responses API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.responses; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * NamespaceTool + */ +@JsonPropertyOrder({ + NamespaceTool.JSON_PROPERTY_TYPE, + NamespaceTool.JSON_PROPERTY_NAME, + NamespaceTool.JSON_PROPERTY_DESCRIPTION, + NamespaceTool.JSON_PROPERTY_TOOLS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class NamespaceTool implements Tool, ToolSearchResultTool { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ToolType type = ToolType.NAMESPACE; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @javax.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_TOOLS = "tools"; + @javax.annotation.Nonnull + private List tools; + + public NamespaceTool() { + } + + public NamespaceTool type(@javax.annotation.Nonnull ToolType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ToolType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ToolType type) { + this.type = type; + } + + public NamespaceTool name(@javax.annotation.Nonnull String name) { + + this.name = name; + return this; + } + + /** + * Namespace used to qualify function calls. + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + @JsonProperty(value = JSON_PROPERTY_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + public NamespaceTool description(@javax.annotation.Nullable String description) { + + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + public NamespaceTool tools(@javax.annotation.Nonnull List tools) { + + this.tools = tools; + return this; + } + + public NamespaceTool addToolsItem(FunctionTool toolsItem) { + if (this.tools == null) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + return this; + } + + /** + * Functions in this namespace. Nested namespaces are not supported. + * @return tools + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TOOLS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getTools() { + return tools; + } + + + @JsonProperty(value = JSON_PROPERTY_TOOLS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTools(@javax.annotation.Nonnull List tools) { + this.tools = tools; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NamespaceTool namespaceTool = (NamespaceTool) o; + return Objects.equals(this.type, namespaceTool.type) && + Objects.equals(this.name, namespaceTool.name) && + Objects.equals(this.description, namespaceTool.description) && + Objects.equals(this.tools, namespaceTool.tools); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, description, tools); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NamespaceTool {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private NamespaceTool instance; + + public Builder() { + this(new NamespaceTool()); + } + + protected Builder(NamespaceTool instance) { + this.instance = instance; + } + + public NamespaceTool.Builder type(ToolType type) { + this.instance.type = type; + return this; + } + public NamespaceTool.Builder name(String name) { + this.instance.name = name; + return this; + } + public NamespaceTool.Builder description(String description) { + this.instance.description = description; + return this; + } + public NamespaceTool.Builder tools(List tools) { + this.instance.tools = tools; + return this; + } + + + /** + * returns a built NamespaceTool instance. + * + * The builder is not reusable. + */ + public NamespaceTool build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NamespaceTool.Builder builder() { + return new NamespaceTool.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NamespaceTool.Builder toBuilder() { + return new NamespaceTool.Builder() + .type(getType()) + .name(getName()) + .description(getDescription()) + .tools(getTools()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/OutputItem.java b/src/main/java/com/volcengine/ark/runtime/models/responses/OutputItem.java index a6afedd..8d63007 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/responses/OutputItem.java +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/OutputItem.java @@ -32,6 +32,8 @@ @JsonSubTypes.Type(value = ItemFunctionMcpListTools.class, name = "mcp_list_tools"), @JsonSubTypes.Type(value = ItemOutputMessage.class, name = "message"), @JsonSubTypes.Type(value = ItemReasoning.class, name = "reasoning"), + @JsonSubTypes.Type(value = ItemToolSearchCall.class, name = "tool_search_call"), + @JsonSubTypes.Type(value = ItemToolSearchOutput.class, name = "tool_search_output"), @JsonSubTypes.Type(value = ItemTranscription.class, name = "transcription"), @JsonSubTypes.Type(value = ItemFunctionWebSearch.class, name = "web_search_call"), }) diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/Tool.java b/src/main/java/com/volcengine/ark/runtime/models/responses/Tool.java index 3d1b3f3..dfa23d8 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/responses/Tool.java +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/Tool.java @@ -27,6 +27,8 @@ @JsonSubTypes.Type(value = ImageProcessTool.class, name = "image_process"), @JsonSubTypes.Type(value = KnowledgeSearchTool.class, name = "knowledge_search"), @JsonSubTypes.Type(value = McpTool.class, name = "mcp"), + @JsonSubTypes.Type(value = NamespaceTool.class, name = "namespace"), + @JsonSubTypes.Type(value = ToolSearchTool.class, name = "tool_search"), @JsonSubTypes.Type(value = WebSearchTool.class, name = "web_search"), }) diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/ToolSearchExecution.java b/src/main/java/com/volcengine/ark/runtime/models/responses/ToolSearchExecution.java new file mode 100644 index 0000000..a6f7b80 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/ToolSearchExecution.java @@ -0,0 +1,59 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Responses API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.responses; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ToolSearchExecution + */ +public enum ToolSearchExecution { + + SERVER("server"), + + CLIENT("client"), + + EMPTY(""); + + private String value; + + ToolSearchExecution(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ToolSearchExecution fromValue(String value) { + for (ToolSearchExecution b : ToolSearchExecution.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/ToolSearchResultTool.java b/src/main/java/com/volcengine/ark/runtime/models/responses/ToolSearchResultTool.java new file mode 100644 index 0000000..8564dbc --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/ToolSearchResultTool.java @@ -0,0 +1,32 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Responses API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.responses; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = FunctionTool.class, name = "function"), + @JsonSubTypes.Type(value = NamespaceTool.class, name = "namespace"), +}) + +@com.volcengine.ark.runtime.utils.UnknownVariantFallback(UnknownToolSearchResultTool.class) +public interface ToolSearchResultTool { + public ToolType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/ToolSearchTool.java b/src/main/java/com/volcengine/ark/runtime/models/responses/ToolSearchTool.java new file mode 100644 index 0000000..c4a3f2f --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/ToolSearchTool.java @@ -0,0 +1,274 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Responses API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.responses; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * ToolSearchTool + */ +@JsonPropertyOrder({ + ToolSearchTool.JSON_PROPERTY_TYPE, + ToolSearchTool.JSON_PROPERTY_EXECUTION, + ToolSearchTool.JSON_PROPERTY_DESCRIPTION, + ToolSearchTool.JSON_PROPERTY_PARAMETERS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ToolSearchTool implements Tool { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ToolType type = ToolType.TOOL_SEARCH; + + public static final String JSON_PROPERTY_EXECUTION = "execution"; + @javax.annotation.Nullable + private ToolSearchExecution execution; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @javax.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_PARAMETERS = "parameters"; + @javax.annotation.Nullable + private Map parameters; + + public ToolSearchTool() { + } + + public ToolSearchTool type(@javax.annotation.Nonnull ToolType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ToolType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ToolType type) { + this.type = type; + } + + public ToolSearchTool execution(@javax.annotation.Nullable ToolSearchExecution execution) { + + this.execution = execution; + return this; + } + + /** + * Get execution + * @return execution + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXECUTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ToolSearchExecution getExecution() { + return execution; + } + + + @JsonProperty(value = JSON_PROPERTY_EXECUTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExecution(@javax.annotation.Nullable ToolSearchExecution execution) { + this.execution = execution; + } + + public ToolSearchTool description(@javax.annotation.Nullable String description) { + + this.description = description; + return this; + } + + /** + * Optional caller-supplied description; hosted search uses its built-in definition. + * @return description + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getDescription() { + return description; + } + + + @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + public ToolSearchTool parameters(@javax.annotation.Nullable Map parameters) { + + this.parameters = parameters; + return this; + } + + public ToolSearchTool putParametersItem(String key, Object parametersItem) { + if (this.parameters == null) { + this.parameters = new HashMap<>(); + } + this.parameters.put(key, parametersItem); + return this; + } + + /** + * Optional JSON schema; hosted search uses its built-in parameter schema. + * @return parameters + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PARAMETERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.NON_EMPTY) + + public Map getParameters() { + return parameters; + } + + + @JsonProperty(value = JSON_PROPERTY_PARAMETERS, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.NON_EMPTY) + public void setParameters(@javax.annotation.Nullable Map parameters) { + this.parameters = parameters; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ToolSearchTool toolSearchTool = (ToolSearchTool) o; + return Objects.equals(this.type, toolSearchTool.type) && + Objects.equals(this.execution, toolSearchTool.execution) && + Objects.equals(this.description, toolSearchTool.description) && + Objects.equals(this.parameters, toolSearchTool.parameters); + } + + @Override + public int hashCode() { + return Objects.hash(type, execution, description, parameters); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ToolSearchTool {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" execution: ").append(toIndentedString(execution)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ToolSearchTool instance; + + public Builder() { + this(new ToolSearchTool()); + } + + protected Builder(ToolSearchTool instance) { + this.instance = instance; + } + + public ToolSearchTool.Builder type(ToolType type) { + this.instance.type = type; + return this; + } + public ToolSearchTool.Builder execution(ToolSearchExecution execution) { + this.instance.execution = execution; + return this; + } + public ToolSearchTool.Builder description(String description) { + this.instance.description = description; + return this; + } + public ToolSearchTool.Builder parameters(Map parameters) { + this.instance.parameters = parameters; + return this; + } + + + /** + * returns a built ToolSearchTool instance. + * + * The builder is not reusable. + */ + public ToolSearchTool build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ToolSearchTool.Builder builder() { + return new ToolSearchTool.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ToolSearchTool.Builder toBuilder() { + return new ToolSearchTool.Builder() + .type(getType()) + .execution(getExecution()) + .description(getDescription()) + .parameters(getParameters()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/ToolType.java b/src/main/java/com/volcengine/ark/runtime/models/responses/ToolType.java index 9021c3a..4a0defd 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/responses/ToolType.java +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/ToolType.java @@ -38,6 +38,10 @@ public enum ToolType { MCP("mcp"), + NAMESPACE("namespace"), + + TOOL_SEARCH("tool_search"), + WEB_SEARCH("web_search"); private String value; diff --git a/src/main/java/com/volcengine/ark/runtime/models/responses/UnknownToolSearchResultTool.java b/src/main/java/com/volcengine/ark/runtime/models/responses/UnknownToolSearchResultTool.java new file mode 100644 index 0000000..dba5496 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/responses/UnknownToolSearchResultTool.java @@ -0,0 +1,52 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Responses API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.volcengine.ark.runtime.models.responses; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.volcengine.ark.runtime.utils.UnknownVariantSupport; +import java.io.IOException; + +/** Generated by ark-apis unknown_response_variants; retained future ToolSearchResultTool payload. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NONE) +@JsonDeserialize(using = UnknownToolSearchResultTool.Deserializer.class) +@JsonSerialize(using = UnknownVariantSupport.Serializer.class) +public final class UnknownToolSearchResultTool extends UnknownVariantSupport implements ToolSearchResultTool { + public UnknownToolSearchResultTool(JsonNode rawJson) { + super("type", rawJson); + } + + @Override + public ToolType getType() { + return ToolType.UNKNOWN; + } + + public static final class Deserializer extends JsonDeserializer { + @Override + public UnknownToolSearchResultTool deserialize(JsonParser parser, DeserializationContext context) throws IOException { + JsonNode node = parser.getCodec().readTree(parser); + if (!UnknownVariantSupport.hasDiscriminator(node, "type")) { + return (UnknownToolSearchResultTool) context.handleUnexpectedToken(UnknownToolSearchResultTool.class, parser); + } + return new UnknownToolSearchResultTool(node); + } + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/Base64DocumentSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/Base64DocumentSource.java index 8531ceb..2bfd134 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/Base64DocumentSource.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/Base64DocumentSource.java @@ -25,12 +25,16 @@ * 直接以 base64 携带的文档数据。 */ @JsonPropertyOrder({ + Base64DocumentSource.JSON_PROPERTY_TYPE, Base64DocumentSource.JSON_PROPERTY_DATA, - Base64DocumentSource.JSON_PROPERTY_MEDIA_TYPE, - Base64DocumentSource.JSON_PROPERTY_TYPE + Base64DocumentSource.JSON_PROPERTY_MEDIA_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class Base64DocumentSource implements DocumentSource { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private DocumentSourceType type = DocumentSourceType.BASE64; + public static final String JSON_PROPERTY_DATA = "data"; @javax.annotation.Nonnull private String data; @@ -39,11 +43,32 @@ public class Base64DocumentSource implements DocumentSource { @javax.annotation.Nonnull private String mediaType; - public static final String JSON_PROPERTY_TYPE = "type"; + public Base64DocumentSource() { + } + + public Base64DocumentSource type(@javax.annotation.Nonnull DocumentSourceType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ @javax.annotation.Nonnull - private DocumentSourceType type = DocumentSourceType.BASE64; + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Base64DocumentSource() { + public DocumentSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull DocumentSourceType type) { + this.type = type; } public Base64DocumentSource data(@javax.annotation.Nonnull String data) { @@ -96,31 +121,6 @@ public void setMediaType(@javax.annotation.Nonnull String mediaType) { this.mediaType = mediaType; } - public Base64DocumentSource type(@javax.annotation.Nonnull DocumentSourceType type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public DocumentSourceType getType() { - return type; - } - - - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull DocumentSourceType type) { - this.type = type; - } - @Override public boolean equals(Object o) { @@ -131,23 +131,23 @@ public boolean equals(Object o) { return false; } Base64DocumentSource base64DocumentSource = (Base64DocumentSource) o; - return Objects.equals(this.data, base64DocumentSource.data) && - Objects.equals(this.mediaType, base64DocumentSource.mediaType) && - Objects.equals(this.type, base64DocumentSource.type); + return Objects.equals(this.type, base64DocumentSource.type) && + Objects.equals(this.data, base64DocumentSource.data) && + Objects.equals(this.mediaType, base64DocumentSource.mediaType); } @Override public int hashCode() { - return Objects.hash(data, mediaType, type); + return Objects.hash(type, data, mediaType); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Base64DocumentSource {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } @@ -172,6 +172,10 @@ protected Builder(Base64DocumentSource instance) { this.instance = instance; } + public Base64DocumentSource.Builder type(DocumentSourceType type) { + this.instance.type = type; + return this; + } public Base64DocumentSource.Builder data(String data) { this.instance.data = data; return this; @@ -180,10 +184,6 @@ public Base64DocumentSource.Builder mediaType(String mediaType) { this.instance.mediaType = mediaType; return this; } - public Base64DocumentSource.Builder type(DocumentSourceType type) { - this.instance.type = type; - return this; - } /** @@ -218,9 +218,9 @@ public static Base64DocumentSource.Builder builder() { */ public Base64DocumentSource.Builder toBuilder() { return new Base64DocumentSource.Builder() + .type(getType()) .data(getData()) - .mediaType(getMediaType()) - .type(getType()); + .mediaType(getMediaType()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/Base64ImageSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/Base64ImageSource.java index 0812152..bab9c7d 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/Base64ImageSource.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/Base64ImageSource.java @@ -25,12 +25,16 @@ * 直接以 base64 携带的图片数据。 */ @JsonPropertyOrder({ + Base64ImageSource.JSON_PROPERTY_TYPE, Base64ImageSource.JSON_PROPERTY_DATA, - Base64ImageSource.JSON_PROPERTY_MEDIA_TYPE, - Base64ImageSource.JSON_PROPERTY_TYPE + Base64ImageSource.JSON_PROPERTY_MEDIA_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class Base64ImageSource implements ImageSource { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ImageSourceType type = ImageSourceType.BASE64; + public static final String JSON_PROPERTY_DATA = "data"; @javax.annotation.Nonnull private String data; @@ -39,11 +43,32 @@ public class Base64ImageSource implements ImageSource { @javax.annotation.Nonnull private String mediaType; - public static final String JSON_PROPERTY_TYPE = "type"; + public Base64ImageSource() { + } + + public Base64ImageSource type(@javax.annotation.Nonnull ImageSourceType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ @javax.annotation.Nonnull - private ImageSourceType type = ImageSourceType.BASE64; + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Base64ImageSource() { + public ImageSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ImageSourceType type) { + this.type = type; } public Base64ImageSource data(@javax.annotation.Nonnull String data) { @@ -96,31 +121,6 @@ public void setMediaType(@javax.annotation.Nonnull String mediaType) { this.mediaType = mediaType; } - public Base64ImageSource type(@javax.annotation.Nonnull ImageSourceType type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public ImageSourceType getType() { - return type; - } - - - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull ImageSourceType type) { - this.type = type; - } - @Override public boolean equals(Object o) { @@ -131,23 +131,23 @@ public boolean equals(Object o) { return false; } Base64ImageSource base64ImageSource = (Base64ImageSource) o; - return Objects.equals(this.data, base64ImageSource.data) && - Objects.equals(this.mediaType, base64ImageSource.mediaType) && - Objects.equals(this.type, base64ImageSource.type); + return Objects.equals(this.type, base64ImageSource.type) && + Objects.equals(this.data, base64ImageSource.data) && + Objects.equals(this.mediaType, base64ImageSource.mediaType); } @Override public int hashCode() { - return Objects.hash(data, mediaType, type); + return Objects.hash(type, data, mediaType); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Base64ImageSource {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } @@ -172,6 +172,10 @@ protected Builder(Base64ImageSource instance) { this.instance = instance; } + public Base64ImageSource.Builder type(ImageSourceType type) { + this.instance.type = type; + return this; + } public Base64ImageSource.Builder data(String data) { this.instance.data = data; return this; @@ -180,10 +184,6 @@ public Base64ImageSource.Builder mediaType(String mediaType) { this.instance.mediaType = mediaType; return this; } - public Base64ImageSource.Builder type(ImageSourceType type) { - this.instance.type = type; - return this; - } /** @@ -218,9 +218,9 @@ public static Base64ImageSource.Builder builder() { */ public Base64ImageSource.Builder toBuilder() { return new Base64ImageSource.Builder() + .type(getType()) .data(getData()) - .mediaType(getMediaType()) - .type(getType()); + .mediaType(getMediaType()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/Base64VideoSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/Base64VideoSource.java new file mode 100644 index 0000000..553eebf --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/Base64VideoSource.java @@ -0,0 +1,264 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * 直接以 base64 携带的视频。 + */ +@JsonPropertyOrder({ + Base64VideoSource.JSON_PROPERTY_TYPE, + Base64VideoSource.JSON_PROPERTY_DATA, + Base64VideoSource.JSON_PROPERTY_MEDIA_TYPE, + Base64VideoSource.JSON_PROPERTY_FPS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class Base64VideoSource implements VideoSource { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private VideoSourceType type = VideoSourceType.BASE64; + + public static final String JSON_PROPERTY_DATA = "data"; + @javax.annotation.Nonnull + private String data; + + public static final String JSON_PROPERTY_MEDIA_TYPE = "media_type"; + @javax.annotation.Nonnull + private String mediaType; + + public static final String JSON_PROPERTY_FPS = "fps"; + @javax.annotation.Nullable + private Double fps; + + public Base64VideoSource() { + } + + public Base64VideoSource type(@javax.annotation.Nonnull VideoSourceType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public VideoSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull VideoSourceType type) { + this.type = type; + } + + public Base64VideoSource data(@javax.annotation.Nonnull String data) { + + this.data = data; + return this; + } + + /** + * Base64 编码的视频数据。 + * @return data + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_DATA, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setData(@javax.annotation.Nonnull String data) { + this.data = data; + } + + public Base64VideoSource mediaType(@javax.annotation.Nonnull String mediaType) { + + this.mediaType = mediaType; + return this; + } + + /** + * 视频 MIME 类型:`video/mp4` / `video/x-msvideo` / `video/quicktime`。 + * @return mediaType + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_MEDIA_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMediaType() { + return mediaType; + } + + + @JsonProperty(value = JSON_PROPERTY_MEDIA_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMediaType(@javax.annotation.Nonnull String mediaType) { + this.mediaType = mediaType; + } + + public Base64VideoSource fps(@javax.annotation.Nullable Double fps) { + + this.fps = fps; + return this; + } + + /** + * 视频抽帧帧率;省略时由下游模型默认策略决定。 + * @return fps + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getFps() { + return fps; + } + + + @JsonProperty(value = JSON_PROPERTY_FPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFps(@javax.annotation.Nullable Double fps) { + this.fps = fps; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Base64VideoSource base64VideoSource = (Base64VideoSource) o; + return Objects.equals(this.type, base64VideoSource.type) && + Objects.equals(this.data, base64VideoSource.data) && + Objects.equals(this.mediaType, base64VideoSource.mediaType) && + Objects.equals(this.fps, base64VideoSource.fps); + } + + @Override + public int hashCode() { + return Objects.hash(type, data, mediaType, fps); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Base64VideoSource {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); + sb.append(" fps: ").append(toIndentedString(fps)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private Base64VideoSource instance; + + public Builder() { + this(new Base64VideoSource()); + } + + protected Builder(Base64VideoSource instance) { + this.instance = instance; + } + + public Base64VideoSource.Builder type(VideoSourceType type) { + this.instance.type = type; + return this; + } + public Base64VideoSource.Builder data(String data) { + this.instance.data = data; + return this; + } + public Base64VideoSource.Builder mediaType(String mediaType) { + this.instance.mediaType = mediaType; + return this; + } + public Base64VideoSource.Builder fps(Double fps) { + this.instance.fps = fps; + return this; + } + + + /** + * returns a built Base64VideoSource instance. + * + * The builder is not reusable. + */ + public Base64VideoSource build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Base64VideoSource.Builder builder() { + return new Base64VideoSource.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Base64VideoSource.Builder toBuilder() { + return new Base64VideoSource.Builder() + .type(getType()) + .data(getData()) + .mediaType(getMediaType()) + .fps(getFps()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ContentBlockType.java b/src/main/java/com/volcengine/ark/runtime/models/session/ContentBlockType.java index 2e2f15c..795c8b2 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/ContentBlockType.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ContentBlockType.java @@ -31,7 +31,9 @@ public enum ContentBlockType { SEARCH_RESULT("search_result"), - TEXT("text"); + TEXT("text"), + + VIDEO("video"); private String value; diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/FileDocumentSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/FileDocumentSource.java index 547e02f..b381c51 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/FileDocumentSource.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/FileDocumentSource.java @@ -25,70 +25,70 @@ * 通过 Files API 上传后引用的文档。 */ @JsonPropertyOrder({ - FileDocumentSource.JSON_PROPERTY_FILE_ID, - FileDocumentSource.JSON_PROPERTY_TYPE + FileDocumentSource.JSON_PROPERTY_TYPE, + FileDocumentSource.JSON_PROPERTY_FILE_ID }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class FileDocumentSource implements DocumentSource { - public static final String JSON_PROPERTY_FILE_ID = "file_id"; - @javax.annotation.Nonnull - private String fileId; - public static final String JSON_PROPERTY_TYPE = "type"; @javax.annotation.Nonnull private DocumentSourceType type = DocumentSourceType.FILE; + public static final String JSON_PROPERTY_FILE_ID = "file_id"; + @javax.annotation.Nonnull + private String fileId; + public FileDocumentSource() { } - public FileDocumentSource fileId(@javax.annotation.Nonnull String fileId) { + public FileDocumentSource type(@javax.annotation.Nonnull DocumentSourceType type) { - this.fileId = fileId; + this.type = type; return this; } /** - * file id,形如 `file_...`。 - * @return fileId + * Get type + * @return type */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getFileId() { - return fileId; + public DocumentSourceType getType() { + return type; } - @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFileId(@javax.annotation.Nonnull String fileId) { - this.fileId = fileId; + public void setType(@javax.annotation.Nonnull DocumentSourceType type) { + this.type = type; } - public FileDocumentSource type(@javax.annotation.Nonnull DocumentSourceType type) { + public FileDocumentSource fileId(@javax.annotation.Nonnull String fileId) { - this.type = type; + this.fileId = fileId; return this; } /** - * Get type - * @return type + * file id,形如 `file_...`。 + * @return fileId */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public DocumentSourceType getType() { - return type; + public String getFileId() { + return fileId; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull DocumentSourceType type) { - this.type = type; + public void setFileId(@javax.annotation.Nonnull String fileId) { + this.fileId = fileId; } @@ -101,21 +101,21 @@ public boolean equals(Object o) { return false; } FileDocumentSource fileDocumentSource = (FileDocumentSource) o; - return Objects.equals(this.fileId, fileDocumentSource.fileId) && - Objects.equals(this.type, fileDocumentSource.type); + return Objects.equals(this.type, fileDocumentSource.type) && + Objects.equals(this.fileId, fileDocumentSource.fileId); } @Override public int hashCode() { - return Objects.hash(fileId, type); + return Objects.hash(type, fileId); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FileDocumentSource {\n"); - sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -140,14 +140,14 @@ protected Builder(FileDocumentSource instance) { this.instance = instance; } - public FileDocumentSource.Builder fileId(String fileId) { - this.instance.fileId = fileId; - return this; - } public FileDocumentSource.Builder type(DocumentSourceType type) { this.instance.type = type; return this; } + public FileDocumentSource.Builder fileId(String fileId) { + this.instance.fileId = fileId; + return this; + } /** @@ -182,8 +182,8 @@ public static FileDocumentSource.Builder builder() { */ public FileDocumentSource.Builder toBuilder() { return new FileDocumentSource.Builder() - .fileId(getFileId()) - .type(getType()); + .type(getType()) + .fileId(getFileId()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/FileImageSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/FileImageSource.java index 80ff7e4..e34f7ac 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/FileImageSource.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/FileImageSource.java @@ -25,70 +25,70 @@ * 通过 Files API 上传后引用的图片。 */ @JsonPropertyOrder({ - FileImageSource.JSON_PROPERTY_FILE_ID, - FileImageSource.JSON_PROPERTY_TYPE + FileImageSource.JSON_PROPERTY_TYPE, + FileImageSource.JSON_PROPERTY_FILE_ID }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class FileImageSource implements ImageSource { - public static final String JSON_PROPERTY_FILE_ID = "file_id"; - @javax.annotation.Nonnull - private String fileId; - public static final String JSON_PROPERTY_TYPE = "type"; @javax.annotation.Nonnull private ImageSourceType type = ImageSourceType.FILE; + public static final String JSON_PROPERTY_FILE_ID = "file_id"; + @javax.annotation.Nonnull + private String fileId; + public FileImageSource() { } - public FileImageSource fileId(@javax.annotation.Nonnull String fileId) { + public FileImageSource type(@javax.annotation.Nonnull ImageSourceType type) { - this.fileId = fileId; + this.type = type; return this; } /** - * file id,形如 `file_...`。 - * @return fileId + * Get type + * @return type */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getFileId() { - return fileId; + public ImageSourceType getType() { + return type; } - @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFileId(@javax.annotation.Nonnull String fileId) { - this.fileId = fileId; + public void setType(@javax.annotation.Nonnull ImageSourceType type) { + this.type = type; } - public FileImageSource type(@javax.annotation.Nonnull ImageSourceType type) { + public FileImageSource fileId(@javax.annotation.Nonnull String fileId) { - this.type = type; + this.fileId = fileId; return this; } /** - * Get type - * @return type + * file id,形如 `file_...`。 + * @return fileId */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ImageSourceType getType() { - return type; + public String getFileId() { + return fileId; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull ImageSourceType type) { - this.type = type; + public void setFileId(@javax.annotation.Nonnull String fileId) { + this.fileId = fileId; } @@ -101,21 +101,21 @@ public boolean equals(Object o) { return false; } FileImageSource fileImageSource = (FileImageSource) o; - return Objects.equals(this.fileId, fileImageSource.fileId) && - Objects.equals(this.type, fileImageSource.type); + return Objects.equals(this.type, fileImageSource.type) && + Objects.equals(this.fileId, fileImageSource.fileId); } @Override public int hashCode() { - return Objects.hash(fileId, type); + return Objects.hash(type, fileId); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class FileImageSource {\n"); - sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); sb.append("}"); return sb.toString(); } @@ -140,14 +140,14 @@ protected Builder(FileImageSource instance) { this.instance = instance; } - public FileImageSource.Builder fileId(String fileId) { - this.instance.fileId = fileId; - return this; - } public FileImageSource.Builder type(ImageSourceType type) { this.instance.type = type; return this; } + public FileImageSource.Builder fileId(String fileId) { + this.instance.fileId = fileId; + return this; + } /** @@ -182,8 +182,8 @@ public static FileImageSource.Builder builder() { */ public FileImageSource.Builder toBuilder() { return new FileImageSource.Builder() - .fileId(getFileId()) - .type(getType()); + .type(getType()) + .fileId(getFileId()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/FileVideoSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/FileVideoSource.java new file mode 100644 index 0000000..0334fe9 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/FileVideoSource.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * 通过 Files API 上传后引用的视频。 + */ +@JsonPropertyOrder({ + FileVideoSource.JSON_PROPERTY_TYPE, + FileVideoSource.JSON_PROPERTY_FILE_ID, + FileVideoSource.JSON_PROPERTY_FPS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class FileVideoSource implements VideoSource { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private VideoSourceType type = VideoSourceType.FILE; + + public static final String JSON_PROPERTY_FILE_ID = "file_id"; + @javax.annotation.Nonnull + private String fileId; + + public static final String JSON_PROPERTY_FPS = "fps"; + @javax.annotation.Nullable + private Double fps; + + public FileVideoSource() { + } + + public FileVideoSource type(@javax.annotation.Nonnull VideoSourceType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public VideoSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull VideoSourceType type) { + this.type = type; + } + + public FileVideoSource fileId(@javax.annotation.Nonnull String fileId) { + + this.fileId = fileId; + return this; + } + + /** + * 已上传的视频 file id。 + * @return fileId + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getFileId() { + return fileId; + } + + + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFileId(@javax.annotation.Nonnull String fileId) { + this.fileId = fileId; + } + + public FileVideoSource fps(@javax.annotation.Nullable Double fps) { + + this.fps = fps; + return this; + } + + /** + * 视频抽帧帧率;file 改写为 URL 时透传此值。 + * @return fps + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getFps() { + return fps; + } + + + @JsonProperty(value = JSON_PROPERTY_FPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFps(@javax.annotation.Nullable Double fps) { + this.fps = fps; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileVideoSource fileVideoSource = (FileVideoSource) o; + return Objects.equals(this.type, fileVideoSource.type) && + Objects.equals(this.fileId, fileVideoSource.fileId) && + Objects.equals(this.fps, fileVideoSource.fps); + } + + @Override + public int hashCode() { + return Objects.hash(type, fileId, fps); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileVideoSource {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); + sb.append(" fps: ").append(toIndentedString(fps)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private FileVideoSource instance; + + public Builder() { + this(new FileVideoSource()); + } + + protected Builder(FileVideoSource instance) { + this.instance = instance; + } + + public FileVideoSource.Builder type(VideoSourceType type) { + this.instance.type = type; + return this; + } + public FileVideoSource.Builder fileId(String fileId) { + this.instance.fileId = fileId; + return this; + } + public FileVideoSource.Builder fps(Double fps) { + this.instance.fps = fps; + return this; + } + + + /** + * returns a built FileVideoSource instance. + * + * The builder is not reusable. + */ + public FileVideoSource build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static FileVideoSource.Builder builder() { + return new FileVideoSource.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public FileVideoSource.Builder toBuilder() { + return new FileVideoSource.Builder() + .type(getType()) + .fileId(getFileId()) + .fps(getFps()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsDocumentBlock.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsDocumentBlock.java index c511545..a8c8572 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsDocumentBlock.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsDocumentBlock.java @@ -25,13 +25,17 @@ * 文档块。 */ @JsonPropertyOrder({ + ManagedAgentsDocumentBlock.JSON_PROPERTY_TYPE, ManagedAgentsDocumentBlock.JSON_PROPERTY_SOURCE, ManagedAgentsDocumentBlock.JSON_PROPERTY_TITLE, - ManagedAgentsDocumentBlock.JSON_PROPERTY_CONTEXT, - ManagedAgentsDocumentBlock.JSON_PROPERTY_TYPE + ManagedAgentsDocumentBlock.JSON_PROPERTY_CONTEXT }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class ManagedAgentsDocumentBlock implements ManagedAgentsMessageContentBlock, ManagedAgentsToolResultContentBlock { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentBlockType type = ContentBlockType.DOCUMENT; + public static final String JSON_PROPERTY_SOURCE = "source"; @javax.annotation.Nonnull private DocumentSource source; @@ -44,11 +48,32 @@ public class ManagedAgentsDocumentBlock implements ManagedAgentsMessageContentBl @javax.annotation.Nullable private String context; - public static final String JSON_PROPERTY_TYPE = "type"; + public ManagedAgentsDocumentBlock() { + } + + public ManagedAgentsDocumentBlock type(@javax.annotation.Nonnull ContentBlockType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ @javax.annotation.Nonnull - private ContentBlockType type = ContentBlockType.DOCUMENT; + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ManagedAgentsDocumentBlock() { + public ContentBlockType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentBlockType type) { + this.type = type; } public ManagedAgentsDocumentBlock source(@javax.annotation.Nonnull DocumentSource source) { @@ -126,31 +151,6 @@ public void setContext(@javax.annotation.Nullable String context) { this.context = context; } - public ManagedAgentsDocumentBlock type(@javax.annotation.Nonnull ContentBlockType type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public ContentBlockType getType() { - return type; - } - - - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull ContentBlockType type) { - this.type = type; - } - @Override public boolean equals(Object o) { @@ -161,25 +161,25 @@ public boolean equals(Object o) { return false; } ManagedAgentsDocumentBlock managedAgentsDocumentBlock = (ManagedAgentsDocumentBlock) o; - return Objects.equals(this.source, managedAgentsDocumentBlock.source) && + return Objects.equals(this.type, managedAgentsDocumentBlock.type) && + Objects.equals(this.source, managedAgentsDocumentBlock.source) && Objects.equals(this.title, managedAgentsDocumentBlock.title) && - Objects.equals(this.context, managedAgentsDocumentBlock.context) && - Objects.equals(this.type, managedAgentsDocumentBlock.type); + Objects.equals(this.context, managedAgentsDocumentBlock.context); } @Override public int hashCode() { - return Objects.hash(source, title, context, type); + return Objects.hash(type, source, title, context); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ManagedAgentsDocumentBlock {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" context: ").append(toIndentedString(context)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } @@ -204,6 +204,10 @@ protected Builder(ManagedAgentsDocumentBlock instance) { this.instance = instance; } + public ManagedAgentsDocumentBlock.Builder type(ContentBlockType type) { + this.instance.type = type; + return this; + } public ManagedAgentsDocumentBlock.Builder source(DocumentSource source) { this.instance.source = source; return this; @@ -216,10 +220,6 @@ public ManagedAgentsDocumentBlock.Builder context(String context) { this.instance.context = context; return this; } - public ManagedAgentsDocumentBlock.Builder type(ContentBlockType type) { - this.instance.type = type; - return this; - } /** @@ -254,10 +254,10 @@ public static ManagedAgentsDocumentBlock.Builder builder() { */ public ManagedAgentsDocumentBlock.Builder toBuilder() { return new ManagedAgentsDocumentBlock.Builder() + .type(getType()) .source(getSource()) .title(getTitle()) - .context(getContext()) - .type(getType()); + .context(getContext()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsImageBlock.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsImageBlock.java index 8ce083d..7a32644 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsImageBlock.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsImageBlock.java @@ -25,70 +25,70 @@ * 图片块。 */ @JsonPropertyOrder({ - ManagedAgentsImageBlock.JSON_PROPERTY_SOURCE, - ManagedAgentsImageBlock.JSON_PROPERTY_TYPE + ManagedAgentsImageBlock.JSON_PROPERTY_TYPE, + ManagedAgentsImageBlock.JSON_PROPERTY_SOURCE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class ManagedAgentsImageBlock implements ManagedAgentsMessageContentBlock, ManagedAgentsToolResultContentBlock { - public static final String JSON_PROPERTY_SOURCE = "source"; - @javax.annotation.Nonnull - private ImageSource source; - public static final String JSON_PROPERTY_TYPE = "type"; @javax.annotation.Nonnull private ContentBlockType type = ContentBlockType.IMAGE; + public static final String JSON_PROPERTY_SOURCE = "source"; + @javax.annotation.Nonnull + private ImageSource source; + public ManagedAgentsImageBlock() { } - public ManagedAgentsImageBlock source(@javax.annotation.Nonnull ImageSource source) { + public ManagedAgentsImageBlock type(@javax.annotation.Nonnull ContentBlockType type) { - this.source = source; + this.type = type; return this; } /** - * 图片来源。 - * @return source + * Get type + * @return type */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ImageSource getSource() { - return source; + public ContentBlockType getType() { + return type; } - @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setSource(@javax.annotation.Nonnull ImageSource source) { - this.source = source; + public void setType(@javax.annotation.Nonnull ContentBlockType type) { + this.type = type; } - public ManagedAgentsImageBlock type(@javax.annotation.Nonnull ContentBlockType type) { + public ManagedAgentsImageBlock source(@javax.annotation.Nonnull ImageSource source) { - this.type = type; + this.source = source; return this; } /** - * Get type - * @return type + * 图片来源。 + * @return source */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ContentBlockType getType() { - return type; + public ImageSource getSource() { + return source; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull ContentBlockType type) { - this.type = type; + public void setSource(@javax.annotation.Nonnull ImageSource source) { + this.source = source; } @@ -101,21 +101,21 @@ public boolean equals(Object o) { return false; } ManagedAgentsImageBlock managedAgentsImageBlock = (ManagedAgentsImageBlock) o; - return Objects.equals(this.source, managedAgentsImageBlock.source) && - Objects.equals(this.type, managedAgentsImageBlock.type); + return Objects.equals(this.type, managedAgentsImageBlock.type) && + Objects.equals(this.source, managedAgentsImageBlock.source); } @Override public int hashCode() { - return Objects.hash(source, type); + return Objects.hash(type, source); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ManagedAgentsImageBlock {\n"); - sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append("}"); return sb.toString(); } @@ -140,14 +140,14 @@ protected Builder(ManagedAgentsImageBlock instance) { this.instance = instance; } - public ManagedAgentsImageBlock.Builder source(ImageSource source) { - this.instance.source = source; - return this; - } public ManagedAgentsImageBlock.Builder type(ContentBlockType type) { this.instance.type = type; return this; } + public ManagedAgentsImageBlock.Builder source(ImageSource source) { + this.instance.source = source; + return this; + } /** @@ -182,8 +182,8 @@ public static ManagedAgentsImageBlock.Builder builder() { */ public ManagedAgentsImageBlock.Builder toBuilder() { return new ManagedAgentsImageBlock.Builder() - .source(getSource()) - .type(getType()); + .type(getType()) + .source(getSource()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsMessageContentBlock.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsMessageContentBlock.java index e3b1d64..030964c 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsMessageContentBlock.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsMessageContentBlock.java @@ -25,6 +25,7 @@ @JsonSubTypes.Type(value = ManagedAgentsDocumentBlock.class, name = "document"), @JsonSubTypes.Type(value = ManagedAgentsImageBlock.class, name = "image"), @JsonSubTypes.Type(value = ManagedAgentsTextBlock.class, name = "text"), + @JsonSubTypes.Type(value = ManagedAgentsVideoBlock.class, name = "video"), }) public interface ManagedAgentsMessageContentBlock { diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSearchResultBlock.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSearchResultBlock.java index 04e7edd..91eabb4 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSearchResultBlock.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSearchResultBlock.java @@ -27,14 +27,18 @@ * 搜索结果块——多个 SearchResultContent 文本片段 + 元信息。 */ @JsonPropertyOrder({ + ManagedAgentsSearchResultBlock.JSON_PROPERTY_TYPE, ManagedAgentsSearchResultBlock.JSON_PROPERTY_CITATIONS, ManagedAgentsSearchResultBlock.JSON_PROPERTY_CONTENT, ManagedAgentsSearchResultBlock.JSON_PROPERTY_SOURCE, - ManagedAgentsSearchResultBlock.JSON_PROPERTY_TITLE, - ManagedAgentsSearchResultBlock.JSON_PROPERTY_TYPE + ManagedAgentsSearchResultBlock.JSON_PROPERTY_TITLE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class ManagedAgentsSearchResultBlock implements ManagedAgentsToolResultContentBlock { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentBlockType type = ContentBlockType.SEARCH_RESULT; + public static final String JSON_PROPERTY_CITATIONS = "citations"; @javax.annotation.Nonnull private SearchResultCitations citations; @@ -51,11 +55,32 @@ public class ManagedAgentsSearchResultBlock implements ManagedAgentsToolResultCo @javax.annotation.Nonnull private String title; - public static final String JSON_PROPERTY_TYPE = "type"; + public ManagedAgentsSearchResultBlock() { + } + + public ManagedAgentsSearchResultBlock type(@javax.annotation.Nonnull ContentBlockType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ @javax.annotation.Nonnull - private ContentBlockType type = ContentBlockType.SEARCH_RESULT; + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ManagedAgentsSearchResultBlock() { + public ContentBlockType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentBlockType type) { + this.type = type; } public ManagedAgentsSearchResultBlock citations(@javax.annotation.Nonnull SearchResultCitations citations) { @@ -166,31 +191,6 @@ public void setTitle(@javax.annotation.Nonnull String title) { this.title = title; } - public ManagedAgentsSearchResultBlock type(@javax.annotation.Nonnull ContentBlockType type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public ContentBlockType getType() { - return type; - } - - - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull ContentBlockType type) { - this.type = type; - } - @Override public boolean equals(Object o) { @@ -201,27 +201,27 @@ public boolean equals(Object o) { return false; } ManagedAgentsSearchResultBlock managedAgentsSearchResultBlock = (ManagedAgentsSearchResultBlock) o; - return Objects.equals(this.citations, managedAgentsSearchResultBlock.citations) && + return Objects.equals(this.type, managedAgentsSearchResultBlock.type) && + Objects.equals(this.citations, managedAgentsSearchResultBlock.citations) && Objects.equals(this.content, managedAgentsSearchResultBlock.content) && Objects.equals(this.source, managedAgentsSearchResultBlock.source) && - Objects.equals(this.title, managedAgentsSearchResultBlock.title) && - Objects.equals(this.type, managedAgentsSearchResultBlock.type); + Objects.equals(this.title, managedAgentsSearchResultBlock.title); } @Override public int hashCode() { - return Objects.hash(citations, content, source, title, type); + return Objects.hash(type, citations, content, source, title); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ManagedAgentsSearchResultBlock {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" citations: ").append(toIndentedString(citations)).append("\n"); sb.append(" content: ").append(toIndentedString(content)).append("\n"); sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } @@ -246,6 +246,10 @@ protected Builder(ManagedAgentsSearchResultBlock instance) { this.instance = instance; } + public ManagedAgentsSearchResultBlock.Builder type(ContentBlockType type) { + this.instance.type = type; + return this; + } public ManagedAgentsSearchResultBlock.Builder citations(SearchResultCitations citations) { this.instance.citations = citations; return this; @@ -262,10 +266,6 @@ public ManagedAgentsSearchResultBlock.Builder title(String title) { this.instance.title = title; return this; } - public ManagedAgentsSearchResultBlock.Builder type(ContentBlockType type) { - this.instance.type = type; - return this; - } /** @@ -300,11 +300,11 @@ public static ManagedAgentsSearchResultBlock.Builder builder() { */ public ManagedAgentsSearchResultBlock.Builder toBuilder() { return new ManagedAgentsSearchResultBlock.Builder() + .type(getType()) .citations(getCitations()) .content(getContent()) .source(getSource()) - .title(getTitle()) - .type(getType()); + .title(getTitle()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionEndTurn.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionEndTurn.java new file mode 100644 index 0000000..e6a42d3 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionEndTurn.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Agent 自然完成本轮,准备接收下一条用户消息。 + */ +@JsonPropertyOrder({ + ManagedAgentsSessionEndTurn.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ManagedAgentsSessionEndTurn implements ManagedAgentsSessionStopReason { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ManagedAgentsSessionStopReasonType type = ManagedAgentsSessionStopReasonType.END_TURN; + + public ManagedAgentsSessionEndTurn() { + } + + public ManagedAgentsSessionEndTurn type(@javax.annotation.Nonnull ManagedAgentsSessionStopReasonType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ManagedAgentsSessionStopReasonType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ManagedAgentsSessionStopReasonType type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedAgentsSessionEndTurn managedAgentsSessionEndTurn = (ManagedAgentsSessionEndTurn) o; + return Objects.equals(this.type, managedAgentsSessionEndTurn.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedAgentsSessionEndTurn {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ManagedAgentsSessionEndTurn instance; + + public Builder() { + this(new ManagedAgentsSessionEndTurn()); + } + + protected Builder(ManagedAgentsSessionEndTurn instance) { + this.instance = instance; + } + + public ManagedAgentsSessionEndTurn.Builder type(ManagedAgentsSessionStopReasonType type) { + this.instance.type = type; + return this; + } + + + /** + * returns a built ManagedAgentsSessionEndTurn instance. + * + * The builder is not reusable. + */ + public ManagedAgentsSessionEndTurn build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ManagedAgentsSessionEndTurn.Builder builder() { + return new ManagedAgentsSessionEndTurn.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ManagedAgentsSessionEndTurn.Builder toBuilder() { + return new ManagedAgentsSessionEndTurn.Builder() + .type(getType()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionEvent.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionEvent.java index f24b9d2..ba9fe83 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionEvent.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionEvent.java @@ -27,7 +27,8 @@ @JsonPropertyOrder({ ManagedAgentsSessionEvent.JSON_PROPERTY_TYPE, ManagedAgentsSessionEvent.JSON_PROPERTY_ID, - ManagedAgentsSessionEvent.JSON_PROPERTY_PROCESSED_AT + ManagedAgentsSessionEvent.JSON_PROPERTY_PROCESSED_AT, + ManagedAgentsSessionEvent.JSON_PROPERTY_STOP_REASON }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class ManagedAgentsSessionEvent { @@ -43,6 +44,10 @@ public class ManagedAgentsSessionEvent { @javax.annotation.Nullable private String processedAt; + public static final String JSON_PROPERTY_STOP_REASON = "stop_reason"; + @javax.annotation.Nullable + private ManagedAgentsSessionStopReason stopReason; + public ManagedAgentsSessionEvent() { } @@ -121,6 +126,31 @@ public void setProcessedAt(@javax.annotation.Nullable String processedAt) { this.processedAt = processedAt; } + public ManagedAgentsSessionEvent stopReason(@javax.annotation.Nullable ManagedAgentsSessionStopReason stopReason) { + + this.stopReason = stopReason; + return this; + } + + /** + * `session.status_idle` / `session.thread_status_idle` 的停止原因。 + * @return stopReason + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STOP_REASON, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ManagedAgentsSessionStopReason getStopReason() { + return stopReason; + } + + + @JsonProperty(value = JSON_PROPERTY_STOP_REASON, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStopReason(@javax.annotation.Nullable ManagedAgentsSessionStopReason stopReason) { + this.stopReason = stopReason; + } + @Override public boolean equals(Object o) { @@ -133,12 +163,13 @@ public boolean equals(Object o) { ManagedAgentsSessionEvent managedAgentsSessionEvent = (ManagedAgentsSessionEvent) o; return Objects.equals(this.type, managedAgentsSessionEvent.type) && Objects.equals(this.id, managedAgentsSessionEvent.id) && - Objects.equals(this.processedAt, managedAgentsSessionEvent.processedAt); + Objects.equals(this.processedAt, managedAgentsSessionEvent.processedAt) && + Objects.equals(this.stopReason, managedAgentsSessionEvent.stopReason); } @Override public int hashCode() { - return Objects.hash(type, id, processedAt); + return Objects.hash(type, id, processedAt, stopReason); } @Override @@ -148,6 +179,7 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" processedAt: ").append(toIndentedString(processedAt)).append("\n"); + sb.append(" stopReason: ").append(toIndentedString(stopReason)).append("\n"); sb.append("}"); return sb.toString(); } @@ -184,6 +216,10 @@ public ManagedAgentsSessionEvent.Builder processedAt(String processedAt) { this.instance.processedAt = processedAt; return this; } + public ManagedAgentsSessionEvent.Builder stopReason(ManagedAgentsSessionStopReason stopReason) { + this.instance.stopReason = stopReason; + return this; + } /** @@ -220,7 +256,8 @@ public ManagedAgentsSessionEvent.Builder toBuilder() { return new ManagedAgentsSessionEvent.Builder() .type(getType()) .id(getId()) - .processedAt(getProcessedAt()); + .processedAt(getProcessedAt()) + .stopReason(getStopReason()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionRequiresAction.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionRequiresAction.java new file mode 100644 index 0000000..47b82ee --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionRequiresAction.java @@ -0,0 +1,200 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * Agent 正等待一个或多个阻塞性的用户输入事件。 + */ +@JsonPropertyOrder({ + ManagedAgentsSessionRequiresAction.JSON_PROPERTY_TYPE, + ManagedAgentsSessionRequiresAction.JSON_PROPERTY_EVENT_IDS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ManagedAgentsSessionRequiresAction implements ManagedAgentsSessionStopReason { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ManagedAgentsSessionStopReasonType type = ManagedAgentsSessionStopReasonType.REQUIRES_ACTION; + + public static final String JSON_PROPERTY_EVENT_IDS = "event_ids"; + @javax.annotation.Nonnull + private List eventIds; + + public ManagedAgentsSessionRequiresAction() { + } + + public ManagedAgentsSessionRequiresAction type(@javax.annotation.Nonnull ManagedAgentsSessionStopReasonType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ManagedAgentsSessionStopReasonType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ManagedAgentsSessionStopReasonType type) { + this.type = type; + } + + public ManagedAgentsSessionRequiresAction eventIds(@javax.annotation.Nonnull List eventIds) { + + this.eventIds = eventIds; + return this; + } + + public ManagedAgentsSessionRequiresAction addEventIdsItem(String eventIdsItem) { + if (this.eventIds == null) { + this.eventIds = new ArrayList<>(); + } + this.eventIds.add(eventIdsItem); + return this; + } + + /** + * 等待处理的事件 id;部分解决后,idle 事件以剩余 id 重新发出。 + * @return eventIds + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_EVENT_IDS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getEventIds() { + return eventIds; + } + + + @JsonProperty(value = JSON_PROPERTY_EVENT_IDS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEventIds(@javax.annotation.Nonnull List eventIds) { + this.eventIds = eventIds; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedAgentsSessionRequiresAction managedAgentsSessionRequiresAction = (ManagedAgentsSessionRequiresAction) o; + return Objects.equals(this.type, managedAgentsSessionRequiresAction.type) && + Objects.equals(this.eventIds, managedAgentsSessionRequiresAction.eventIds); + } + + @Override + public int hashCode() { + return Objects.hash(type, eventIds); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedAgentsSessionRequiresAction {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" eventIds: ").append(toIndentedString(eventIds)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ManagedAgentsSessionRequiresAction instance; + + public Builder() { + this(new ManagedAgentsSessionRequiresAction()); + } + + protected Builder(ManagedAgentsSessionRequiresAction instance) { + this.instance = instance; + } + + public ManagedAgentsSessionRequiresAction.Builder type(ManagedAgentsSessionStopReasonType type) { + this.instance.type = type; + return this; + } + public ManagedAgentsSessionRequiresAction.Builder eventIds(List eventIds) { + this.instance.eventIds = eventIds; + return this; + } + + + /** + * returns a built ManagedAgentsSessionRequiresAction instance. + * + * The builder is not reusable. + */ + public ManagedAgentsSessionRequiresAction build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ManagedAgentsSessionRequiresAction.Builder builder() { + return new ManagedAgentsSessionRequiresAction.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ManagedAgentsSessionRequiresAction.Builder toBuilder() { + return new ManagedAgentsSessionRequiresAction.Builder() + .type(getType()) + .eventIds(getEventIds()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionRetriesExhausted.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionRetriesExhausted.java new file mode 100644 index 0000000..3651fcf --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionRetriesExhausted.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * 重试预算用尽导致本轮终止。 + */ +@JsonPropertyOrder({ + ManagedAgentsSessionRetriesExhausted.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ManagedAgentsSessionRetriesExhausted implements ManagedAgentsSessionStopReason { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ManagedAgentsSessionStopReasonType type = ManagedAgentsSessionStopReasonType.RETRIES_EXHAUSTED; + + public ManagedAgentsSessionRetriesExhausted() { + } + + public ManagedAgentsSessionRetriesExhausted type(@javax.annotation.Nonnull ManagedAgentsSessionStopReasonType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ManagedAgentsSessionStopReasonType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ManagedAgentsSessionStopReasonType type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedAgentsSessionRetriesExhausted managedAgentsSessionRetriesExhausted = (ManagedAgentsSessionRetriesExhausted) o; + return Objects.equals(this.type, managedAgentsSessionRetriesExhausted.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedAgentsSessionRetriesExhausted {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ManagedAgentsSessionRetriesExhausted instance; + + public Builder() { + this(new ManagedAgentsSessionRetriesExhausted()); + } + + protected Builder(ManagedAgentsSessionRetriesExhausted instance) { + this.instance = instance; + } + + public ManagedAgentsSessionRetriesExhausted.Builder type(ManagedAgentsSessionStopReasonType type) { + this.instance.type = type; + return this; + } + + + /** + * returns a built ManagedAgentsSessionRetriesExhausted instance. + * + * The builder is not reusable. + */ + public ManagedAgentsSessionRetriesExhausted build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ManagedAgentsSessionRetriesExhausted.Builder builder() { + return new ManagedAgentsSessionRetriesExhausted.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ManagedAgentsSessionRetriesExhausted.Builder toBuilder() { + return new ManagedAgentsSessionRetriesExhausted.Builder() + .type(getType()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionStopReason.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionStopReason.java new file mode 100644 index 0000000..05a0375 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionStopReason.java @@ -0,0 +1,32 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ManagedAgentsSessionEndTurn.class, name = "end_turn"), + @JsonSubTypes.Type(value = ManagedAgentsSessionRequiresAction.class, name = "requires_action"), + @JsonSubTypes.Type(value = ManagedAgentsSessionRetriesExhausted.class, name = "retries_exhausted"), +}) + +public interface ManagedAgentsSessionStopReason { + public ManagedAgentsSessionStopReasonType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionStopReasonType.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionStopReasonType.java new file mode 100644 index 0000000..59a055c --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsSessionStopReasonType.java @@ -0,0 +1,59 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ManagedAgentsSessionStopReasonType + */ +public enum ManagedAgentsSessionStopReasonType { + + END_TURN("end_turn"), + + REQUIRES_ACTION("requires_action"), + + RETRIES_EXHAUSTED("retries_exhausted"); + + private String value; + + ManagedAgentsSessionStopReasonType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ManagedAgentsSessionStopReasonType fromValue(String value) { + for (ManagedAgentsSessionStopReasonType b : ManagedAgentsSessionStopReasonType.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsTextBlock.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsTextBlock.java index 5bc2a77..1720531 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsTextBlock.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsTextBlock.java @@ -25,70 +25,70 @@ * 文本块。用于 user.message / tool_result / system.message 的 content 列表。 */ @JsonPropertyOrder({ - ManagedAgentsTextBlock.JSON_PROPERTY_TEXT, - ManagedAgentsTextBlock.JSON_PROPERTY_TYPE + ManagedAgentsTextBlock.JSON_PROPERTY_TYPE, + ManagedAgentsTextBlock.JSON_PROPERTY_TEXT }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class ManagedAgentsTextBlock implements ManagedAgentsMessageContentBlock, ManagedAgentsToolResultContentBlock { - public static final String JSON_PROPERTY_TEXT = "text"; - @javax.annotation.Nonnull - private String text; - public static final String JSON_PROPERTY_TYPE = "type"; @javax.annotation.Nonnull private ContentBlockType type = ContentBlockType.TEXT; + public static final String JSON_PROPERTY_TEXT = "text"; + @javax.annotation.Nonnull + private String text; + public ManagedAgentsTextBlock() { } - public ManagedAgentsTextBlock text(@javax.annotation.Nonnull String text) { + public ManagedAgentsTextBlock type(@javax.annotation.Nonnull ContentBlockType type) { - this.text = text; + this.type = type; return this; } /** - * 文本内容。 - * @return text + * Get type + * @return type */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getText() { - return text; + public ContentBlockType getType() { + return type; } - @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setText(@javax.annotation.Nonnull String text) { - this.text = text; + public void setType(@javax.annotation.Nonnull ContentBlockType type) { + this.type = type; } - public ManagedAgentsTextBlock type(@javax.annotation.Nonnull ContentBlockType type) { + public ManagedAgentsTextBlock text(@javax.annotation.Nonnull String text) { - this.type = type; + this.text = text; return this; } /** - * Get type - * @return type + * 文本内容。 + * @return text */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ContentBlockType getType() { - return type; + public String getText() { + return text; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull ContentBlockType type) { - this.type = type; + public void setText(@javax.annotation.Nonnull String text) { + this.text = text; } @@ -101,21 +101,21 @@ public boolean equals(Object o) { return false; } ManagedAgentsTextBlock managedAgentsTextBlock = (ManagedAgentsTextBlock) o; - return Objects.equals(this.text, managedAgentsTextBlock.text) && - Objects.equals(this.type, managedAgentsTextBlock.type); + return Objects.equals(this.type, managedAgentsTextBlock.type) && + Objects.equals(this.text, managedAgentsTextBlock.text); } @Override public int hashCode() { - return Objects.hash(text, type); + return Objects.hash(type, text); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ManagedAgentsTextBlock {\n"); - sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append("}"); return sb.toString(); } @@ -140,14 +140,14 @@ protected Builder(ManagedAgentsTextBlock instance) { this.instance = instance; } - public ManagedAgentsTextBlock.Builder text(String text) { - this.instance.text = text; - return this; - } public ManagedAgentsTextBlock.Builder type(ContentBlockType type) { this.instance.type = type; return this; } + public ManagedAgentsTextBlock.Builder text(String text) { + this.instance.text = text; + return this; + } /** @@ -182,8 +182,8 @@ public static ManagedAgentsTextBlock.Builder builder() { */ public ManagedAgentsTextBlock.Builder toBuilder() { return new ManagedAgentsTextBlock.Builder() - .text(getText()) - .type(getType()); + .type(getType()) + .text(getText()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsToolResultContentBlock.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsToolResultContentBlock.java index 9d5ad53..e46e371 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsToolResultContentBlock.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsToolResultContentBlock.java @@ -26,6 +26,7 @@ @JsonSubTypes.Type(value = ManagedAgentsImageBlock.class, name = "image"), @JsonSubTypes.Type(value = ManagedAgentsSearchResultBlock.class, name = "search_result"), @JsonSubTypes.Type(value = ManagedAgentsTextBlock.class, name = "text"), + @JsonSubTypes.Type(value = ManagedAgentsVideoBlock.class, name = "video"), }) public interface ManagedAgentsToolResultContentBlock { diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsUserMessageEventParams.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsUserMessageEventParams.java index 6cb3d87..4c2053e 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsUserMessageEventParams.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsUserMessageEventParams.java @@ -63,7 +63,7 @@ public ManagedAgentsUserMessageEventParams addContentItem(ManagedAgentsMessageCo } /** - * 消息 content:多模态 block 列表(text / image / document)。 + * 消息 content:多模态 block 列表(text / image / document / video)。 * @return content */ @javax.annotation.Nullable diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsVideoBlock.java b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsVideoBlock.java new file mode 100644 index 0000000..3970486 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/ManagedAgentsVideoBlock.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * 视频块;支持 base64 / URL / file 来源。 + */ +@JsonPropertyOrder({ + ManagedAgentsVideoBlock.JSON_PROPERTY_TYPE, + ManagedAgentsVideoBlock.JSON_PROPERTY_SOURCE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ManagedAgentsVideoBlock implements ManagedAgentsMessageContentBlock, ManagedAgentsToolResultContentBlock { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentBlockType type = ContentBlockType.VIDEO; + + public static final String JSON_PROPERTY_SOURCE = "source"; + @javax.annotation.Nonnull + private VideoSource source; + + public ManagedAgentsVideoBlock() { + } + + public ManagedAgentsVideoBlock type(@javax.annotation.Nonnull ContentBlockType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ContentBlockType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentBlockType type) { + this.type = type; + } + + public ManagedAgentsVideoBlock source(@javax.annotation.Nonnull VideoSource source) { + + this.source = source; + return this; + } + + /** + * 视频来源。 + * @return source + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public VideoSource getSource() { + return source; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSource(@javax.annotation.Nonnull VideoSource source) { + this.source = source; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManagedAgentsVideoBlock managedAgentsVideoBlock = (ManagedAgentsVideoBlock) o; + return Objects.equals(this.type, managedAgentsVideoBlock.type) && + Objects.equals(this.source, managedAgentsVideoBlock.source); + } + + @Override + public int hashCode() { + return Objects.hash(type, source); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManagedAgentsVideoBlock {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ManagedAgentsVideoBlock instance; + + public Builder() { + this(new ManagedAgentsVideoBlock()); + } + + protected Builder(ManagedAgentsVideoBlock instance) { + this.instance = instance; + } + + public ManagedAgentsVideoBlock.Builder type(ContentBlockType type) { + this.instance.type = type; + return this; + } + public ManagedAgentsVideoBlock.Builder source(VideoSource source) { + this.instance.source = source; + return this; + } + + + /** + * returns a built ManagedAgentsVideoBlock instance. + * + * The builder is not reusable. + */ + public ManagedAgentsVideoBlock build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ManagedAgentsVideoBlock.Builder builder() { + return new ManagedAgentsVideoBlock.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ManagedAgentsVideoBlock.Builder toBuilder() { + return new ManagedAgentsVideoBlock.Builder() + .type(getType()) + .source(getSource()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/PlainTextDocumentSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/PlainTextDocumentSource.java index 7fbdfc9..a5339dd 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/PlainTextDocumentSource.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/PlainTextDocumentSource.java @@ -25,12 +25,16 @@ * 纯文本文档;`media_type` 必须为 `text/plain`;`data` 是原文。 */ @JsonPropertyOrder({ + PlainTextDocumentSource.JSON_PROPERTY_TYPE, PlainTextDocumentSource.JSON_PROPERTY_DATA, - PlainTextDocumentSource.JSON_PROPERTY_MEDIA_TYPE, - PlainTextDocumentSource.JSON_PROPERTY_TYPE + PlainTextDocumentSource.JSON_PROPERTY_MEDIA_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class PlainTextDocumentSource implements DocumentSource { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private DocumentSourceType type = DocumentSourceType.TEXT; + public static final String JSON_PROPERTY_DATA = "data"; @javax.annotation.Nonnull private String data; @@ -39,11 +43,32 @@ public class PlainTextDocumentSource implements DocumentSource { @javax.annotation.Nonnull private String mediaType; - public static final String JSON_PROPERTY_TYPE = "type"; + public PlainTextDocumentSource() { + } + + public PlainTextDocumentSource type(@javax.annotation.Nonnull DocumentSourceType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ @javax.annotation.Nonnull - private DocumentSourceType type = DocumentSourceType.TEXT; + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) - public PlainTextDocumentSource() { + public DocumentSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull DocumentSourceType type) { + this.type = type; } public PlainTextDocumentSource data(@javax.annotation.Nonnull String data) { @@ -96,31 +121,6 @@ public void setMediaType(@javax.annotation.Nonnull String mediaType) { this.mediaType = mediaType; } - public PlainTextDocumentSource type(@javax.annotation.Nonnull DocumentSourceType type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public DocumentSourceType getType() { - return type; - } - - - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull DocumentSourceType type) { - this.type = type; - } - @Override public boolean equals(Object o) { @@ -131,23 +131,23 @@ public boolean equals(Object o) { return false; } PlainTextDocumentSource plainTextDocumentSource = (PlainTextDocumentSource) o; - return Objects.equals(this.data, plainTextDocumentSource.data) && - Objects.equals(this.mediaType, plainTextDocumentSource.mediaType) && - Objects.equals(this.type, plainTextDocumentSource.type); + return Objects.equals(this.type, plainTextDocumentSource.type) && + Objects.equals(this.data, plainTextDocumentSource.data) && + Objects.equals(this.mediaType, plainTextDocumentSource.mediaType); } @Override public int hashCode() { - return Objects.hash(data, mediaType, type); + return Objects.hash(type, data, mediaType); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PlainTextDocumentSource {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append("}"); return sb.toString(); } @@ -172,6 +172,10 @@ protected Builder(PlainTextDocumentSource instance) { this.instance = instance; } + public PlainTextDocumentSource.Builder type(DocumentSourceType type) { + this.instance.type = type; + return this; + } public PlainTextDocumentSource.Builder data(String data) { this.instance.data = data; return this; @@ -180,10 +184,6 @@ public PlainTextDocumentSource.Builder mediaType(String mediaType) { this.instance.mediaType = mediaType; return this; } - public PlainTextDocumentSource.Builder type(DocumentSourceType type) { - this.instance.type = type; - return this; - } /** @@ -218,9 +218,9 @@ public static PlainTextDocumentSource.Builder builder() { */ public PlainTextDocumentSource.Builder toBuilder() { return new PlainTextDocumentSource.Builder() + .type(getType()) .data(getData()) - .mediaType(getMediaType()) - .type(getType()); + .mediaType(getMediaType()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/SearchResultContent.java b/src/main/java/com/volcengine/ark/runtime/models/session/SearchResultContent.java index 111b870..95747d0 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/SearchResultContent.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/SearchResultContent.java @@ -16,19 +16,59 @@ package com.volcengine.ark.runtime.models.session; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.Objects; /** * 搜索结果内的纯文本片段。 */ @JsonPropertyOrder({ + SearchResultContent.JSON_PROPERTY_TYPE, SearchResultContent.JSON_PROPERTY_TEXT }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class SearchResultContent { + /** + * Gets or Sets type + */ + public enum TypeEnum { + TEXT(String.valueOf("text")); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private TypeEnum type; + public static final String JSON_PROPERTY_TEXT = "text"; @javax.annotation.Nonnull private String text; @@ -36,6 +76,31 @@ public class SearchResultContent { public SearchResultContent() { } + public SearchResultContent type(@javax.annotation.Nonnull TypeEnum type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TypeEnum getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + public SearchResultContent text(@javax.annotation.Nonnull String text) { this.text = text; @@ -71,18 +136,20 @@ public boolean equals(Object o) { return false; } SearchResultContent searchResultContent = (SearchResultContent) o; - return Objects.equals(this.text, searchResultContent.text); + return Objects.equals(this.type, searchResultContent.type) && + Objects.equals(this.text, searchResultContent.text); } @Override public int hashCode() { - return Objects.hash(text); + return Objects.hash(type, text); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class SearchResultContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" text: ").append(toIndentedString(text)).append("\n"); sb.append("}"); return sb.toString(); @@ -108,6 +175,10 @@ protected Builder(SearchResultContent instance) { this.instance = instance; } + public SearchResultContent.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } public SearchResultContent.Builder text(String text) { this.instance.text = text; return this; @@ -146,6 +217,7 @@ public static SearchResultContent.Builder builder() { */ public SearchResultContent.Builder toBuilder() { return new SearchResultContent.Builder() + .type(getType()) .text(getText()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/UrlDocumentSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/UrlDocumentSource.java index 45526ea..eaa829f 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/UrlDocumentSource.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/UrlDocumentSource.java @@ -25,70 +25,70 @@ * 通过 URL 引用的文档。 */ @JsonPropertyOrder({ - UrlDocumentSource.JSON_PROPERTY_URL, - UrlDocumentSource.JSON_PROPERTY_TYPE + UrlDocumentSource.JSON_PROPERTY_TYPE, + UrlDocumentSource.JSON_PROPERTY_URL }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class UrlDocumentSource implements DocumentSource { - public static final String JSON_PROPERTY_URL = "url"; - @javax.annotation.Nonnull - private String url; - public static final String JSON_PROPERTY_TYPE = "type"; @javax.annotation.Nonnull private DocumentSourceType type = DocumentSourceType.URL; + public static final String JSON_PROPERTY_URL = "url"; + @javax.annotation.Nonnull + private String url; + public UrlDocumentSource() { } - public UrlDocumentSource url(@javax.annotation.Nonnull String url) { + public UrlDocumentSource type(@javax.annotation.Nonnull DocumentSourceType type) { - this.url = url; + this.type = type; return this; } /** - * 文档 URL。 - * @return url + * Get type + * @return type */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_URL, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getUrl() { - return url; + public DocumentSourceType getType() { + return type; } - @JsonProperty(value = JSON_PROPERTY_URL, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUrl(@javax.annotation.Nonnull String url) { - this.url = url; + public void setType(@javax.annotation.Nonnull DocumentSourceType type) { + this.type = type; } - public UrlDocumentSource type(@javax.annotation.Nonnull DocumentSourceType type) { + public UrlDocumentSource url(@javax.annotation.Nonnull String url) { - this.type = type; + this.url = url; return this; } /** - * Get type - * @return type + * 文档 URL。 + * @return url */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_URL, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public DocumentSourceType getType() { - return type; + public String getUrl() { + return url; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_URL, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull DocumentSourceType type) { - this.type = type; + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; } @@ -101,21 +101,21 @@ public boolean equals(Object o) { return false; } UrlDocumentSource urlDocumentSource = (UrlDocumentSource) o; - return Objects.equals(this.url, urlDocumentSource.url) && - Objects.equals(this.type, urlDocumentSource.type); + return Objects.equals(this.type, urlDocumentSource.type) && + Objects.equals(this.url, urlDocumentSource.url); } @Override public int hashCode() { - return Objects.hash(url, type); + return Objects.hash(type, url); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UrlDocumentSource {\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); sb.append("}"); return sb.toString(); } @@ -140,14 +140,14 @@ protected Builder(UrlDocumentSource instance) { this.instance = instance; } - public UrlDocumentSource.Builder url(String url) { - this.instance.url = url; - return this; - } public UrlDocumentSource.Builder type(DocumentSourceType type) { this.instance.type = type; return this; } + public UrlDocumentSource.Builder url(String url) { + this.instance.url = url; + return this; + } /** @@ -182,8 +182,8 @@ public static UrlDocumentSource.Builder builder() { */ public UrlDocumentSource.Builder toBuilder() { return new UrlDocumentSource.Builder() - .url(getUrl()) - .type(getType()); + .type(getType()) + .url(getUrl()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/UrlImageSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/UrlImageSource.java index b6014fa..404bf9c 100644 --- a/src/main/java/com/volcengine/ark/runtime/models/session/UrlImageSource.java +++ b/src/main/java/com/volcengine/ark/runtime/models/session/UrlImageSource.java @@ -25,70 +25,70 @@ * 通过 URL 引用的图片。 */ @JsonPropertyOrder({ - UrlImageSource.JSON_PROPERTY_URL, - UrlImageSource.JSON_PROPERTY_TYPE + UrlImageSource.JSON_PROPERTY_TYPE, + UrlImageSource.JSON_PROPERTY_URL }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") public class UrlImageSource implements ImageSource { - public static final String JSON_PROPERTY_URL = "url"; - @javax.annotation.Nonnull - private String url; - public static final String JSON_PROPERTY_TYPE = "type"; @javax.annotation.Nonnull private ImageSourceType type = ImageSourceType.URL; + public static final String JSON_PROPERTY_URL = "url"; + @javax.annotation.Nonnull + private String url; + public UrlImageSource() { } - public UrlImageSource url(@javax.annotation.Nonnull String url) { + public UrlImageSource type(@javax.annotation.Nonnull ImageSourceType type) { - this.url = url; + this.type = type; return this; } /** - * 图片 URL。 - * @return url + * Get type + * @return type */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_URL, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getUrl() { - return url; + public ImageSourceType getType() { + return type; } - @JsonProperty(value = JSON_PROPERTY_URL, required = true) + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUrl(@javax.annotation.Nonnull String url) { - this.url = url; + public void setType(@javax.annotation.Nonnull ImageSourceType type) { + this.type = type; } - public UrlImageSource type(@javax.annotation.Nonnull ImageSourceType type) { + public UrlImageSource url(@javax.annotation.Nonnull String url) { - this.type = type; + this.url = url; return this; } /** - * Get type - * @return type + * 图片 URL。 + * @return url */ @javax.annotation.Nonnull - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_URL, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ImageSourceType getType() { - return type; + public String getUrl() { + return url; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonProperty(value = JSON_PROPERTY_URL, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setType(@javax.annotation.Nonnull ImageSourceType type) { - this.type = type; + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; } @@ -101,21 +101,21 @@ public boolean equals(Object o) { return false; } UrlImageSource urlImageSource = (UrlImageSource) o; - return Objects.equals(this.url, urlImageSource.url) && - Objects.equals(this.type, urlImageSource.type); + return Objects.equals(this.type, urlImageSource.type) && + Objects.equals(this.url, urlImageSource.url); } @Override public int hashCode() { - return Objects.hash(url, type); + return Objects.hash(type, url); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class UrlImageSource {\n"); - sb.append(" url: ").append(toIndentedString(url)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); sb.append("}"); return sb.toString(); } @@ -140,14 +140,14 @@ protected Builder(UrlImageSource instance) { this.instance = instance; } - public UrlImageSource.Builder url(String url) { - this.instance.url = url; - return this; - } public UrlImageSource.Builder type(ImageSourceType type) { this.instance.type = type; return this; } + public UrlImageSource.Builder url(String url) { + this.instance.url = url; + return this; + } /** @@ -182,8 +182,8 @@ public static UrlImageSource.Builder builder() { */ public UrlImageSource.Builder toBuilder() { return new UrlImageSource.Builder() - .url(getUrl()) - .type(getType()); + .type(getType()) + .url(getUrl()); } diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/UrlVideoSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/UrlVideoSource.java new file mode 100644 index 0000000..a189de2 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/UrlVideoSource.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * 通过 URL 引用的视频。 + */ +@JsonPropertyOrder({ + UrlVideoSource.JSON_PROPERTY_TYPE, + UrlVideoSource.JSON_PROPERTY_URL, + UrlVideoSource.JSON_PROPERTY_FPS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class UrlVideoSource implements VideoSource { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private VideoSourceType type = VideoSourceType.URL; + + public static final String JSON_PROPERTY_URL = "url"; + @javax.annotation.Nonnull + private String url; + + public static final String JSON_PROPERTY_FPS = "fps"; + @javax.annotation.Nullable + private Double fps; + + public UrlVideoSource() { + } + + public UrlVideoSource type(@javax.annotation.Nonnull VideoSourceType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public VideoSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull VideoSourceType type) { + this.type = type; + } + + public UrlVideoSource url(@javax.annotation.Nonnull String url) { + + this.url = url; + return this; + } + + /** + * 视频 URL。 + * @return url + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_URL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUrl(@javax.annotation.Nonnull String url) { + this.url = url; + } + + public UrlVideoSource fps(@javax.annotation.Nullable Double fps) { + + this.fps = fps; + return this; + } + + /** + * 视频抽帧帧率;省略时由下游模型默认策略决定。 + * @return fps + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getFps() { + return fps; + } + + + @JsonProperty(value = JSON_PROPERTY_FPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFps(@javax.annotation.Nullable Double fps) { + this.fps = fps; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UrlVideoSource urlVideoSource = (UrlVideoSource) o; + return Objects.equals(this.type, urlVideoSource.type) && + Objects.equals(this.url, urlVideoSource.url) && + Objects.equals(this.fps, urlVideoSource.fps); + } + + @Override + public int hashCode() { + return Objects.hash(type, url, fps); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UrlVideoSource {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" fps: ").append(toIndentedString(fps)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private UrlVideoSource instance; + + public Builder() { + this(new UrlVideoSource()); + } + + protected Builder(UrlVideoSource instance) { + this.instance = instance; + } + + public UrlVideoSource.Builder type(VideoSourceType type) { + this.instance.type = type; + return this; + } + public UrlVideoSource.Builder url(String url) { + this.instance.url = url; + return this; + } + public UrlVideoSource.Builder fps(Double fps) { + this.instance.fps = fps; + return this; + } + + + /** + * returns a built UrlVideoSource instance. + * + * The builder is not reusable. + */ + public UrlVideoSource build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static UrlVideoSource.Builder builder() { + return new UrlVideoSource.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public UrlVideoSource.Builder toBuilder() { + return new UrlVideoSource.Builder() + .type(getType()) + .url(getUrl()) + .fps(getFps()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/VideoSource.java b/src/main/java/com/volcengine/ark/runtime/models/session/VideoSource.java new file mode 100644 index 0000000..c3a3a95 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/VideoSource.java @@ -0,0 +1,32 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = Base64VideoSource.class, name = "base64"), + @JsonSubTypes.Type(value = FileVideoSource.class, name = "file"), + @JsonSubTypes.Type(value = UrlVideoSource.class, name = "url"), +}) + +public interface VideoSource { + public VideoSourceType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/session/VideoSourceType.java b/src/main/java/com/volcengine/ark/runtime/models/session/VideoSourceType.java new file mode 100644 index 0000000..69b9e80 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/session/VideoSourceType.java @@ -0,0 +1,59 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Managed Agents Session API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.session; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets VideoSourceType + */ +public enum VideoSourceType { + + BASE64("base64"), + + FILE("file"), + + URL("url"); + + private String value; + + VideoSourceType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static VideoSourceType fromValue(String value) { + for (VideoSourceType b : VideoSourceType.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/Answer.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/Answer.java new file mode 100644 index 0000000..c7a7fbc --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/Answer.java @@ -0,0 +1,33 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChoiceAnswer.class, name = "choice"), + @JsonSubTypes.Type(value = NoulAnswer.class, name = "noul"), + @JsonSubTypes.Type(value = ScoreAnswer.class, name = "score"), +}) + +@com.volcengine.ark.runtime.utils.UnknownVariantFallback(UnknownAnswer.class) +public interface Answer { + public AnswerType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/AnswerType.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/AnswerType.java new file mode 100644 index 0000000..0949109 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/AnswerType.java @@ -0,0 +1,63 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets AnswerType + */ +public enum AnswerType { + + // SDK-only sentinel; original unknown wire value lives on UnknownVariant. + UNKNOWN("__ark_unknown_variant__"), + + CHOICE("choice"), + + NOUL("noul"), + + SCORE("score"); + + private String value; + + AnswerType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static AnswerType fromValue(String value) { + for (AnswerType b : AnswerType.values()) { + if (b == UNKNOWN) continue; + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/AudioContent.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/AudioContent.java new file mode 100644 index 0000000..31b9b15 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/AudioContent.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Audio, supplied by exactly one of audio_url or file_id. Audio is evaluated as audio input; the response does not include a transcription. + */ +@JsonPropertyOrder({ + AudioContent.JSON_PROPERTY_TYPE, + AudioContent.JSON_PROPERTY_AUDIO_URL, + AudioContent.JSON_PROPERTY_FILE_ID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class AudioContent implements StateContent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private StateContentType type = StateContentType.AUDIO; + + public static final String JSON_PROPERTY_AUDIO_URL = "audio_url"; + @javax.annotation.Nullable + private String audioUrl; + + public static final String JSON_PROPERTY_FILE_ID = "file_id"; + @javax.annotation.Nullable + private String fileId; + + public AudioContent() { + } + + public AudioContent type(@javax.annotation.Nonnull StateContentType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StateContentType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull StateContentType type) { + this.type = type; + } + + public AudioContent audioUrl(@javax.annotation.Nullable String audioUrl) { + + this.audioUrl = audioUrl; + return this; + } + + /** + * Public HTTP(S) URL or data:audio/<format>;base64,<encoded-audio>. Mutually exclusive with file_id. + * @return audioUrl + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_AUDIO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getAudioUrl() { + return audioUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_AUDIO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAudioUrl(@javax.annotation.Nullable String audioUrl) { + this.audioUrl = audioUrl; + } + + public AudioContent fileId(@javax.annotation.Nullable String fileId) { + + this.fileId = fileId; + return this; + } + + /** + * Active audio file ID from the Files API. Mutually exclusive with audio_url. + * @return fileId + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFileId() { + return fileId; + } + + + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileId(@javax.annotation.Nullable String fileId) { + this.fileId = fileId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AudioContent audioContent = (AudioContent) o; + return Objects.equals(this.type, audioContent.type) && + Objects.equals(this.audioUrl, audioContent.audioUrl) && + Objects.equals(this.fileId, audioContent.fileId); + } + + @Override + public int hashCode() { + return Objects.hash(type, audioUrl, fileId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AudioContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" audioUrl: ").append(toIndentedString(audioUrl)).append("\n"); + sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private AudioContent instance; + + public Builder() { + this(new AudioContent()); + } + + protected Builder(AudioContent instance) { + this.instance = instance; + } + + public AudioContent.Builder type(StateContentType type) { + this.instance.type = type; + return this; + } + public AudioContent.Builder audioUrl(String audioUrl) { + this.instance.audioUrl = audioUrl; + return this; + } + public AudioContent.Builder fileId(String fileId) { + this.instance.fileId = fileId; + return this; + } + + + /** + * returns a built AudioContent instance. + * + * The builder is not reusable. + */ + public AudioContent build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static AudioContent.Builder builder() { + return new AudioContent.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public AudioContent.Builder toBuilder() { + return new AudioContent.Builder() + .type(getType()) + .audioUrl(getAudioUrl()) + .fileId(getFileId()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ChoiceAnswer.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ChoiceAnswer.java new file mode 100644 index 0000000..0b28aa0 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ChoiceAnswer.java @@ -0,0 +1,272 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Map; +import java.util.Objects; + +/** + * Most likely choice and the probability of every supplied option. + */ +@JsonPropertyOrder({ + ChoiceAnswer.JSON_PROPERTY_TYPE, + ChoiceAnswer.JSON_PROPERTY_CHOICE, + ChoiceAnswer.JSON_PROPERTY_PROBABILITIES, + ChoiceAnswer.JSON_PROPERTY_CONFIDENCE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ChoiceAnswer implements Answer { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private AnswerType type = AnswerType.CHOICE; + + public static final String JSON_PROPERTY_CHOICE = "choice"; + @javax.annotation.Nonnull + private String choice; + + public static final String JSON_PROPERTY_PROBABILITIES = "probabilities"; + @javax.annotation.Nonnull + private Map probabilities; + + public static final String JSON_PROPERTY_CONFIDENCE = "confidence"; + @javax.annotation.Nonnull + private Double confidence; + + public ChoiceAnswer() { + } + + public ChoiceAnswer type(@javax.annotation.Nonnull AnswerType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AnswerType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull AnswerType type) { + this.type = type; + } + + public ChoiceAnswer choice(@javax.annotation.Nonnull String choice) { + + this.choice = choice; + return this; + } + + /** + * An option with the maximum probability, using the original criteria key. + * @return choice + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CHOICE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getChoice() { + return choice; + } + + + @JsonProperty(value = JSON_PROPERTY_CHOICE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setChoice(@javax.annotation.Nonnull String choice) { + this.choice = choice; + } + + public ChoiceAnswer probabilities(@javax.annotation.Nonnull Map probabilities) { + + this.probabilities = probabilities; + return this; + } + + public ChoiceAnswer putProbabilitiesItem(String key, Double probabilitiesItem) { + this.probabilities.put(key, probabilitiesItem); + return this; + } + + /** + * Every option, including zero probabilities; values sum to 1 within floating-point tolerance. + * @return probabilities + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_PROBABILITIES, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Map getProbabilities() { + return probabilities; + } + + + @JsonProperty(value = JSON_PROPERTY_PROBABILITIES, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProbabilities(@javax.annotation.Nonnull Map probabilities) { + this.probabilities = probabilities; + } + + public ChoiceAnswer confidence(@javax.annotation.Nonnull Double confidence) { + + this.confidence = confidence; + return this; + } + + /** + * Confidence in the classification, from 0 to 1 inclusive. It is distinct from an individual option probability; its calculation depends on the model. + * minimum: 0 + * maximum: 1 + * @return confidence + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Double getConfidence() { + return confidence; + } + + + @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setConfidence(@javax.annotation.Nonnull Double confidence) { + this.confidence = confidence; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChoiceAnswer choiceAnswer = (ChoiceAnswer) o; + return Objects.equals(this.type, choiceAnswer.type) && + Objects.equals(this.choice, choiceAnswer.choice) && + Objects.equals(this.probabilities, choiceAnswer.probabilities) && + Objects.equals(this.confidence, choiceAnswer.confidence); + } + + @Override + public int hashCode() { + return Objects.hash(type, choice, probabilities, confidence); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChoiceAnswer {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" choice: ").append(toIndentedString(choice)).append("\n"); + sb.append(" probabilities: ").append(toIndentedString(probabilities)).append("\n"); + sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ChoiceAnswer instance; + + public Builder() { + this(new ChoiceAnswer()); + } + + protected Builder(ChoiceAnswer instance) { + this.instance = instance; + } + + public ChoiceAnswer.Builder type(AnswerType type) { + this.instance.type = type; + return this; + } + public ChoiceAnswer.Builder choice(String choice) { + this.instance.choice = choice; + return this; + } + public ChoiceAnswer.Builder probabilities(Map probabilities) { + this.instance.probabilities = probabilities; + return this; + } + public ChoiceAnswer.Builder confidence(Double confidence) { + this.instance.confidence = confidence; + return this; + } + + + /** + * returns a built ChoiceAnswer instance. + * + * The builder is not reusable. + */ + public ChoiceAnswer build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChoiceAnswer.Builder builder() { + return new ChoiceAnswer.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChoiceAnswer.Builder toBuilder() { + return new ChoiceAnswer.Builder() + .type(getType()) + .choice(getChoice()) + .probabilities(getProbabilities()) + .confidence(getConfidence()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ChoiceDescription.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ChoiceDescription.java new file mode 100644 index 0000000..6e3fda8 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ChoiceDescription.java @@ -0,0 +1,128 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.io.IOException; +import java.util.Objects; + +/** + * ChoiceDescription + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: String, java.util.Map, java.util.List). + * + * The Jackson apache-httpclient template openapi-generator runs against + * does not support non-discriminated anyOf/oneOf — it either drops to a + * degenerate empty shell or flattens one variant's fields onto the class, + * losing the others. This postprocess rewrite replaces the parent with a + * @JsonValue holder + typed static factories for write-side, plus a custom + * @JsonDeserialize that dispatches by JsonNode shape on the read-side so + * round-trips preserve variant types (string -> typed primitive/enum, + * object -> typed model, array -> typed List). + */ +@JsonDeserialize(using = ChoiceDescription.Deserializer.class) +public class ChoiceDescription { + + private final Object value; + + @JsonCreator + public ChoiceDescription(Object value) { + this.value = value; + } + + public ChoiceDescription() { + this.value = null; + } + + public static ChoiceDescription ofString(String value) { + return new ChoiceDescription(value); + } + + public static ChoiceDescription ofMap(java.util.Map value) { + return new ChoiceDescription(value); + } + + public static ChoiceDescription ofList(java.util.List value) { + return new ChoiceDescription(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public ChoiceDescription deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isTextual()) { + return new ChoiceDescription(mapper.treeToValue(node, String.class)); + } + if (node.isObject()) { + return new ChoiceDescription( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + if (node.isArray()) { + return new ChoiceDescription( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + ChoiceDescription.class, + "no ChoiceDescription variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ChoiceDescription other = (ChoiceDescription) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class ChoiceDescription {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public ChoiceDescription build() { return new ChoiceDescription(this.value); } + } + + public static ChoiceDescription.Builder builder() { return new ChoiceDescription.Builder(); } + + public ChoiceDescription.Builder toBuilder() { + return new ChoiceDescription.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ChoiceQuestion.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ChoiceQuestion.java new file mode 100644 index 0000000..bb8a598 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ChoiceQuestion.java @@ -0,0 +1,233 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Map; +import java.util.Objects; + +/** + * A classification question. The answer selects one of the supplied criteria keys. + */ +@JsonPropertyOrder({ + ChoiceQuestion.JSON_PROPERTY_TYPE, + ChoiceQuestion.JSON_PROPERTY_INSTRUCTIONS, + ChoiceQuestion.JSON_PROPERTY_CRITERIA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ChoiceQuestion implements Question { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private QuestionType type = QuestionType.CHOICE; + + public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; + @javax.annotation.Nullable + private NullableInstructions instructions; + + public static final String JSON_PROPERTY_CRITERIA = "criteria"; + @javax.annotation.Nonnull + private Map criteria; + + public ChoiceQuestion() { + } + + public ChoiceQuestion type(@javax.annotation.Nonnull QuestionType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public QuestionType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull QuestionType type) { + this.type = type; + } + + public ChoiceQuestion instructions(@javax.annotation.Nullable NullableInstructions instructions) { + + this.instructions = instructions; + return this; + } + + /** + * Optional evaluation instructions. Omitted or null uses the model's defaults; does not inherit instructions from other questions. + * @return instructions + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INSTRUCTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public NullableInstructions getInstructions() { + return instructions; + } + + + @JsonProperty(value = JSON_PROPERTY_INSTRUCTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstructions(@javax.annotation.Nullable NullableInstructions instructions) { + this.instructions = instructions; + } + + public ChoiceQuestion criteria(@javax.annotation.Nonnull Map criteria) { + + this.criteria = criteria; + return this; + } + + public ChoiceQuestion putCriteriaItem(String key, ChoiceDescription criteriaItem) { + this.criteria.put(key, criteriaItem); + return this; + } + + /** + * Candidate options and descriptions. Required; 1-255 options per question, inclusive. + * @return criteria + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CRITERIA, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + + public Map getCriteria() { + return criteria; + } + + + @JsonProperty(value = JSON_PROPERTY_CRITERIA, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setCriteria(@javax.annotation.Nonnull Map criteria) { + this.criteria = criteria; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChoiceQuestion choiceQuestion = (ChoiceQuestion) o; + return Objects.equals(this.type, choiceQuestion.type) && + Objects.equals(this.instructions, choiceQuestion.instructions) && + Objects.equals(this.criteria, choiceQuestion.criteria); + } + + @Override + public int hashCode() { + return Objects.hash(type, instructions, criteria); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChoiceQuestion {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" criteria: ").append(toIndentedString(criteria)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ChoiceQuestion instance; + + public Builder() { + this(new ChoiceQuestion()); + } + + protected Builder(ChoiceQuestion instance) { + this.instance = instance; + } + + public ChoiceQuestion.Builder type(QuestionType type) { + this.instance.type = type; + return this; + } + public ChoiceQuestion.Builder instructions(NullableInstructions instructions) { + this.instance.instructions = instructions; + return this; + } + public ChoiceQuestion.Builder criteria(Map criteria) { + this.instance.criteria = criteria; + return this; + } + + + /** + * returns a built ChoiceQuestion instance. + * + * The builder is not reusable. + */ + public ChoiceQuestion build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ChoiceQuestion.Builder builder() { + return new ChoiceQuestion.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ChoiceQuestion.Builder toBuilder() { + return new ChoiceQuestion.Builder() + .type(getType()) + .instructions(getInstructions()) + .criteria(getCriteria()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ErrorDetail.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ErrorDetail.java new file mode 100644 index 0000000..e0e6236 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ErrorDetail.java @@ -0,0 +1,264 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Public error details. Use code for programmatic handling; message can change. + */ +@JsonPropertyOrder({ + ErrorDetail.JSON_PROPERTY_CODE, + ErrorDetail.JSON_PROPERTY_MESSAGE, + ErrorDetail.JSON_PROPERTY_PARAM, + ErrorDetail.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ErrorDetail { + public static final String JSON_PROPERTY_CODE = "code"; + @javax.annotation.Nonnull + private String code; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nonnull + private String message; + + public static final String JSON_PROPERTY_PARAM = "param"; + @javax.annotation.Nonnull + private String param; + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type; + + public ErrorDetail() { + } + + public ErrorDetail code(@javax.annotation.Nonnull String code) { + + this.code = code; + return this; + } + + /** + * Stable error code, such as InvalidParameter, AuthenticationError or ServerOverloaded. + * @return code + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CODE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getCode() { + return code; + } + + + @JsonProperty(value = JSON_PROPERTY_CODE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCode(@javax.annotation.Nonnull String code) { + this.code = code; + } + + public ErrorDetail message(@javax.annotation.Nonnull String message) { + + this.message = message; + return this; + } + + /** + * Human-readable cause and, when available, the request ID. Size and length errors identify the exceeded limit and its value. Do not parse this string for business logic. + * @return message + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(@javax.annotation.Nonnull String message) { + this.message = message; + } + + public ErrorDetail param(@javax.annotation.Nonnull String param) { + + this.param = param; + return this; + } + + /** + * Invalid parameter path, such as questions[\"q\"].criteria or state[0].image_url. \"body format\" denotes invalid JSON syntax; body denotes an invalid overall request structure or an aggregate request/text limit; Content-Type denotes an invalid request media type. May be empty for errors not associated with a field or errors returned before parameter validation. + * @return param + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_PARAM, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getParam() { + return param; + } + + + @JsonProperty(value = JSON_PROPERTY_PARAM, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setParam(@javax.annotation.Nonnull String param) { + this.param = param; + } + + public ErrorDetail type(@javax.annotation.Nonnull String type) { + + this.type = type; + return this; + } + + /** + * Error category, such as BadRequest, Unauthorized or ServiceUnavailable. Prefer code when handling errors. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorDetail errorDetail = (ErrorDetail) o; + return Objects.equals(this.code, errorDetail.code) && + Objects.equals(this.message, errorDetail.message) && + Objects.equals(this.param, errorDetail.param) && + Objects.equals(this.type, errorDetail.type); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, param, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorDetail {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" param: ").append(toIndentedString(param)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ErrorDetail instance; + + public Builder() { + this(new ErrorDetail()); + } + + protected Builder(ErrorDetail instance) { + this.instance = instance; + } + + public ErrorDetail.Builder code(String code) { + this.instance.code = code; + return this; + } + public ErrorDetail.Builder message(String message) { + this.instance.message = message; + return this; + } + public ErrorDetail.Builder param(String param) { + this.instance.param = param; + return this; + } + public ErrorDetail.Builder type(String type) { + this.instance.type = type; + return this; + } + + + /** + * returns a built ErrorDetail instance. + * + * The builder is not reusable. + */ + public ErrorDetail build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ErrorDetail.Builder builder() { + return new ErrorDetail.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ErrorDetail.Builder toBuilder() { + return new ErrorDetail.Builder() + .code(getCode()) + .message(getMessage()) + .param(getParam()) + .type(getType()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ErrorResponse.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ErrorResponse.java new file mode 100644 index 0000000..a70c945 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ErrorResponse.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Standard JSON error envelope. Save the response X-Request-Id header when reporting a failure. + */ +@JsonPropertyOrder({ + ErrorResponse.JSON_PROPERTY_ERROR +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ErrorResponse { + public static final String JSON_PROPERTY_ERROR = "error"; + @javax.annotation.Nonnull + private ErrorDetail error; + + public ErrorResponse() { + } + + public ErrorResponse error(@javax.annotation.Nonnull ErrorDetail error) { + + this.error = error; + return this; + } + + /** + * Error code, description and parameter location. + * @return error + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ERROR, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ErrorDetail getError() { + return error; + } + + + @JsonProperty(value = JSON_PROPERTY_ERROR, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setError(@javax.annotation.Nonnull ErrorDetail error) { + this.error = error; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.error, errorResponse.error); + } + + @Override + public int hashCode() { + return Objects.hash(error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ErrorResponse instance; + + public Builder() { + this(new ErrorResponse()); + } + + protected Builder(ErrorResponse instance) { + this.instance = instance; + } + + public ErrorResponse.Builder error(ErrorDetail error) { + this.instance.error = error; + return this; + } + + + /** + * returns a built ErrorResponse instance. + * + * The builder is not reusable. + */ + public ErrorResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ErrorResponse.Builder builder() { + return new ErrorResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ErrorResponse.Builder toBuilder() { + return new ErrorResponse.Builder() + .error(getError()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ForbiddenResponse.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ForbiddenResponse.java new file mode 100644 index 0000000..102ae00 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ForbiddenResponse.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Access restrictions normally use the standard error object, including at the API entry. Some entry routes instead return the legacy error_code/error_msg envelope. The two envelopes are mutually exclusive; the envelope alone does not identify which component denied access. + */ +@JsonPropertyOrder({ + ForbiddenResponse.JSON_PROPERTY_ERROR, + ForbiddenResponse.JSON_PROPERTY_ERROR_CODE, + ForbiddenResponse.JSON_PROPERTY_ERROR_MSG +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ForbiddenResponse { + public static final String JSON_PROPERTY_ERROR = "error"; + @javax.annotation.Nullable + private ErrorDetail error; + + public static final String JSON_PROPERTY_ERROR_CODE = "error_code"; + @javax.annotation.Nullable + private String errorCode; + + public static final String JSON_PROPERTY_ERROR_MSG = "error_msg"; + @javax.annotation.Nullable + private String errorMsg; + + public ForbiddenResponse() { + } + + public ForbiddenResponse error(@javax.annotation.Nullable ErrorDetail error) { + + this.error = error; + return this; + } + + /** + * Standard access-denial error. If present, error_code and error_msg are absent. + * @return error + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ERROR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ErrorDetail getError() { + return error; + } + + + @JsonProperty(value = JSON_PROPERTY_ERROR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setError(@javax.annotation.Nullable ErrorDetail error) { + this.error = error; + } + + public ForbiddenResponse errorCode(@javax.annotation.Nullable String errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * Gateway error code, normally AccessDenied. Required with error_msg when error is absent. + * @return errorCode + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ERROR_CODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getErrorCode() { + return errorCode; + } + + + @JsonProperty(value = JSON_PROPERTY_ERROR_CODE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorCode(@javax.annotation.Nullable String errorCode) { + this.errorCode = errorCode; + } + + public ForbiddenResponse errorMsg(@javax.annotation.Nullable String errorMsg) { + + this.errorMsg = errorMsg; + return this; + } + + /** + * Gateway access-denial message, potentially including RequestId. Required with error_code when error is absent. + * @return errorMsg + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ERROR_MSG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getErrorMsg() { + return errorMsg; + } + + + @JsonProperty(value = JSON_PROPERTY_ERROR_MSG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorMsg(@javax.annotation.Nullable String errorMsg) { + this.errorMsg = errorMsg; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForbiddenResponse forbiddenResponse = (ForbiddenResponse) o; + return Objects.equals(this.error, forbiddenResponse.error) && + Objects.equals(this.errorCode, forbiddenResponse.errorCode) && + Objects.equals(this.errorMsg, forbiddenResponse.errorMsg); + } + + @Override + public int hashCode() { + return Objects.hash(error, errorCode, errorMsg); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForbiddenResponse {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" errorMsg: ").append(toIndentedString(errorMsg)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ForbiddenResponse instance; + + public Builder() { + this(new ForbiddenResponse()); + } + + protected Builder(ForbiddenResponse instance) { + this.instance = instance; + } + + public ForbiddenResponse.Builder error(ErrorDetail error) { + this.instance.error = error; + return this; + } + public ForbiddenResponse.Builder errorCode(String errorCode) { + this.instance.errorCode = errorCode; + return this; + } + public ForbiddenResponse.Builder errorMsg(String errorMsg) { + this.instance.errorMsg = errorMsg; + return this; + } + + + /** + * returns a built ForbiddenResponse instance. + * + * The builder is not reusable. + */ + public ForbiddenResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ForbiddenResponse.Builder builder() { + return new ForbiddenResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ForbiddenResponse.Builder toBuilder() { + return new ForbiddenResponse.Builder() + .error(getError()) + .errorCode(getErrorCode()) + .errorMsg(getErrorMsg()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ImageContent.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ImageContent.java new file mode 100644 index 0000000..8b824a2 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ImageContent.java @@ -0,0 +1,301 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * An image, supplied by exactly one of image_url or file_id. Missing or conflicting sources return 400. + */ +@JsonPropertyOrder({ + ImageContent.JSON_PROPERTY_TYPE, + ImageContent.JSON_PROPERTY_IMAGE_URL, + ImageContent.JSON_PROPERTY_FILE_ID, + ImageContent.JSON_PROPERTY_DETAIL, + ImageContent.JSON_PROPERTY_IMAGE_PIXEL_LIMIT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ImageContent implements StateContent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private StateContentType type = StateContentType.IMAGE; + + public static final String JSON_PROPERTY_IMAGE_URL = "image_url"; + @javax.annotation.Nullable + private String imageUrl; + + public static final String JSON_PROPERTY_FILE_ID = "file_id"; + @javax.annotation.Nullable + private String fileId; + + public static final String JSON_PROPERTY_DETAIL = "detail"; + @javax.annotation.Nullable + private ImageDetail detail; + + public static final String JSON_PROPERTY_IMAGE_PIXEL_LIMIT = "image_pixel_limit"; + @javax.annotation.Nullable + private ImagePixelLimit imagePixelLimit; + + public ImageContent() { + } + + public ImageContent type(@javax.annotation.Nonnull StateContentType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StateContentType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull StateContentType type) { + this.type = type; + } + + public ImageContent imageUrl(@javax.annotation.Nullable String imageUrl) { + + this.imageUrl = imageUrl; + return this; + } + + /** + * Public HTTP(S) URL or data:image/<format>;base64,<encoded-image>. Mutually exclusive with file_id. + * @return imageUrl + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IMAGE_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getImageUrl() { + return imageUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_IMAGE_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + public ImageContent fileId(@javax.annotation.Nullable String fileId) { + + this.fileId = fileId; + return this; + } + + /** + * Active image file ID from the Files API. Mutually exclusive with image_url. + * @return fileId + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFileId() { + return fileId; + } + + + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileId(@javax.annotation.Nullable String fileId) { + this.fileId = fileId; + } + + public ImageContent detail(@javax.annotation.Nullable ImageDetail detail) { + + this.detail = detail; + return this; + } + + /** + * Analysis detail: low or high. Omitted means high. image_pixel_limit takes precedence when supplied, but does not make an unsupported detail valid. + * @return detail + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DETAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ImageDetail getDetail() { + return detail; + } + + + @JsonProperty(value = JSON_PROPERTY_DETAIL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetail(@javax.annotation.Nullable ImageDetail detail) { + this.detail = detail; + } + + public ImageContent imagePixelLimit(@javax.annotation.Nullable ImagePixelLimit imagePixelLimit) { + + this.imagePixelLimit = imagePixelLimit; + return this; + } + + /** + * Optional resolution hints for this image. Model input size, dimensions, aspect ratio and format limits still apply. + * @return imagePixelLimit + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IMAGE_PIXEL_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ImagePixelLimit getImagePixelLimit() { + return imagePixelLimit; + } + + + @JsonProperty(value = JSON_PROPERTY_IMAGE_PIXEL_LIMIT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setImagePixelLimit(@javax.annotation.Nullable ImagePixelLimit imagePixelLimit) { + this.imagePixelLimit = imagePixelLimit; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImageContent imageContent = (ImageContent) o; + return Objects.equals(this.type, imageContent.type) && + Objects.equals(this.imageUrl, imageContent.imageUrl) && + Objects.equals(this.fileId, imageContent.fileId) && + Objects.equals(this.detail, imageContent.detail) && + Objects.equals(this.imagePixelLimit, imageContent.imagePixelLimit); + } + + @Override + public int hashCode() { + return Objects.hash(type, imageUrl, fileId, detail, imagePixelLimit); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImageContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" imagePixelLimit: ").append(toIndentedString(imagePixelLimit)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ImageContent instance; + + public Builder() { + this(new ImageContent()); + } + + protected Builder(ImageContent instance) { + this.instance = instance; + } + + public ImageContent.Builder type(StateContentType type) { + this.instance.type = type; + return this; + } + public ImageContent.Builder imageUrl(String imageUrl) { + this.instance.imageUrl = imageUrl; + return this; + } + public ImageContent.Builder fileId(String fileId) { + this.instance.fileId = fileId; + return this; + } + public ImageContent.Builder detail(ImageDetail detail) { + this.instance.detail = detail; + return this; + } + public ImageContent.Builder imagePixelLimit(ImagePixelLimit imagePixelLimit) { + this.instance.imagePixelLimit = imagePixelLimit; + return this; + } + + + /** + * returns a built ImageContent instance. + * + * The builder is not reusable. + */ + public ImageContent build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ImageContent.Builder builder() { + return new ImageContent.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ImageContent.Builder toBuilder() { + return new ImageContent.Builder() + .type(getType()) + .imageUrl(getImageUrl()) + .fileId(getFileId()) + .detail(getDetail()) + .imagePixelLimit(getImagePixelLimit()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ImageDetail.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ImageDetail.java new file mode 100644 index 0000000..f10ea4f --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ImageDetail.java @@ -0,0 +1,57 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Image analysis detail: low or high. Omitted means high. Higher detail may use more input tokens. An unsupported value returns 400 with param pointing to state[i].detail. + */ +public enum ImageDetail { + + LOW("low"), + + HIGH("high"); + + private String value; + + ImageDetail(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ImageDetail fromValue(String value) { + for (ImageDetail b : ImageDetail.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ImagePixelLimit.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ImagePixelLimit.java new file mode 100644 index 0000000..4c14329 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ImagePixelLimit.java @@ -0,0 +1,192 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Image processing resolution hints. These take precedence over detail but do not override the selected model's image input limits. When both values are supplied, min_pixels must not exceed max_pixels. + */ +@JsonPropertyOrder({ + ImagePixelLimit.JSON_PROPERTY_MAX_PIXELS, + ImagePixelLimit.JSON_PROPERTY_MIN_PIXELS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ImagePixelLimit { + public static final String JSON_PROPERTY_MAX_PIXELS = "max_pixels"; + @javax.annotation.Nullable + private Long maxPixels; + + public static final String JSON_PROPERTY_MIN_PIXELS = "min_pixels"; + @javax.annotation.Nullable + private Long minPixels; + + public ImagePixelLimit() { + } + + public ImagePixelLimit maxPixels(@javax.annotation.Nullable Long maxPixels) { + + this.maxPixels = maxPixels; + return this; + } + + /** + * Maximum number of pixels to use when processing this image. Omit to use the model's processing policy. + * minimum: 1 + * @return maxPixels + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAX_PIXELS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getMaxPixels() { + return maxPixels; + } + + + @JsonProperty(value = JSON_PROPERTY_MAX_PIXELS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxPixels(@javax.annotation.Nullable Long maxPixels) { + this.maxPixels = maxPixels; + } + + public ImagePixelLimit minPixels(@javax.annotation.Nullable Long minPixels) { + + this.minPixels = minPixels; + return this; + } + + /** + * Minimum number of pixels to use when processing this image. Omit to use the model's processing policy. + * minimum: 1 + * @return minPixels + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MIN_PIXELS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Long getMinPixels() { + return minPixels; + } + + + @JsonProperty(value = JSON_PROPERTY_MIN_PIXELS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMinPixels(@javax.annotation.Nullable Long minPixels) { + this.minPixels = minPixels; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ImagePixelLimit imagePixelLimit = (ImagePixelLimit) o; + return Objects.equals(this.maxPixels, imagePixelLimit.maxPixels) && + Objects.equals(this.minPixels, imagePixelLimit.minPixels); + } + + @Override + public int hashCode() { + return Objects.hash(maxPixels, minPixels); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ImagePixelLimit {\n"); + sb.append(" maxPixels: ").append(toIndentedString(maxPixels)).append("\n"); + sb.append(" minPixels: ").append(toIndentedString(minPixels)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ImagePixelLimit instance; + + public Builder() { + this(new ImagePixelLimit()); + } + + protected Builder(ImagePixelLimit instance) { + this.instance = instance; + } + + public ImagePixelLimit.Builder maxPixels(Long maxPixels) { + this.instance.maxPixels = maxPixels; + return this; + } + public ImagePixelLimit.Builder minPixels(Long minPixels) { + this.instance.minPixels = minPixels; + return this; + } + + + /** + * returns a built ImagePixelLimit instance. + * + * The builder is not reusable. + */ + public ImagePixelLimit build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ImagePixelLimit.Builder builder() { + return new ImagePixelLimit.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ImagePixelLimit.Builder toBuilder() { + return new ImagePixelLimit.Builder() + .maxPixels(getMaxPixels()) + .minPixels(getMinPixels()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/Instructions.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/Instructions.java new file mode 100644 index 0000000..592c487 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/Instructions.java @@ -0,0 +1,128 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.io.IOException; +import java.util.Objects; + +/** + * Instructions + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: String, java.util.Map, java.util.List). + * + * The Jackson apache-httpclient template openapi-generator runs against + * does not support non-discriminated anyOf/oneOf — it either drops to a + * degenerate empty shell or flattens one variant's fields onto the class, + * losing the others. This postprocess rewrite replaces the parent with a + * @JsonValue holder + typed static factories for write-side, plus a custom + * @JsonDeserialize that dispatches by JsonNode shape on the read-side so + * round-trips preserve variant types (string -> typed primitive/enum, + * object -> typed model, array -> typed List). + */ +@JsonDeserialize(using = Instructions.Deserializer.class) +public class Instructions { + + private final Object value; + + @JsonCreator + public Instructions(Object value) { + this.value = value; + } + + public Instructions() { + this.value = null; + } + + public static Instructions ofString(String value) { + return new Instructions(value); + } + + public static Instructions ofMap(java.util.Map value) { + return new Instructions(value); + } + + public static Instructions ofList(java.util.List value) { + return new Instructions(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public Instructions deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isTextual()) { + return new Instructions(mapper.treeToValue(node, String.class)); + } + if (node.isObject()) { + return new Instructions( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + if (node.isArray()) { + return new Instructions( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + Instructions.class, + "no Instructions variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + Instructions other = (Instructions) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class Instructions {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public Instructions build() { return new Instructions(this.value); } + } + + public static Instructions.Builder builder() { return new Instructions.Builder(); } + + public Instructions.Builder toBuilder() { + return new Instructions.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/NoulAnswer.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/NoulAnswer.java new file mode 100644 index 0000000..7076f8e --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/NoulAnswer.java @@ -0,0 +1,192 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Probability assigned to a yes/no question. + */ +@JsonPropertyOrder({ + NoulAnswer.JSON_PROPERTY_TYPE, + NoulAnswer.JSON_PROPERTY_NOUL +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class NoulAnswer implements Answer { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private AnswerType type = AnswerType.NOUL; + + public static final String JSON_PROPERTY_NOUL = "noul"; + @javax.annotation.Nonnull + private Double noul; + + public NoulAnswer() { + } + + public NoulAnswer type(@javax.annotation.Nonnull AnswerType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AnswerType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull AnswerType type) { + this.type = type; + } + + public NoulAnswer noul(@javax.annotation.Nonnull Double noul) { + + this.noul = noul; + return this; + } + + /** + * Probability of yes. Zero is present and valid; noul has no confidence field. + * minimum: 0 + * maximum: 1 + * @return noul + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_NOUL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Double getNoul() { + return noul; + } + + + @JsonProperty(value = JSON_PROPERTY_NOUL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNoul(@javax.annotation.Nonnull Double noul) { + this.noul = noul; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NoulAnswer noulAnswer = (NoulAnswer) o; + return Objects.equals(this.type, noulAnswer.type) && + Objects.equals(this.noul, noulAnswer.noul); + } + + @Override + public int hashCode() { + return Objects.hash(type, noul); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NoulAnswer {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" noul: ").append(toIndentedString(noul)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private NoulAnswer instance; + + public Builder() { + this(new NoulAnswer()); + } + + protected Builder(NoulAnswer instance) { + this.instance = instance; + } + + public NoulAnswer.Builder type(AnswerType type) { + this.instance.type = type; + return this; + } + public NoulAnswer.Builder noul(Double noul) { + this.instance.noul = noul; + return this; + } + + + /** + * returns a built NoulAnswer instance. + * + * The builder is not reusable. + */ + public NoulAnswer build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NoulAnswer.Builder builder() { + return new NoulAnswer.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NoulAnswer.Builder toBuilder() { + return new NoulAnswer.Builder() + .type(getType()) + .noul(getNoul()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/NoulCriteria.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/NoulCriteria.java new file mode 100644 index 0000000..8ec47ef --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/NoulCriteria.java @@ -0,0 +1,230 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Optional descriptions of the true and false outcomes. Omitted or null descriptions use the model's defaults. An empty object is accepted; other keys are ignored. The criteria object itself cannot be null. + */ +@JsonPropertyOrder({ + NoulCriteria.JSON_PROPERTY_TRUE_DESCRIPTION, + NoulCriteria.JSON_PROPERTY_FALSE_DESCRIPTION +}) +@JsonFormat(shape=JsonFormat.Shape.OBJECT) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +@com.fasterxml.jackson.annotation.JsonAutoDetect(isGetterVisibility = com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE) +public class NoulCriteria extends HashMap { + public static final String JSON_PROPERTY_TRUE_DESCRIPTION = "true"; + @javax.annotation.Nullable + private NullableInstructions trueDescription; + + public static final String JSON_PROPERTY_FALSE_DESCRIPTION = "false"; + @javax.annotation.Nullable + private NullableInstructions falseDescription; + + public NoulCriteria() { + + } + + public NoulCriteria trueDescription(@javax.annotation.Nullable NullableInstructions trueDescription) { + + this.trueDescription = trueDescription; + return this; + } + + /** + * Meaning of the true outcome. Accepts a string, object, array or null; omitted or null uses the model's default description. + * @return trueDescription + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TRUE_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public NullableInstructions getTrueDescription() { + return trueDescription; + } + + + @JsonProperty(value = JSON_PROPERTY_TRUE_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrueDescription(@javax.annotation.Nullable NullableInstructions trueDescription) { + this.trueDescription = trueDescription; + } + + public NoulCriteria falseDescription(@javax.annotation.Nullable NullableInstructions falseDescription) { + + this.falseDescription = falseDescription; + return this; + } + + /** + * Meaning of the false outcome. Accepts a string, object, array or null; omitted or null uses the model's default description. + * @return falseDescription + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FALSE_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public NullableInstructions getFalseDescription() { + return falseDescription; + } + + + @JsonProperty(value = JSON_PROPERTY_FALSE_DESCRIPTION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFalseDescription(@javax.annotation.Nullable NullableInstructions falseDescription) { + this.falseDescription = falseDescription; + } + + /** + * Set the additional (undeclared) property with the specified name and value. + * Creates the property if it does not already exist, otherwise replaces it. + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public NoulCriteria putAdditionalProperty(String key, Object value) { + this.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return this; + } + + /** + * Return the additional (undeclared) property with the specified name. + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + return this.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NoulCriteria noulCriteria = (NoulCriteria) o; + return Objects.equals(this.trueDescription, noulCriteria.trueDescription) && + Objects.equals(this.falseDescription, noulCriteria.falseDescription) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(trueDescription, falseDescription, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NoulCriteria {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" trueDescription: ").append(toIndentedString(trueDescription)).append("\n"); + sb.append(" falseDescription: ").append(toIndentedString(falseDescription)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private NoulCriteria instance; + + public Builder() { + this(new NoulCriteria()); + } + + protected Builder(NoulCriteria instance) { + this.instance = instance; + } + + public NoulCriteria.Builder trueDescription(NullableInstructions trueDescription) { + this.instance.trueDescription = trueDescription; + return this; + } + public NoulCriteria.Builder falseDescription(NullableInstructions falseDescription) { + this.instance.falseDescription = falseDescription; + return this; + } + + + /** + * returns a built NoulCriteria instance. + * + * The builder is not reusable. + */ + public NoulCriteria build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NoulCriteria.Builder builder() { + return new NoulCriteria.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NoulCriteria.Builder toBuilder() { + return new NoulCriteria.Builder() + .trueDescription(getTrueDescription()) + .falseDescription(getFalseDescription()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/NoulQuestion.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/NoulQuestion.java new file mode 100644 index 0000000..b760bd3 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/NoulQuestion.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * A yes/no question. The answer is the probability of the true outcome. + */ +@JsonPropertyOrder({ + NoulQuestion.JSON_PROPERTY_TYPE, + NoulQuestion.JSON_PROPERTY_INSTRUCTIONS, + NoulQuestion.JSON_PROPERTY_CRITERIA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class NoulQuestion implements Question { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private QuestionType type = QuestionType.NOUL; + + public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; + @javax.annotation.Nullable + private NullableInstructions instructions; + + public static final String JSON_PROPERTY_CRITERIA = "criteria"; + @javax.annotation.Nullable + private NoulCriteria criteria; + + public NoulQuestion() { + } + + public NoulQuestion type(@javax.annotation.Nonnull QuestionType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public QuestionType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull QuestionType type) { + this.type = type; + } + + public NoulQuestion instructions(@javax.annotation.Nullable NullableInstructions instructions) { + + this.instructions = instructions; + return this; + } + + /** + * Optional evaluation instructions. Omitted or null uses the model's defaults. Empty strings and containers are accepted. + * @return instructions + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INSTRUCTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public NullableInstructions getInstructions() { + return instructions; + } + + + @JsonProperty(value = JSON_PROPERTY_INSTRUCTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstructions(@javax.annotation.Nullable NullableInstructions instructions) { + this.instructions = instructions; + } + + public NoulQuestion criteria(@javax.annotation.Nullable NoulCriteria criteria) { + + this.criteria = criteria; + return this; + } + + /** + * Optional true/false descriptions. Omit for model defaults. An empty object is valid; null is not. + * @return criteria + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CRITERIA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public NoulCriteria getCriteria() { + return criteria; + } + + + @JsonProperty(value = JSON_PROPERTY_CRITERIA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCriteria(@javax.annotation.Nullable NoulCriteria criteria) { + this.criteria = criteria; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NoulQuestion noulQuestion = (NoulQuestion) o; + return Objects.equals(this.type, noulQuestion.type) && + Objects.equals(this.instructions, noulQuestion.instructions) && + Objects.equals(this.criteria, noulQuestion.criteria); + } + + @Override + public int hashCode() { + return Objects.hash(type, instructions, criteria); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NoulQuestion {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" criteria: ").append(toIndentedString(criteria)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private NoulQuestion instance; + + public Builder() { + this(new NoulQuestion()); + } + + protected Builder(NoulQuestion instance) { + this.instance = instance; + } + + public NoulQuestion.Builder type(QuestionType type) { + this.instance.type = type; + return this; + } + public NoulQuestion.Builder instructions(NullableInstructions instructions) { + this.instance.instructions = instructions; + return this; + } + public NoulQuestion.Builder criteria(NoulCriteria criteria) { + this.instance.criteria = criteria; + return this; + } + + + /** + * returns a built NoulQuestion instance. + * + * The builder is not reusable. + */ + public NoulQuestion build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static NoulQuestion.Builder builder() { + return new NoulQuestion.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public NoulQuestion.Builder toBuilder() { + return new NoulQuestion.Builder() + .type(getType()) + .instructions(getInstructions()) + .criteria(getCriteria()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/NullableInstructions.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/NullableInstructions.java new file mode 100644 index 0000000..a65e819 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/NullableInstructions.java @@ -0,0 +1,128 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.io.IOException; +import java.util.Objects; + +/** + * NullableInstructions + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: String, java.util.Map, java.util.List). + * + * The Jackson apache-httpclient template openapi-generator runs against + * does not support non-discriminated anyOf/oneOf — it either drops to a + * degenerate empty shell or flattens one variant's fields onto the class, + * losing the others. This postprocess rewrite replaces the parent with a + * @JsonValue holder + typed static factories for write-side, plus a custom + * @JsonDeserialize that dispatches by JsonNode shape on the read-side so + * round-trips preserve variant types (string -> typed primitive/enum, + * object -> typed model, array -> typed List). + */ +@JsonDeserialize(using = NullableInstructions.Deserializer.class) +public class NullableInstructions { + + private final Object value; + + @JsonCreator + public NullableInstructions(Object value) { + this.value = value; + } + + public NullableInstructions() { + this.value = null; + } + + public static NullableInstructions ofString(String value) { + return new NullableInstructions(value); + } + + public static NullableInstructions ofMap(java.util.Map value) { + return new NullableInstructions(value); + } + + public static NullableInstructions ofList(java.util.List value) { + return new NullableInstructions(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public NullableInstructions deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isTextual()) { + return new NullableInstructions(mapper.treeToValue(node, String.class)); + } + if (node.isObject()) { + return new NullableInstructions( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + if (node.isArray()) { + return new NullableInstructions( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + NullableInstructions.class, + "no NullableInstructions variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + NullableInstructions other = (NullableInstructions) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class NullableInstructions {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public NullableInstructions build() { return new NullableInstructions(this.value); } + } + + public static NullableInstructions.Builder builder() { return new NullableInstructions.Builder(); } + + public NullableInstructions.Builder toBuilder() { + return new NullableInstructions.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/Question.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/Question.java new file mode 100644 index 0000000..2007680 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/Question.java @@ -0,0 +1,32 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChoiceQuestion.class, name = "choice"), + @JsonSubTypes.Type(value = NoulQuestion.class, name = "noul"), + @JsonSubTypes.Type(value = ScoreQuestion.class, name = "score"), +}) + +public interface Question { + public QuestionType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/QuestionType.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/QuestionType.java new file mode 100644 index 0000000..cc7d785 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/QuestionType.java @@ -0,0 +1,59 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets QuestionType + */ +public enum QuestionType { + + CHOICE("choice"), + + NOUL("noul"), + + SCORE("score"); + + private String value; + + QuestionType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static QuestionType fromValue(String value) { + for (QuestionType b : QuestionType.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ScoreAnswer.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ScoreAnswer.java new file mode 100644 index 0000000..0bda941 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ScoreAnswer.java @@ -0,0 +1,315 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Map; +import java.util.Objects; + +/** + * Probability-weighted score over the supplied ordered levels. + */ +@JsonPropertyOrder({ + ScoreAnswer.JSON_PROPERTY_TYPE, + ScoreAnswer.JSON_PROPERTY_SCORE, + ScoreAnswer.JSON_PROPERTY_LEGEND, + ScoreAnswer.JSON_PROPERTY_PROBABILITIES, + ScoreAnswer.JSON_PROPERTY_CONFIDENCE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ScoreAnswer implements Answer { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private AnswerType type = AnswerType.SCORE; + + public static final String JSON_PROPERTY_SCORE = "score"; + @javax.annotation.Nonnull + private Double score; + + public static final String JSON_PROPERTY_LEGEND = "legend"; + @javax.annotation.Nonnull + private Map legend; + + public static final String JSON_PROPERTY_PROBABILITIES = "probabilities"; + @javax.annotation.Nonnull + private Map probabilities; + + public static final String JSON_PROPERTY_CONFIDENCE = "confidence"; + @javax.annotation.Nonnull + private Double confidence; + + public ScoreAnswer() { + } + + public ScoreAnswer type(@javax.annotation.Nonnull AnswerType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public AnswerType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull AnswerType type) { + this.type = type; + } + + public ScoreAnswer score(@javax.annotation.Nonnull Double score) { + + this.score = score; + return this; + } + + /** + * sum(i * p_i), bounded by [0, N-1]; may be fractional and is not normalized. + * minimum: 0 + * @return score + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SCORE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Double getScore() { + return score; + } + + + @JsonProperty(value = JSON_PROPERTY_SCORE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setScore(@javax.annotation.Nonnull Double score) { + this.score = score; + } + + public ScoreAnswer legend(@javax.annotation.Nonnull Map legend) { + + this.legend = legend; + return this; + } + + public ScoreAnswer putLegendItem(String key, Instructions legendItem) { + this.legend.put(key, legendItem); + return this; + } + + /** + * Keys \"0\" through \"N-1\" map to the original level descriptions, retaining string/object/array shapes. + * @return legend + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_LEGEND, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Map getLegend() { + return legend; + } + + + @JsonProperty(value = JSON_PROPERTY_LEGEND, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLegend(@javax.annotation.Nonnull Map legend) { + this.legend = legend; + } + + public ScoreAnswer probabilities(@javax.annotation.Nonnull Map probabilities) { + + this.probabilities = probabilities; + return this; + } + + public ScoreAnswer putProbabilitiesItem(String key, Double probabilitiesItem) { + this.probabilities.put(key, probabilitiesItem); + return this; + } + + /** + * Keys \"0\" through \"N-1\", including zero probabilities; values sum to 1. + * @return probabilities + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_PROBABILITIES, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Map getProbabilities() { + return probabilities; + } + + + @JsonProperty(value = JSON_PROPERTY_PROBABILITIES, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setProbabilities(@javax.annotation.Nonnull Map probabilities) { + this.probabilities = probabilities; + } + + public ScoreAnswer confidence(@javax.annotation.Nonnull Double confidence) { + + this.confidence = confidence; + return this; + } + + /** + * Confidence in the score, from 0 to 1 inclusive. Its calculation depends on the model. + * minimum: 0 + * maximum: 1 + * @return confidence + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Double getConfidence() { + return confidence; + } + + + @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setConfidence(@javax.annotation.Nonnull Double confidence) { + this.confidence = confidence; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScoreAnswer scoreAnswer = (ScoreAnswer) o; + return Objects.equals(this.type, scoreAnswer.type) && + Objects.equals(this.score, scoreAnswer.score) && + Objects.equals(this.legend, scoreAnswer.legend) && + Objects.equals(this.probabilities, scoreAnswer.probabilities) && + Objects.equals(this.confidence, scoreAnswer.confidence); + } + + @Override + public int hashCode() { + return Objects.hash(type, score, legend, probabilities, confidence); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScoreAnswer {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" legend: ").append(toIndentedString(legend)).append("\n"); + sb.append(" probabilities: ").append(toIndentedString(probabilities)).append("\n"); + sb.append(" confidence: ").append(toIndentedString(confidence)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ScoreAnswer instance; + + public Builder() { + this(new ScoreAnswer()); + } + + protected Builder(ScoreAnswer instance) { + this.instance = instance; + } + + public ScoreAnswer.Builder type(AnswerType type) { + this.instance.type = type; + return this; + } + public ScoreAnswer.Builder score(Double score) { + this.instance.score = score; + return this; + } + public ScoreAnswer.Builder legend(Map legend) { + this.instance.legend = legend; + return this; + } + public ScoreAnswer.Builder probabilities(Map probabilities) { + this.instance.probabilities = probabilities; + return this; + } + public ScoreAnswer.Builder confidence(Double confidence) { + this.instance.confidence = confidence; + return this; + } + + + /** + * returns a built ScoreAnswer instance. + * + * The builder is not reusable. + */ + public ScoreAnswer build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ScoreAnswer.Builder builder() { + return new ScoreAnswer.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ScoreAnswer.Builder toBuilder() { + return new ScoreAnswer.Builder() + .type(getType()) + .score(getScore()) + .legend(getLegend()) + .probabilities(getProbabilities()) + .confidence(getConfidence()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/ScoreQuestion.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/ScoreQuestion.java new file mode 100644 index 0000000..25e967c --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/ScoreQuestion.java @@ -0,0 +1,237 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * A scoring question over an ordered list of levels. + */ +@JsonPropertyOrder({ + ScoreQuestion.JSON_PROPERTY_TYPE, + ScoreQuestion.JSON_PROPERTY_INSTRUCTIONS, + ScoreQuestion.JSON_PROPERTY_CRITERIA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ScoreQuestion implements Question { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private QuestionType type = QuestionType.SCORE; + + public static final String JSON_PROPERTY_INSTRUCTIONS = "instructions"; + @javax.annotation.Nullable + private NullableInstructions instructions; + + public static final String JSON_PROPERTY_CRITERIA = "criteria"; + @javax.annotation.Nonnull + private List criteria; + + public ScoreQuestion() { + } + + public ScoreQuestion type(@javax.annotation.Nonnull QuestionType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public QuestionType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull QuestionType type) { + this.type = type; + } + + public ScoreQuestion instructions(@javax.annotation.Nullable NullableInstructions instructions) { + + this.instructions = instructions; + return this; + } + + /** + * Optional evaluation instructions. Omitted or null uses the model's defaults. Use instructions to define what increasing levels mean. + * @return instructions + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INSTRUCTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public NullableInstructions getInstructions() { + return instructions; + } + + + @JsonProperty(value = JSON_PROPERTY_INSTRUCTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstructions(@javax.annotation.Nullable NullableInstructions instructions) { + this.instructions = instructions; + } + + public ScoreQuestion criteria(@javax.annotation.Nonnull List criteria) { + + this.criteria = criteria; + return this; + } + + public ScoreQuestion addCriteriaItem(Instructions criteriaItem) { + if (this.criteria == null) { + this.criteria = new ArrayList<>(); + } + this.criteria.add(criteriaItem); + return this; + } + + /** + * Ordered score levels. Required; 1-10 levels per question, inclusive. The first level has index 0. + * @return criteria + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CRITERIA, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getCriteria() { + return criteria; + } + + + @JsonProperty(value = JSON_PROPERTY_CRITERIA, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCriteria(@javax.annotation.Nonnull List criteria) { + this.criteria = criteria; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ScoreQuestion scoreQuestion = (ScoreQuestion) o; + return Objects.equals(this.type, scoreQuestion.type) && + Objects.equals(this.instructions, scoreQuestion.instructions) && + Objects.equals(this.criteria, scoreQuestion.criteria); + } + + @Override + public int hashCode() { + return Objects.hash(type, instructions, criteria); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScoreQuestion {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" instructions: ").append(toIndentedString(instructions)).append("\n"); + sb.append(" criteria: ").append(toIndentedString(criteria)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private ScoreQuestion instance; + + public Builder() { + this(new ScoreQuestion()); + } + + protected Builder(ScoreQuestion instance) { + this.instance = instance; + } + + public ScoreQuestion.Builder type(QuestionType type) { + this.instance.type = type; + return this; + } + public ScoreQuestion.Builder instructions(NullableInstructions instructions) { + this.instance.instructions = instructions; + return this; + } + public ScoreQuestion.Builder criteria(List criteria) { + this.instance.criteria = criteria; + return this; + } + + + /** + * returns a built ScoreQuestion instance. + * + * The builder is not reusable. + */ + public ScoreQuestion build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static ScoreQuestion.Builder builder() { + return new ScoreQuestion.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ScoreQuestion.Builder toBuilder() { + return new ScoreQuestion.Builder() + .type(getType()) + .instructions(getInstructions()) + .criteria(getCriteria()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/State.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/State.java new file mode 100644 index 0000000..4d05932 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/State.java @@ -0,0 +1,136 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.io.IOException; +import java.util.Objects; + +/** + * State + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: String, java.util.Map, java.util.List, java.util.List>). + * + * The Jackson apache-httpclient template openapi-generator runs against + * does not support non-discriminated anyOf/oneOf — it either drops to a + * degenerate empty shell or flattens one variant's fields onto the class, + * losing the others. This postprocess rewrite replaces the parent with a + * @JsonValue holder + typed static factories for write-side, plus a custom + * @JsonDeserialize that dispatches by JsonNode shape on the read-side so + * round-trips preserve variant types (string -> typed primitive/enum, + * object -> typed model, array -> typed List). + */ +@JsonDeserialize(using = State.Deserializer.class) +public class State { + + private final Object value; + + @JsonCreator + public State(Object value) { + this.value = value; + } + + public State() { + this.value = null; + } + + public static State ofString(String value) { + return new State(value); + } + + public static State ofMap(java.util.Map value) { + return new State(value); + } + + public static State ofStringList(java.util.List value) { + return new State(value); + } + + public static State ofObjectList(java.util.List> value) { + return new State(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public State deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isTextual()) { + return new State(mapper.treeToValue(node, String.class)); + } + if (node.isObject()) { + return new State( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + if (node.isArray() && java.util.stream.StreamSupport.stream(node.spliterator(), false).allMatch(item -> item.isTextual())) { + return new State( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + if (node.isArray() && java.util.stream.StreamSupport.stream(node.spliterator(), false).allMatch(item -> item.isObject())) { + return new State( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>>() {})); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + State.class, + "no State variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + State other = (State) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class State {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public State build() { return new State(this.value); } + } + + public static State.Builder builder() { return new State.Builder(); } + + public State.Builder toBuilder() { + return new State.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/StateContent.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/StateContent.java new file mode 100644 index 0000000..9bde0c7 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/StateContent.java @@ -0,0 +1,33 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = AudioContent.class, name = "audio"), + @JsonSubTypes.Type(value = ImageContent.class, name = "image"), + @JsonSubTypes.Type(value = TextContent.class, name = "text"), + @JsonSubTypes.Type(value = VideoContent.class, name = "video"), +}) + +public interface StateContent { + public StateContentType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/StateContentType.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/StateContentType.java new file mode 100644 index 0000000..0d30765 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/StateContentType.java @@ -0,0 +1,61 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets StateContentType + */ +public enum StateContentType { + + AUDIO("audio"), + + IMAGE("image"), + + TEXT("text"), + + VIDEO("video"); + + private String value; + + StateContentType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StateContentType fromValue(String value) { + for (StateContentType b : StateContentType.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/SystemOneRequest.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/SystemOneRequest.java new file mode 100644 index 0000000..795a329 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/SystemOneRequest.java @@ -0,0 +1,233 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Map; +import java.util.Objects; + +/** + * Evaluate several questions against one shared state. Model-specific text, request-size and context limits apply. When an aggregate text-byte limit applies, it counts decoded UTF-8 strings and compact JSON objects/arrays across state text, all instructions and criteria. Shared state is counted once; media references, Base64, model and question IDs are excluded from that text total. Request-size limits include encoded media in the JSON body and are separate from decoded media limits and model token budgets. Send a UTF-8 encoded JSON object. Invalid JSON syntax returns 400 / InvalidParameter with param=\"body format\". A failed request returns one error instead of partial answers. + */ +@JsonPropertyOrder({ + SystemOneRequest.JSON_PROPERTY_MODEL, + SystemOneRequest.JSON_PROPERTY_STATE, + SystemOneRequest.JSON_PROPERTY_QUESTIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class SystemOneRequest { + public static final String JSON_PROPERTY_MODEL = "model"; + @javax.annotation.Nonnull + private String model; + + public static final String JSON_PROPERTY_STATE = "state"; + @javax.annotation.Nonnull + private State state; + + public static final String JSON_PROPERTY_QUESTIONS = "questions"; + @javax.annotation.Nonnull + private Map questions; + + public SystemOneRequest() { + } + + public SystemOneRequest model(@javax.annotation.Nonnull String model) { + + this.model = model; + return this; + } + + /** + * Model ID or Endpoint ID with System One capability. Use an ID available to your account in the selected region; third-party aliases are not automatically mapped. A model without this capability returns 400 / InvalidParameter with param=model. Missing or inaccessible models can return 404; access denied at the API entry can return 403. Merely supporting Chat or Responses does not imply System One support. + * @return model + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_MODEL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModel() { + return model; + } + + + @JsonProperty(value = JSON_PROPERTY_MODEL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModel(@javax.annotation.Nonnull String model) { + this.model = model; + } + + public SystemOneRequest state(@javax.annotation.Nonnull State state) { + + this.state = state; + return this; + } + + /** + * Shared text, structured data or multimedia to evaluate. Required; an empty string, array or object is accepted, while null is not. Top-level arrays must contain only strings or only objects. In object arrays, an explicit type=text/image/video/audio selects multimedia validation for the whole array. Source keys such as file_id or image_url alone remain business data. + * @return state + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_STATE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public State getState() { + return state; + } + + + @JsonProperty(value = JSON_PROPERTY_STATE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setState(@javax.annotation.Nonnull State state) { + this.state = state; + } + + public SystemOneRequest questions(@javax.annotation.Nonnull Map questions) { + + this.questions = questions; + return this; + } + + public SystemOneRequest putQuestionsItem(String key, Question questionsItem) { + this.questions.put(key, questionsItem); + return this; + } + + /** + * Named questions to evaluate against state. Required and nonempty. + * @return questions + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_QUESTIONS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Map getQuestions() { + return questions; + } + + + @JsonProperty(value = JSON_PROPERTY_QUESTIONS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuestions(@javax.annotation.Nonnull Map questions) { + this.questions = questions; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SystemOneRequest systemOneRequest = (SystemOneRequest) o; + return Objects.equals(this.model, systemOneRequest.model) && + Objects.equals(this.state, systemOneRequest.state) && + Objects.equals(this.questions, systemOneRequest.questions); + } + + @Override + public int hashCode() { + return Objects.hash(model, state, questions); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SystemOneRequest {\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" questions: ").append(toIndentedString(questions)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private SystemOneRequest instance; + + public Builder() { + this(new SystemOneRequest()); + } + + protected Builder(SystemOneRequest instance) { + this.instance = instance; + } + + public SystemOneRequest.Builder model(String model) { + this.instance.model = model; + return this; + } + public SystemOneRequest.Builder state(State state) { + this.instance.state = state; + return this; + } + public SystemOneRequest.Builder questions(Map questions) { + this.instance.questions = questions; + return this; + } + + + /** + * returns a built SystemOneRequest instance. + * + * The builder is not reusable. + */ + public SystemOneRequest build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SystemOneRequest.Builder builder() { + return new SystemOneRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SystemOneRequest.Builder toBuilder() { + return new SystemOneRequest.Builder() + .model(getModel()) + .state(getState()) + .questions(getQuestions()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/SystemOneResponse.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/SystemOneResponse.java new file mode 100644 index 0000000..a677dec --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/SystemOneResponse.java @@ -0,0 +1,233 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Map; +import java.util.Objects; + +/** + * Complete synchronous evaluation result. No partial-success answer envelope is returned. + */ +@JsonPropertyOrder({ + SystemOneResponse.JSON_PROPERTY_MODEL, + SystemOneResponse.JSON_PROPERTY_ANSWERS, + SystemOneResponse.JSON_PROPERTY_USAGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class SystemOneResponse { + public static final String JSON_PROPERTY_MODEL = "model"; + @javax.annotation.Nonnull + private String model; + + public static final String JSON_PROPERTY_ANSWERS = "answers"; + @javax.annotation.Nonnull + private Map answers; + + public static final String JSON_PROPERTY_USAGE = "usage"; + @javax.annotation.Nonnull + private Usage usage; + + public SystemOneResponse() { + } + + public SystemOneResponse model(@javax.annotation.Nonnull String model) { + + this.model = model; + return this; + } + + /** + * Public identifier of the model that performed the evaluation, including its version. This can differ from the requested model alias or Endpoint ID; it is not an echo of an ep- identifier. + * @return model + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_MODEL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getModel() { + return model; + } + + + @JsonProperty(value = JSON_PROPERTY_MODEL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setModel(@javax.annotation.Nonnull String model) { + this.model = model; + } + + public SystemOneResponse answers(@javax.annotation.Nonnull Map answers) { + + this.answers = answers; + return this; + } + + public SystemOneResponse putAnswersItem(String key, Answer answersItem) { + this.answers.put(key, answersItem); + return this; + } + + /** + * Exactly the request question IDs, each with its matching answer type. + * @return answers + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ANSWERS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Map getAnswers() { + return answers; + } + + + @JsonProperty(value = JSON_PROPERTY_ANSWERS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAnswers(@javax.annotation.Nonnull Map answers) { + this.answers = answers; + } + + public SystemOneResponse usage(@javax.annotation.Nonnull Usage usage) { + + this.usage = usage; + return this; + } + + /** + * Token usage for this evaluation. + * @return usage + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_USAGE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Usage getUsage() { + return usage; + } + + + @JsonProperty(value = JSON_PROPERTY_USAGE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUsage(@javax.annotation.Nonnull Usage usage) { + this.usage = usage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SystemOneResponse systemOneResponse = (SystemOneResponse) o; + return Objects.equals(this.model, systemOneResponse.model) && + Objects.equals(this.answers, systemOneResponse.answers) && + Objects.equals(this.usage, systemOneResponse.usage); + } + + @Override + public int hashCode() { + return Objects.hash(model, answers, usage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SystemOneResponse {\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" answers: ").append(toIndentedString(answers)).append("\n"); + sb.append(" usage: ").append(toIndentedString(usage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private SystemOneResponse instance; + + public Builder() { + this(new SystemOneResponse()); + } + + protected Builder(SystemOneResponse instance) { + this.instance = instance; + } + + public SystemOneResponse.Builder model(String model) { + this.instance.model = model; + return this; + } + public SystemOneResponse.Builder answers(Map answers) { + this.instance.answers = answers; + return this; + } + public SystemOneResponse.Builder usage(Usage usage) { + this.instance.usage = usage; + return this; + } + + + /** + * returns a built SystemOneResponse instance. + * + * The builder is not reusable. + */ + public SystemOneResponse build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static SystemOneResponse.Builder builder() { + return new SystemOneResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public SystemOneResponse.Builder toBuilder() { + return new SystemOneResponse.Builder() + .model(getModel()) + .answers(getAnswers()) + .usage(getUsage()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/TextContent.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/TextContent.java new file mode 100644 index 0000000..7f9d797 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/TextContent.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * A text element within a multimedia state array. + */ +@JsonPropertyOrder({ + TextContent.JSON_PROPERTY_TYPE, + TextContent.JSON_PROPERTY_TEXT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class TextContent implements StateContent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private StateContentType type = StateContentType.TEXT; + + public static final String JSON_PROPERTY_TEXT = "text"; + @javax.annotation.Nonnull + private TextValue text; + + public TextContent() { + } + + public TextContent type(@javax.annotation.Nonnull StateContentType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StateContentType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull StateContentType type) { + this.type = type; + } + + public TextContent text(@javax.annotation.Nonnull TextValue text) { + + this.text = text; + return this; + } + + /** + * Text or structured content. Required and non-null; arrays contain only strings. + * @return text + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public TextValue getText() { + return text; + } + + + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(@javax.annotation.Nonnull TextValue text) { + this.text = text; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TextContent textContent = (TextContent) o; + return Objects.equals(this.type, textContent.type) && + Objects.equals(this.text, textContent.text); + } + + @Override + public int hashCode() { + return Objects.hash(type, text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TextContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private TextContent instance; + + public Builder() { + this(new TextContent()); + } + + protected Builder(TextContent instance) { + this.instance = instance; + } + + public TextContent.Builder type(StateContentType type) { + this.instance.type = type; + return this; + } + public TextContent.Builder text(TextValue text) { + this.instance.text = text; + return this; + } + + + /** + * returns a built TextContent instance. + * + * The builder is not reusable. + */ + public TextContent build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static TextContent.Builder builder() { + return new TextContent.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public TextContent.Builder toBuilder() { + return new TextContent.Builder() + .type(getType()) + .text(getText()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/TextValue.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/TextValue.java new file mode 100644 index 0000000..59d4133 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/TextValue.java @@ -0,0 +1,128 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import java.io.IOException; +import java.util.Objects; + +/** + * TextValue + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: String, java.util.List, java.util.Map). + * + * The Jackson apache-httpclient template openapi-generator runs against + * does not support non-discriminated anyOf/oneOf — it either drops to a + * degenerate empty shell or flattens one variant's fields onto the class, + * losing the others. This postprocess rewrite replaces the parent with a + * @JsonValue holder + typed static factories for write-side, plus a custom + * @JsonDeserialize that dispatches by JsonNode shape on the read-side so + * round-trips preserve variant types (string -> typed primitive/enum, + * object -> typed model, array -> typed List). + */ +@JsonDeserialize(using = TextValue.Deserializer.class) +public class TextValue { + + private final Object value; + + @JsonCreator + public TextValue(Object value) { + this.value = value; + } + + public TextValue() { + this.value = null; + } + + public static TextValue ofString(String value) { + return new TextValue(value); + } + + public static TextValue ofList(java.util.List value) { + return new TextValue(value); + } + + public static TextValue ofMap(java.util.Map value) { + return new TextValue(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public TextValue deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isTextual()) { + return new TextValue(mapper.treeToValue(node, String.class)); + } + if (node.isArray()) { + return new TextValue( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + if (node.isObject()) { + return new TextValue( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + TextValue.class, + "no TextValue variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + TextValue other = (TextValue) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class TextValue {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public TextValue build() { return new TextValue(this.value); } + } + + public static TextValue.Builder builder() { return new TextValue.Builder(); } + + public TextValue.Builder toBuilder() { + return new TextValue.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/UnknownAnswer.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/UnknownAnswer.java new file mode 100644 index 0000000..c039864 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/UnknownAnswer.java @@ -0,0 +1,52 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.volcengine.ark.runtime.utils.UnknownVariantSupport; +import java.io.IOException; + +/** Generated by ark-apis unknown_response_variants; retained future Answer payload. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NONE) +@JsonDeserialize(using = UnknownAnswer.Deserializer.class) +@JsonSerialize(using = UnknownVariantSupport.Serializer.class) +public final class UnknownAnswer extends UnknownVariantSupport implements Answer { + public UnknownAnswer(JsonNode rawJson) { + super("type", rawJson); + } + + @Override + public AnswerType getType() { + return AnswerType.UNKNOWN; + } + + public static final class Deserializer extends JsonDeserializer { + @Override + public UnknownAnswer deserialize(JsonParser parser, DeserializationContext context) throws IOException { + JsonNode node = parser.getCodec().readTree(parser); + if (!UnknownVariantSupport.hasDiscriminator(node, "type")) { + return (UnknownAnswer) context.handleUnexpectedToken(UnknownAnswer.class, parser); + } + return new UnknownAnswer(node); + } + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/Usage.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/Usage.java new file mode 100644 index 0000000..b879ea0 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/Usage.java @@ -0,0 +1,192 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Token usage for the complete evaluation. Clients must tolerate additional usage fields added in future versions. Zero can also mean the model did not supply a count for that field; it does not establish that the evaluation is free. These counts alone do not specify prices or discounts; consult the selected model pricing. + */ +@JsonPropertyOrder({ + Usage.JSON_PROPERTY_INPUT_TOKENS, + Usage.JSON_PROPERTY_OUTPUT_TOKENS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class Usage { + public static final String JSON_PROPERTY_INPUT_TOKENS = "input_tokens"; + @javax.annotation.Nonnull + private Long inputTokens; + + public static final String JSON_PROPERTY_OUTPUT_TOKENS = "output_tokens"; + @javax.annotation.Nonnull + private Long outputTokens; + + public Usage() { + } + + public Usage inputTokens(@javax.annotation.Nonnull Long inputTokens) { + + this.inputTokens = inputTokens; + return this; + } + + /** + * Total input tokens reported for this evaluation, including cached input tokens when measured. This is not a character count; shared context may contribute to multiple question evaluations. + * minimum: 0 + * @return inputTokens + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getInputTokens() { + return inputTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_INPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputTokens(@javax.annotation.Nonnull Long inputTokens) { + this.inputTokens = inputTokens; + } + + public Usage outputTokens(@javax.annotation.Nonnull Long outputTokens) { + + this.outputTokens = outputTokens; + return this; + } + + /** + * Output tokens reported for the complete evaluation. Not the number of bytes in the JSON response. + * minimum: 0 + * @return outputTokens + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_OUTPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Long getOutputTokens() { + return outputTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_OUTPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputTokens(@javax.annotation.Nonnull Long outputTokens) { + this.outputTokens = outputTokens; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Usage usage = (Usage) o; + return Objects.equals(this.inputTokens, usage.inputTokens) && + Objects.equals(this.outputTokens, usage.outputTokens); + } + + @Override + public int hashCode() { + return Objects.hash(inputTokens, outputTokens); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Usage {\n"); + sb.append(" inputTokens: ").append(toIndentedString(inputTokens)).append("\n"); + sb.append(" outputTokens: ").append(toIndentedString(outputTokens)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private Usage instance; + + public Builder() { + this(new Usage()); + } + + protected Builder(Usage instance) { + this.instance = instance; + } + + public Usage.Builder inputTokens(Long inputTokens) { + this.instance.inputTokens = inputTokens; + return this; + } + public Usage.Builder outputTokens(Long outputTokens) { + this.instance.outputTokens = outputTokens; + return this; + } + + + /** + * returns a built Usage instance. + * + * The builder is not reusable. + */ + public Usage build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static Usage.Builder builder() { + return new Usage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Usage.Builder toBuilder() { + return new Usage.Builder() + .inputTokens(getInputTokens()) + .outputTokens(getOutputTokens()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/systemone/VideoContent.java b/src/main/java/com/volcengine/ark/runtime/models/systemone/VideoContent.java new file mode 100644 index 0000000..480a173 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/systemone/VideoContent.java @@ -0,0 +1,266 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark System One API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 0.1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.volcengine.ark.runtime.models.systemone; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * A video, supplied by exactly one of video_url or file_id. The video is sampled into images for evaluation; audio is also processed when present and supported. + */ +@JsonPropertyOrder({ + VideoContent.JSON_PROPERTY_TYPE, + VideoContent.JSON_PROPERTY_VIDEO_URL, + VideoContent.JSON_PROPERTY_FILE_ID, + VideoContent.JSON_PROPERTY_FPS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class VideoContent implements StateContent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private StateContentType type = StateContentType.VIDEO; + + public static final String JSON_PROPERTY_VIDEO_URL = "video_url"; + @javax.annotation.Nullable + private String videoUrl; + + public static final String JSON_PROPERTY_FILE_ID = "file_id"; + @javax.annotation.Nullable + private String fileId; + + public static final String JSON_PROPERTY_FPS = "fps"; + @javax.annotation.Nullable + private Double fps; + + public VideoContent() { + } + + public VideoContent type(@javax.annotation.Nonnull StateContentType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public StateContentType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull StateContentType type) { + this.type = type; + } + + public VideoContent videoUrl(@javax.annotation.Nullable String videoUrl) { + + this.videoUrl = videoUrl; + return this; + } + + /** + * Public HTTP(S) URL or data:video/<format>;base64,<encoded-video>. Mutually exclusive with file_id. + * @return videoUrl + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_VIDEO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getVideoUrl() { + return videoUrl; + } + + + @JsonProperty(value = JSON_PROPERTY_VIDEO_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setVideoUrl(@javax.annotation.Nullable String videoUrl) { + this.videoUrl = videoUrl; + } + + public VideoContent fileId(@javax.annotation.Nullable String fileId) { + + this.fileId = fileId; + return this; + } + + /** + * Active video file ID from the Files API. Mutually exclusive with video_url. + * @return fileId + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getFileId() { + return fileId; + } + + + @JsonProperty(value = JSON_PROPERTY_FILE_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFileId(@javax.annotation.Nullable String fileId) { + this.fileId = fileId; + } + + public VideoContent fps(@javax.annotation.Nullable Double fps) { + + this.fps = fps; + return this; + } + + /** + * Sampling rate in frames per second. Omitted means 1.0. A lower value can reduce sampled frames, but a model's minimum frame count can make token usage unchanged. + * minimum: 0.2 + * maximum: 5 + * @return fps + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getFps() { + return fps; + } + + + @JsonProperty(value = JSON_PROPERTY_FPS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFps(@javax.annotation.Nullable Double fps) { + this.fps = fps; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VideoContent videoContent = (VideoContent) o; + return Objects.equals(this.type, videoContent.type) && + Objects.equals(this.videoUrl, videoContent.videoUrl) && + Objects.equals(this.fileId, videoContent.fileId) && + Objects.equals(this.fps, videoContent.fps); + } + + @Override + public int hashCode() { + return Objects.hash(type, videoUrl, fileId, fps); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VideoContent {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" videoUrl: ").append(toIndentedString(videoUrl)).append("\n"); + sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); + sb.append(" fps: ").append(toIndentedString(fps)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + return o == null ? "null" : o.toString().replace("\n", "\n "); + } + + public static class Builder { + + private VideoContent instance; + + public Builder() { + this(new VideoContent()); + } + + protected Builder(VideoContent instance) { + this.instance = instance; + } + + public VideoContent.Builder type(StateContentType type) { + this.instance.type = type; + return this; + } + public VideoContent.Builder videoUrl(String videoUrl) { + this.instance.videoUrl = videoUrl; + return this; + } + public VideoContent.Builder fileId(String fileId) { + this.instance.fileId = fileId; + return this; + } + public VideoContent.Builder fps(Double fps) { + this.instance.fps = fps; + return this; + } + + + /** + * returns a built VideoContent instance. + * + * The builder is not reusable. + */ + public VideoContent build() { + try { + return this.instance; + } finally { + // ensure that this.instance is not reused + this.instance = null; + } + } + + @Override + public String toString() { + return getClass() + "=(" + instance + ")"; + } + } + + /** + * Create a builder with no initialized field. + */ + public static VideoContent.Builder builder() { + return new VideoContent.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public VideoContent.Builder toBuilder() { + return new VideoContent.Builder() + .type(getType()) + .videoUrl(getVideoUrl()) + .fileId(getFileId()) + .fps(getFps()); + } + + +}