diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4c5e4b0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,123 @@ +name: Java Release + +# Publishes com.volcengine:ark-runtime to Maven Central. Tags are created +# exclusively by ark-hand after a sync PR lands on main, so a pushed v* tag +# is always a reviewed release snapshot whose tree matches the internal +# source tree. Mirrors the proven setup from volcengine/volcengine-java-sdk: +# the `public` profile in pom.xml wires maven-javadoc/gpg and the +# central-publishing-maven-plugin (tokenAuth, autoPublish); this workflow +# only injects the Central token and the GPG signing key. +# +# The workflow_dispatch input allows re-publishing (or first-publishing) an +# existing tag — e.g. when secrets were still missing when the tag was +# originally pushed. +on: + push: + tags: + - "v*" + workflow_dispatch: + inputs: + tag: + description: "Release tag to publish (must already exist, e.g. v0.3.0)" + required: true + type: string + +permissions: + contents: read + +# Never cancel an in-flight publish; a second dispatch for the same tag +# should queue behind it instead of racing the upload. +concurrency: + group: java-release-${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} + cancel-in-progress: false + +jobs: + release: + name: Build and publish to Maven Central + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Resolve release tag + id: tag + env: + DISPATCH_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || '' }} + run: | + tag="${DISPATCH_TAG:-${GITHUB_REF_NAME}}" + case "${tag}" in + v[0-9]*.[0-9]*.0) ;; + *) + echo "::error::${tag} is not a release tag (expected vMAJOR.MINOR.0)" + exit 1 + ;; + esac + echo "name=${tag}" >> "$GITHUB_OUTPUT" + + - name: Check out repository + uses: actions/checkout@v4 + with: + ref: ${{ steps.tag.outputs.name }} + + - name: Verify pom version matches tag + env: + RELEASE_TAG: ${{ steps.tag.outputs.name }} + run: | + version="${RELEASE_TAG#v}" + actual=$(python3 -c " + import re + m = re.search(r'ark-runtime\s*([^<]+)', open('pom.xml').read()) + print(m.group(1) if m else 'missing') + ") + if [ "${actual}" != "${version}" ]; then + echo "::error::pom.xml ark-runtime version ${actual} does not match tag ${RELEASE_TAG}" + exit 1 + fi + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: "8" + distribution: "temurin" + server-id: central + server-username: MAVEN_CENTRAL_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg-passphrase: GPG_PASSPHRASE + + - name: Check Maven Central version + id: maven_check + env: + RELEASE_TAG: ${{ steps.tag.outputs.name }} + run: | + version="${RELEASE_TAG#v}" + pom_url="https://repo.maven.apache.org/maven2/com/volcengine/ark-runtime/${version}/ark-runtime-${version}.pom" + code=$(curl -sS -o /dev/null -w '%{http_code}' "${pom_url}") + echo "publish_needed=$([ "${code}" = "200" ] && echo false || echo true)" >> "$GITHUB_OUTPUT" + + - name: Check publish credentials + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} + OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + missing="" + [ -z "${OSSRH_USERNAME}" ] && missing="${missing} OSSRH_USERNAME" + [ -z "${OSSRH_TOKEN}" ] && missing="${missing} OSSRH_TOKEN" + [ -z "${GPG_PRIVATE_KEY}" ] && missing="${missing} GPG_PRIVATE_KEY" + [ -z "${GPG_PASSPHRASE}" ] && missing="${missing} GPG_PASSPHRASE" + if [ -n "${missing}" ]; then + echo "::error::missing repository secrets:${missing}" + exit 1 + fi + + - name: Publish to Maven Central + if: steps.maven_check.outputs.publish_needed == 'true' + run: | + mvn clean deploy -B -Ppublic -DskipTests \ + -Dmaven.javadoc.failOnError=false \ + -Dmaven.javadoc.quiet=true + env: + MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} diff --git a/README.md b/README.md index a299fbc..aa54131 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,14 @@ automatic retry logic. com.volcengine ark-runtime - 0.2.0 + 0.3.0 ``` ### Gradle ```groovy -implementation 'com.volcengine:ark-runtime:0.2.0' +implementation 'com.volcengine:ark-runtime:0.3.0' ``` ## Usage diff --git a/VERSION b/VERSION index 0ea3a94..0d91a54 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2.0 +0.3.0 diff --git a/pom.xml b/pom.xml index 2269c28..47d5bee 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.volcengine ark-runtime - 0.2.0 + 0.3.0 jar ark-runtime diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/ContentBlockStart.java b/src/main/java/com/volcengine/ark/runtime/models/messages/ContentBlockStart.java new file mode 100644 index 0000000..20c9d38 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/ContentBlockStart.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * ContentBlockStart + */ +@JsonPropertyOrder({ + ContentBlockStart.JSON_PROPERTY_TYPE, + ContentBlockStart.JSON_PROPERTY_INDEX, + ContentBlockStart.JSON_PROPERTY_CONTENT_BLOCK +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ContentBlockStart implements MessagesStreamEvent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesStreamEventType type = MessagesStreamEventType.CONTENT_BLOCK_START; + + public static final String JSON_PROPERTY_INDEX = "index"; + @javax.annotation.Nonnull + private Integer index; + + public static final String JSON_PROPERTY_CONTENT_BLOCK = "content_block"; + @javax.annotation.Nonnull + private ContentBlockStartContentBlock contentBlock; + + public ContentBlockStart() { + } + + public ContentBlockStart type(@javax.annotation.Nonnull MessagesStreamEventType 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 MessagesStreamEventType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesStreamEventType type) { + this.type = type; + } + + public ContentBlockStart index(@javax.annotation.Nonnull Integer index) { + + this.index = index; + return this; + } + + /** + * Get index + * @return index + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INDEX, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getIndex() { + return index; + } + + + @JsonProperty(value = JSON_PROPERTY_INDEX, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIndex(@javax.annotation.Nonnull Integer index) { + this.index = index; + } + + public ContentBlockStart contentBlock(@javax.annotation.Nonnull ContentBlockStartContentBlock contentBlock) { + + this.contentBlock = contentBlock; + return this; + } + + /** + * Get contentBlock + * @return contentBlock + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CONTENT_BLOCK, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public ContentBlockStartContentBlock getContentBlock() { + return contentBlock; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT_BLOCK, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContentBlock(@javax.annotation.Nonnull ContentBlockStartContentBlock contentBlock) { + this.contentBlock = contentBlock; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContentBlockStart contentBlockStart = (ContentBlockStart) o; + return Objects.equals(this.type, contentBlockStart.type) && + Objects.equals(this.index, contentBlockStart.index) && + Objects.equals(this.contentBlock, contentBlockStart.contentBlock); + } + + @Override + public int hashCode() { + return Objects.hash(type, index, contentBlock); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContentBlockStart {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" contentBlock: ").append(toIndentedString(contentBlock)).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 ContentBlockStart instance; + + public Builder() { + this(new ContentBlockStart()); + } + + protected Builder(ContentBlockStart instance) { + this.instance = instance; + } + + public ContentBlockStart.Builder type(MessagesStreamEventType type) { + this.instance.type = type; + return this; + } + public ContentBlockStart.Builder index(Integer index) { + this.instance.index = index; + return this; + } + public ContentBlockStart.Builder contentBlock(ContentBlockStartContentBlock contentBlock) { + this.instance.contentBlock = contentBlock; + return this; + } + + + /** + * returns a built ContentBlockStart instance. + * + * The builder is not reusable. + */ + public ContentBlockStart 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 ContentBlockStart.Builder builder() { + return new ContentBlockStart.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ContentBlockStart.Builder toBuilder() { + return new ContentBlockStart.Builder() + .type(getType()) + .index(getIndex()) + .contentBlock(getContentBlock()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/ContentBlockStartContentBlock.java b/src/main/java/com/volcengine/ark/runtime/models/messages/ContentBlockStartContentBlock.java new file mode 100644 index 0000000..3932568 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/ContentBlockStartContentBlock.java @@ -0,0 +1,34 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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 = MessagesResponseContentPartServerToolUse.class, name = "server_tool_use"), + @JsonSubTypes.Type(value = MessagesResponseContentPartText.class, name = "text"), + @JsonSubTypes.Type(value = MessagesResponseContentPartThinking.class, name = "thinking"), + @JsonSubTypes.Type(value = MessagesResponseContentPartToolUse.class, name = "tool_use"), + @JsonSubTypes.Type(value = MessagesResponseContentPartWebSearchToolResult.class, name = "web_search_tool_result"), +}) + +public interface ContentBlockStartContentBlock { + public ContentBlockStartContentBlockType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/ContentBlockStartContentBlockType.java b/src/main/java/com/volcengine/ark/runtime/models/messages/ContentBlockStartContentBlockType.java new file mode 100644 index 0000000..3c533be --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/ContentBlockStartContentBlockType.java @@ -0,0 +1,63 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ContentBlockStartContentBlockType + */ +public enum ContentBlockStartContentBlockType { + + SERVER_TOOL_USE("server_tool_use"), + + TEXT("text"), + + THINKING("thinking"), + + TOOL_USE("tool_use"), + + WEB_SEARCH_TOOL_RESULT("web_search_tool_result"); + + private String value; + + ContentBlockStartContentBlockType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ContentBlockStartContentBlockType fromValue(String value) { + for (ContentBlockStartContentBlockType b : ContentBlockStartContentBlockType.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/messages/ContentPartType.java b/src/main/java/com/volcengine/ark/runtime/models/messages/ContentPartType.java new file mode 100644 index 0000000..0387b45 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/ContentPartType.java @@ -0,0 +1,71 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets ContentPartType + */ +public enum ContentPartType { + + DOCUMENT("document"), + + IMAGE("image"), + + SERVER_TOOL_USE("server_tool_use"), + + TEXT("text"), + + THINKING("thinking"), + + TOOL_REFERENCE("tool_reference"), + + TOOL_RESULT("tool_result"), + + TOOL_USE("tool_use"), + + WEB_SEARCH_TOOL_RESULT("web_search_tool_result"); + + private String value; + + ContentPartType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ContentPartType fromValue(String value) { + for (ContentPartType b : ContentPartType.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/messages/CountTokensResponse.java b/src/main/java/com/volcengine/ark/runtime/models/messages/CountTokensResponse.java new file mode 100644 index 0000000..85efa25 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/CountTokensResponse.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Token count for a Messages request. + */ +@JsonPropertyOrder({ + CountTokensResponse.JSON_PROPERTY_INPUT_TOKENS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class CountTokensResponse { + public static final String JSON_PROPERTY_INPUT_TOKENS = "input_tokens"; + @javax.annotation.Nonnull + private Integer inputTokens; + + public CountTokensResponse() { + } + + public CountTokensResponse inputTokens(@javax.annotation.Nonnull Integer inputTokens) { + + this.inputTokens = inputTokens; + return this; + } + + /** + * Get inputTokens + * @return inputTokens + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getInputTokens() { + return inputTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_INPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputTokens(@javax.annotation.Nonnull Integer inputTokens) { + this.inputTokens = inputTokens; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CountTokensResponse countTokensResponse = (CountTokensResponse) o; + return Objects.equals(this.inputTokens, countTokensResponse.inputTokens); + } + + @Override + public int hashCode() { + return Objects.hash(inputTokens); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CountTokensResponse {\n"); + sb.append(" inputTokens: ").append(toIndentedString(inputTokens)).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 CountTokensResponse instance; + + public Builder() { + this(new CountTokensResponse()); + } + + protected Builder(CountTokensResponse instance) { + this.instance = instance; + } + + public CountTokensResponse.Builder inputTokens(Integer inputTokens) { + this.instance.inputTokens = inputTokens; + return this; + } + + + /** + * returns a built CountTokensResponse instance. + * + * The builder is not reusable. + */ + public CountTokensResponse 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 CountTokensResponse.Builder builder() { + return new CountTokensResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public CountTokensResponse.Builder toBuilder() { + return new CountTokensResponse.Builder() + .inputTokens(getInputTokens()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/Error.java b/src/main/java/com/volcengine/ark/runtime/models/messages/Error.java new file mode 100644 index 0000000..5b03f5d --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/Error.java @@ -0,0 +1,264 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * Error + */ +@JsonPropertyOrder({ + Error.JSON_PROPERTY_CODE, + Error.JSON_PROPERTY_MESSAGE, + Error.JSON_PROPERTY_PARAM, + Error.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class Error { + 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 Error() { + } + + public Error code(@javax.annotation.Nonnull String code) { + + this.code = code; + return this; + } + + /** + * A machine-readable error code. + * @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 Error message(@javax.annotation.Nonnull String message) { + + this.message = message; + return this; + } + + /** + * A human-readable description of the error. + * @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 Error param(@javax.annotation.Nonnull String param) { + + this.param = param; + return this; + } + + /** + * The parameter that caused the error, if applicable. + * @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 Error type(@javax.annotation.Nonnull String type) { + + this.type = type; + return this; + } + + /** + * The error type. + * @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; + } + Error error = (Error) o; + return Objects.equals(this.code, error.code) && + Objects.equals(this.message, error.message) && + Objects.equals(this.param, error.param) && + Objects.equals(this.type, error.type); + } + + @Override + public int hashCode() { + return Objects.hash(code, message, param, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Error {\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 Error instance; + + public Builder() { + this(new Error()); + } + + protected Builder(Error instance) { + this.instance = instance; + } + + public Error.Builder code(String code) { + this.instance.code = code; + return this; + } + public Error.Builder message(String message) { + this.instance.message = message; + return this; + } + public Error.Builder param(String param) { + this.instance.param = param; + return this; + } + public Error.Builder type(String type) { + this.instance.type = type; + return this; + } + + + /** + * returns a built Error instance. + * + * The builder is not reusable. + */ + public Error 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 Error.Builder builder() { + return new Error.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public Error.Builder toBuilder() { + return new Error.Builder() + .code(getCode()) + .message(getMessage()) + .param(getParam()) + .type(getType()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPart.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPart.java new file mode 100644 index 0000000..d27cf7e --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPart.java @@ -0,0 +1,37 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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 = MessagesContentPartDocument.class, name = "document"), + @JsonSubTypes.Type(value = MessagesContentPartImage.class, name = "image"), + @JsonSubTypes.Type(value = MessagesContentPartServerToolUse.class, name = "server_tool_use"), + @JsonSubTypes.Type(value = MessagesContentPartText.class, name = "text"), + @JsonSubTypes.Type(value = MessagesContentPartThinking.class, name = "thinking"), + @JsonSubTypes.Type(value = MessagesContentPartToolResult.class, name = "tool_result"), + @JsonSubTypes.Type(value = MessagesContentPartToolUse.class, name = "tool_use"), + @JsonSubTypes.Type(value = MessagesContentPartWebSearchToolResult.class, name = "web_search_tool_result"), +}) + +public interface MessagesContentPart { + public ContentPartType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartDocument.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartDocument.java new file mode 100644 index 0000000..a8c92a3 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartDocument.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContentPartDocument + */ +@JsonPropertyOrder({ + MessagesContentPartDocument.JSON_PROPERTY_TYPE, + MessagesContentPartDocument.JSON_PROPERTY_SOURCE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartDocument implements MessagesContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentPartType type = ContentPartType.DOCUMENT; + + public static final String JSON_PROPERTY_SOURCE = "source"; + @javax.annotation.Nonnull + private MessagesContentPartDocumentSource source; + + public MessagesContentPartDocument() { + } + + public MessagesContentPartDocument type(@javax.annotation.Nonnull ContentPartType 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 ContentPartType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentPartType type) { + this.type = type; + } + + public MessagesContentPartDocument source(@javax.annotation.Nonnull MessagesContentPartDocumentSource source) { + + this.source = source; + return this; + } + + /** + * Get source + * @return source + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesContentPartDocumentSource getSource() { + return source; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSource(@javax.annotation.Nonnull MessagesContentPartDocumentSource source) { + this.source = source; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartDocument messagesContentPartDocument = (MessagesContentPartDocument) o; + return Objects.equals(this.type, messagesContentPartDocument.type) && + Objects.equals(this.source, messagesContentPartDocument.source); + } + + @Override + public int hashCode() { + return Objects.hash(type, source); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartDocument {\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 MessagesContentPartDocument instance; + + public Builder() { + this(new MessagesContentPartDocument()); + } + + protected Builder(MessagesContentPartDocument instance) { + this.instance = instance; + } + + public MessagesContentPartDocument.Builder type(ContentPartType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartDocument.Builder source(MessagesContentPartDocumentSource source) { + this.instance.source = source; + return this; + } + + + /** + * returns a built MessagesContentPartDocument instance. + * + * The builder is not reusable. + */ + public MessagesContentPartDocument 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 MessagesContentPartDocument.Builder builder() { + return new MessagesContentPartDocument.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartDocument.Builder toBuilder() { + return new MessagesContentPartDocument.Builder() + .type(getType()) + .source(getSource()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartDocumentSource.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartDocumentSource.java new file mode 100644 index 0000000..bb67396 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartDocumentSource.java @@ -0,0 +1,264 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContentPartDocumentSource + */ +@JsonPropertyOrder({ + MessagesContentPartDocumentSource.JSON_PROPERTY_TYPE, + MessagesContentPartDocumentSource.JSON_PROPERTY_URL, + MessagesContentPartDocumentSource.JSON_PROPERTY_DATA, + MessagesContentPartDocumentSource.JSON_PROPERTY_CONTENT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartDocumentSource { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesDocumentSourceType type; + + public static final String JSON_PROPERTY_URL = "url"; + @javax.annotation.Nullable + private String url; + + public static final String JSON_PROPERTY_DATA = "data"; + @javax.annotation.Nullable + private String data; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nullable + private MessagesMessageContent content; + + public MessagesContentPartDocumentSource() { + } + + public MessagesContentPartDocumentSource type(@javax.annotation.Nonnull MessagesDocumentSourceType type) { + + this.type = type; + return this; + } + + /** + * How the document is supplied. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesDocumentSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesDocumentSourceType type) { + this.type = type; + } + + public MessagesContentPartDocumentSource url(@javax.annotation.Nullable String url) { + + this.url = url; + return this; + } + + /** + * A URL of the document when `type` is `url`. + * @return url + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + public MessagesContentPartDocumentSource data(@javax.annotation.Nullable String data) { + + this.data = data; + return this; + } + + /** + * Document data for `base64` and `text` sources. + * @return data + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@javax.annotation.Nullable String data) { + this.data = data; + } + + public MessagesContentPartDocumentSource content(@javax.annotation.Nullable MessagesMessageContent content) { + + this.content = content; + return this; + } + + /** + * Inline document content when `type` is `content`. + * @return content + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesMessageContent getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContent(@javax.annotation.Nullable MessagesMessageContent content) { + this.content = content; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartDocumentSource messagesContentPartDocumentSource = (MessagesContentPartDocumentSource) o; + return Objects.equals(this.type, messagesContentPartDocumentSource.type) && + Objects.equals(this.url, messagesContentPartDocumentSource.url) && + Objects.equals(this.data, messagesContentPartDocumentSource.data) && + Objects.equals(this.content, messagesContentPartDocumentSource.content); + } + + @Override + public int hashCode() { + return Objects.hash(type, url, data, content); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartDocumentSource {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 MessagesContentPartDocumentSource instance; + + public Builder() { + this(new MessagesContentPartDocumentSource()); + } + + protected Builder(MessagesContentPartDocumentSource instance) { + this.instance = instance; + } + + public MessagesContentPartDocumentSource.Builder type(MessagesDocumentSourceType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartDocumentSource.Builder url(String url) { + this.instance.url = url; + return this; + } + public MessagesContentPartDocumentSource.Builder data(String data) { + this.instance.data = data; + return this; + } + public MessagesContentPartDocumentSource.Builder content(MessagesMessageContent content) { + this.instance.content = content; + return this; + } + + + /** + * returns a built MessagesContentPartDocumentSource instance. + * + * The builder is not reusable. + */ + public MessagesContentPartDocumentSource 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 MessagesContentPartDocumentSource.Builder builder() { + return new MessagesContentPartDocumentSource.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartDocumentSource.Builder toBuilder() { + return new MessagesContentPartDocumentSource.Builder() + .type(getType()) + .url(getUrl()) + .data(getData()) + .content(getContent()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartImage.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartImage.java new file mode 100644 index 0000000..6abc7ac --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartImage.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContentPartImage + */ +@JsonPropertyOrder({ + MessagesContentPartImage.JSON_PROPERTY_TYPE, + MessagesContentPartImage.JSON_PROPERTY_SOURCE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartImage implements MessagesContentPart, MessagesToolResultContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentPartType type = ContentPartType.IMAGE; + + public static final String JSON_PROPERTY_SOURCE = "source"; + @javax.annotation.Nonnull + private MessagesContentPartImageSource source; + + public MessagesContentPartImage() { + } + + public MessagesContentPartImage type(@javax.annotation.Nonnull ContentPartType 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 ContentPartType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentPartType type) { + this.type = type; + } + + public MessagesContentPartImage source(@javax.annotation.Nonnull MessagesContentPartImageSource source) { + + this.source = source; + return this; + } + + /** + * Get source + * @return source + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesContentPartImageSource getSource() { + return source; + } + + + @JsonProperty(value = JSON_PROPERTY_SOURCE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSource(@javax.annotation.Nonnull MessagesContentPartImageSource source) { + this.source = source; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartImage messagesContentPartImage = (MessagesContentPartImage) o; + return Objects.equals(this.type, messagesContentPartImage.type) && + Objects.equals(this.source, messagesContentPartImage.source); + } + + @Override + public int hashCode() { + return Objects.hash(type, source); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartImage {\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 MessagesContentPartImage instance; + + public Builder() { + this(new MessagesContentPartImage()); + } + + protected Builder(MessagesContentPartImage instance) { + this.instance = instance; + } + + public MessagesContentPartImage.Builder type(ContentPartType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartImage.Builder source(MessagesContentPartImageSource source) { + this.instance.source = source; + return this; + } + + + /** + * returns a built MessagesContentPartImage instance. + * + * The builder is not reusable. + */ + public MessagesContentPartImage 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 MessagesContentPartImage.Builder builder() { + return new MessagesContentPartImage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartImage.Builder toBuilder() { + return new MessagesContentPartImage.Builder() + .type(getType()) + .source(getSource()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartImageSource.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartImageSource.java new file mode 100644 index 0000000..800ae6d --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartImageSource.java @@ -0,0 +1,338 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContentPartImageSource + */ +@JsonPropertyOrder({ + MessagesContentPartImageSource.JSON_PROPERTY_TYPE, + MessagesContentPartImageSource.JSON_PROPERTY_URL, + MessagesContentPartImageSource.JSON_PROPERTY_MEDIA_TYPE, + MessagesContentPartImageSource.JSON_PROPERTY_DATA, + MessagesContentPartImageSource.JSON_PROPERTY_FILE_ID, + MessagesContentPartImageSource.JSON_PROPERTY_IS_FRAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartImageSource { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesImageSourceType type; + + public static final String JSON_PROPERTY_URL = "url"; + @javax.annotation.Nullable + private String url; + + public static final String JSON_PROPERTY_MEDIA_TYPE = "media_type"; + @javax.annotation.Nullable + private String mediaType; + + public static final String JSON_PROPERTY_DATA = "data"; + @javax.annotation.Nullable + private String data; + + public static final String JSON_PROPERTY_FILE_ID = "file_id"; + @javax.annotation.Nullable + private String fileId; + + public static final String JSON_PROPERTY_IS_FRAME = "is_frame"; + @javax.annotation.Nullable + private Boolean isFrame; + + public MessagesContentPartImageSource() { + } + + public MessagesContentPartImageSource type(@javax.annotation.Nonnull MessagesImageSourceType type) { + + this.type = type; + return this; + } + + /** + * How the image is supplied. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesImageSourceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesImageSourceType type) { + this.type = type; + } + + public MessagesContentPartImageSource url(@javax.annotation.Nullable String url) { + + this.url = url; + return this; + } + + /** + * A URL of the image when `type` is `url`. + * @return url + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUrl() { + return url; + } + + + @JsonProperty(value = JSON_PROPERTY_URL, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + public MessagesContentPartImageSource mediaType(@javax.annotation.Nullable String mediaType) { + + this.mediaType = mediaType; + return this; + } + + /** + * The media type of base64-encoded image data. + * @return mediaType + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MEDIA_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getMediaType() { + return mediaType; + } + + + @JsonProperty(value = JSON_PROPERTY_MEDIA_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMediaType(@javax.annotation.Nullable String mediaType) { + this.mediaType = mediaType; + } + + public MessagesContentPartImageSource data(@javax.annotation.Nullable String data) { + + this.data = data; + return this; + } + + /** + * Base64-encoded image data when `type` is `base64`. + * @return data + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getData() { + return data; + } + + + @JsonProperty(value = JSON_PROPERTY_DATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setData(@javax.annotation.Nullable String data) { + this.data = data; + } + + public MessagesContentPartImageSource fileId(@javax.annotation.Nullable String fileId) { + + this.fileId = fileId; + return this; + } + + /** + * The blob id of an image uploaded out-of-band. + * @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 MessagesContentPartImageSource isFrame(@javax.annotation.Nullable Boolean isFrame) { + + this.isFrame = isFrame; + return this; + } + + /** + * Whether this image was extracted from a document or video. + * @return isFrame + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_FRAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsFrame() { + return isFrame; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_FRAME, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsFrame(@javax.annotation.Nullable Boolean isFrame) { + this.isFrame = isFrame; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartImageSource messagesContentPartImageSource = (MessagesContentPartImageSource) o; + return Objects.equals(this.type, messagesContentPartImageSource.type) && + Objects.equals(this.url, messagesContentPartImageSource.url) && + Objects.equals(this.mediaType, messagesContentPartImageSource.mediaType) && + Objects.equals(this.data, messagesContentPartImageSource.data) && + Objects.equals(this.fileId, messagesContentPartImageSource.fileId) && + Objects.equals(this.isFrame, messagesContentPartImageSource.isFrame); + } + + @Override + public int hashCode() { + return Objects.hash(type, url, mediaType, data, fileId, isFrame); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartImageSource {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" mediaType: ").append(toIndentedString(mediaType)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" fileId: ").append(toIndentedString(fileId)).append("\n"); + sb.append(" isFrame: ").append(toIndentedString(isFrame)).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 MessagesContentPartImageSource instance; + + public Builder() { + this(new MessagesContentPartImageSource()); + } + + protected Builder(MessagesContentPartImageSource instance) { + this.instance = instance; + } + + public MessagesContentPartImageSource.Builder type(MessagesImageSourceType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartImageSource.Builder url(String url) { + this.instance.url = url; + return this; + } + public MessagesContentPartImageSource.Builder mediaType(String mediaType) { + this.instance.mediaType = mediaType; + return this; + } + public MessagesContentPartImageSource.Builder data(String data) { + this.instance.data = data; + return this; + } + public MessagesContentPartImageSource.Builder fileId(String fileId) { + this.instance.fileId = fileId; + return this; + } + public MessagesContentPartImageSource.Builder isFrame(Boolean isFrame) { + this.instance.isFrame = isFrame; + return this; + } + + + /** + * returns a built MessagesContentPartImageSource instance. + * + * The builder is not reusable. + */ + public MessagesContentPartImageSource 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 MessagesContentPartImageSource.Builder builder() { + return new MessagesContentPartImageSource.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartImageSource.Builder toBuilder() { + return new MessagesContentPartImageSource.Builder() + .type(getType()) + .url(getUrl()) + .mediaType(getMediaType()) + .data(getData()) + .fileId(getFileId()) + .isFrame(getIsFrame()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartServerToolUse.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartServerToolUse.java new file mode 100644 index 0000000..09ce442 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartServerToolUse.java @@ -0,0 +1,270 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesContentPartServerToolUse + */ +@JsonPropertyOrder({ + MessagesContentPartServerToolUse.JSON_PROPERTY_TYPE, + MessagesContentPartServerToolUse.JSON_PROPERTY_ID, + MessagesContentPartServerToolUse.JSON_PROPERTY_NAME, + MessagesContentPartServerToolUse.JSON_PROPERTY_INPUT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartServerToolUse implements MessagesContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentPartType type = ContentPartType.SERVER_TOOL_USE; + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_INPUT = "input"; + @javax.annotation.Nonnull + private Map input; + + public MessagesContentPartServerToolUse() { + } + + public MessagesContentPartServerToolUse type(@javax.annotation.Nonnull ContentPartType 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 ContentPartType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentPartType type) { + this.type = type; + } + + public MessagesContentPartServerToolUse id(@javax.annotation.Nonnull String id) { + + this.id = id; + return this; + } + + /** + * The public id of the server-managed tool invocation. + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + public MessagesContentPartServerToolUse name(@javax.annotation.Nonnull String name) { + + this.name = name; + return this; + } + + /** + * The name of the invoked server-managed tool. + * @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 MessagesContentPartServerToolUse input(@javax.annotation.Nonnull Map input) { + + this.input = input; + return this; + } + + public MessagesContentPartServerToolUse putInputItem(String key, Object inputItem) { + this.input.put(key, inputItem); + return this; + } + + /** + * The input generated for the tool. + * @return input + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INPUT, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + + public Map getInput() { + return input; + } + + + @JsonProperty(value = JSON_PROPERTY_INPUT, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setInput(@javax.annotation.Nonnull Map input) { + this.input = input; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartServerToolUse messagesContentPartServerToolUse = (MessagesContentPartServerToolUse) o; + return Objects.equals(this.type, messagesContentPartServerToolUse.type) && + Objects.equals(this.id, messagesContentPartServerToolUse.id) && + Objects.equals(this.name, messagesContentPartServerToolUse.name) && + Objects.equals(this.input, messagesContentPartServerToolUse.input); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, name, input); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartServerToolUse {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).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 MessagesContentPartServerToolUse instance; + + public Builder() { + this(new MessagesContentPartServerToolUse()); + } + + protected Builder(MessagesContentPartServerToolUse instance) { + this.instance = instance; + } + + public MessagesContentPartServerToolUse.Builder type(ContentPartType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartServerToolUse.Builder id(String id) { + this.instance.id = id; + return this; + } + public MessagesContentPartServerToolUse.Builder name(String name) { + this.instance.name = name; + return this; + } + public MessagesContentPartServerToolUse.Builder input(Map input) { + this.instance.input = input; + return this; + } + + + /** + * returns a built MessagesContentPartServerToolUse instance. + * + * The builder is not reusable. + */ + public MessagesContentPartServerToolUse 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 MessagesContentPartServerToolUse.Builder builder() { + return new MessagesContentPartServerToolUse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartServerToolUse.Builder toBuilder() { + return new MessagesContentPartServerToolUse.Builder() + .type(getType()) + .id(getId()) + .name(getName()) + .input(getInput()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartText.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartText.java new file mode 100644 index 0000000..3742099 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartText.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContentPartText + */ +@JsonPropertyOrder({ + MessagesContentPartText.JSON_PROPERTY_TYPE, + MessagesContentPartText.JSON_PROPERTY_TEXT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartText implements MessagesContentPart, MessagesToolResultContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentPartType type = ContentPartType.TEXT; + + public static final String JSON_PROPERTY_TEXT = "text"; + @javax.annotation.Nonnull + private String text; + + public MessagesContentPartText() { + } + + public MessagesContentPartText type(@javax.annotation.Nonnull ContentPartType 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 ContentPartType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentPartType type) { + this.type = type; + } + + public MessagesContentPartText text(@javax.annotation.Nonnull String text) { + + this.text = text; + return this; + } + + /** + * The text content. + * @return text + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getText() { + return text; + } + + + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(@javax.annotation.Nonnull String text) { + this.text = text; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartText messagesContentPartText = (MessagesContentPartText) o; + return Objects.equals(this.type, messagesContentPartText.type) && + Objects.equals(this.text, messagesContentPartText.text); + } + + @Override + public int hashCode() { + return Objects.hash(type, text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartText {\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 MessagesContentPartText instance; + + public Builder() { + this(new MessagesContentPartText()); + } + + protected Builder(MessagesContentPartText instance) { + this.instance = instance; + } + + public MessagesContentPartText.Builder type(ContentPartType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartText.Builder text(String text) { + this.instance.text = text; + return this; + } + + + /** + * returns a built MessagesContentPartText instance. + * + * The builder is not reusable. + */ + public MessagesContentPartText 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 MessagesContentPartText.Builder builder() { + return new MessagesContentPartText.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartText.Builder toBuilder() { + return new MessagesContentPartText.Builder() + .type(getType()) + .text(getText()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartThinking.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartThinking.java new file mode 100644 index 0000000..870d557 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartThinking.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContentPartThinking + */ +@JsonPropertyOrder({ + MessagesContentPartThinking.JSON_PROPERTY_TYPE, + MessagesContentPartThinking.JSON_PROPERTY_THINKING, + MessagesContentPartThinking.JSON_PROPERTY_SIGNATURE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartThinking implements MessagesContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentPartType type = ContentPartType.THINKING; + + public static final String JSON_PROPERTY_THINKING = "thinking"; + @javax.annotation.Nullable + private String thinking; + + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @javax.annotation.Nullable + private String signature; + + public MessagesContentPartThinking() { + } + + public MessagesContentPartThinking type(@javax.annotation.Nonnull ContentPartType 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 ContentPartType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentPartType type) { + this.type = type; + } + + public MessagesContentPartThinking thinking(@javax.annotation.Nullable String thinking) { + + this.thinking = thinking; + return this; + } + + /** + * The model's thinking content. + * @return thinking + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_THINKING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getThinking() { + return thinking; + } + + + @JsonProperty(value = JSON_PROPERTY_THINKING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThinking(@javax.annotation.Nullable String thinking) { + this.thinking = thinking; + } + + public MessagesContentPartThinking signature(@javax.annotation.Nullable String signature) { + + this.signature = signature; + return this; + } + + /** + * An opaque signature used to replay thinking content. + * @return signature + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignature() { + return signature; + } + + + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignature(@javax.annotation.Nullable String signature) { + this.signature = signature; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartThinking messagesContentPartThinking = (MessagesContentPartThinking) o; + return Objects.equals(this.type, messagesContentPartThinking.type) && + Objects.equals(this.thinking, messagesContentPartThinking.thinking) && + Objects.equals(this.signature, messagesContentPartThinking.signature); + } + + @Override + public int hashCode() { + return Objects.hash(type, thinking, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartThinking {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" thinking: ").append(toIndentedString(thinking)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).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 MessagesContentPartThinking instance; + + public Builder() { + this(new MessagesContentPartThinking()); + } + + protected Builder(MessagesContentPartThinking instance) { + this.instance = instance; + } + + public MessagesContentPartThinking.Builder type(ContentPartType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartThinking.Builder thinking(String thinking) { + this.instance.thinking = thinking; + return this; + } + public MessagesContentPartThinking.Builder signature(String signature) { + this.instance.signature = signature; + return this; + } + + + /** + * returns a built MessagesContentPartThinking instance. + * + * The builder is not reusable. + */ + public MessagesContentPartThinking 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 MessagesContentPartThinking.Builder builder() { + return new MessagesContentPartThinking.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartThinking.Builder toBuilder() { + return new MessagesContentPartThinking.Builder() + .type(getType()) + .thinking(getThinking()) + .signature(getSignature()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartToolReference.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartToolReference.java new file mode 100644 index 0000000..3cb0b72 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartToolReference.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContentPartToolReference + */ +@JsonPropertyOrder({ + MessagesContentPartToolReference.JSON_PROPERTY_TYPE, + MessagesContentPartToolReference.JSON_PROPERTY_TOOL_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartToolReference implements MessagesToolResultContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentPartType type = ContentPartType.TOOL_REFERENCE; + + public static final String JSON_PROPERTY_TOOL_NAME = "tool_name"; + @javax.annotation.Nonnull + private String toolName; + + public MessagesContentPartToolReference() { + } + + public MessagesContentPartToolReference type(@javax.annotation.Nonnull ContentPartType 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 ContentPartType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentPartType type) { + this.type = type; + } + + public MessagesContentPartToolReference toolName(@javax.annotation.Nonnull String toolName) { + + this.toolName = toolName; + return this; + } + + /** + * The referenced tool name. + * @return toolName + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TOOL_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getToolName() { + return toolName; + } + + + @JsonProperty(value = JSON_PROPERTY_TOOL_NAME, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setToolName(@javax.annotation.Nonnull String toolName) { + this.toolName = toolName; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartToolReference messagesContentPartToolReference = (MessagesContentPartToolReference) o; + return Objects.equals(this.type, messagesContentPartToolReference.type) && + Objects.equals(this.toolName, messagesContentPartToolReference.toolName); + } + + @Override + public int hashCode() { + return Objects.hash(type, toolName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartToolReference {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" toolName: ").append(toIndentedString(toolName)).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 MessagesContentPartToolReference instance; + + public Builder() { + this(new MessagesContentPartToolReference()); + } + + protected Builder(MessagesContentPartToolReference instance) { + this.instance = instance; + } + + public MessagesContentPartToolReference.Builder type(ContentPartType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartToolReference.Builder toolName(String toolName) { + this.instance.toolName = toolName; + return this; + } + + + /** + * returns a built MessagesContentPartToolReference instance. + * + * The builder is not reusable. + */ + public MessagesContentPartToolReference 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 MessagesContentPartToolReference.Builder builder() { + return new MessagesContentPartToolReference.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartToolReference.Builder toBuilder() { + return new MessagesContentPartToolReference.Builder() + .type(getType()) + .toolName(getToolName()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartToolResult.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartToolResult.java new file mode 100644 index 0000000..2fd103f --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartToolResult.java @@ -0,0 +1,264 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContentPartToolResult + */ +@JsonPropertyOrder({ + MessagesContentPartToolResult.JSON_PROPERTY_TYPE, + MessagesContentPartToolResult.JSON_PROPERTY_TOOL_USE_ID, + MessagesContentPartToolResult.JSON_PROPERTY_CONTENT, + MessagesContentPartToolResult.JSON_PROPERTY_IS_ERROR +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartToolResult implements MessagesContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentPartType type = ContentPartType.TOOL_RESULT; + + public static final String JSON_PROPERTY_TOOL_USE_ID = "tool_use_id"; + @javax.annotation.Nonnull + private String toolUseId; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nonnull + private MessagesToolResultContent content; + + public static final String JSON_PROPERTY_IS_ERROR = "is_error"; + @javax.annotation.Nullable + private Boolean isError; + + public MessagesContentPartToolResult() { + } + + public MessagesContentPartToolResult type(@javax.annotation.Nonnull ContentPartType 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 ContentPartType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentPartType type) { + this.type = type; + } + + public MessagesContentPartToolResult toolUseId(@javax.annotation.Nonnull String toolUseId) { + + this.toolUseId = toolUseId; + return this; + } + + /** + * The tool invocation this result answers. + * @return toolUseId + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TOOL_USE_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getToolUseId() { + return toolUseId; + } + + + @JsonProperty(value = JSON_PROPERTY_TOOL_USE_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setToolUseId(@javax.annotation.Nonnull String toolUseId) { + this.toolUseId = toolUseId; + } + + public MessagesContentPartToolResult content(@javax.annotation.Nonnull MessagesToolResultContent content) { + + this.content = content; + return this; + } + + /** + * The content returned by the tool. + * @return content + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesToolResultContent getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(@javax.annotation.Nonnull MessagesToolResultContent content) { + this.content = content; + } + + public MessagesContentPartToolResult isError(@javax.annotation.Nullable Boolean isError) { + + this.isError = isError; + return this; + } + + /** + * Whether the tool execution failed. + * @return isError + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_IS_ERROR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIsError() { + return isError; + } + + + @JsonProperty(value = JSON_PROPERTY_IS_ERROR, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIsError(@javax.annotation.Nullable Boolean isError) { + this.isError = isError; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartToolResult messagesContentPartToolResult = (MessagesContentPartToolResult) o; + return Objects.equals(this.type, messagesContentPartToolResult.type) && + Objects.equals(this.toolUseId, messagesContentPartToolResult.toolUseId) && + Objects.equals(this.content, messagesContentPartToolResult.content) && + Objects.equals(this.isError, messagesContentPartToolResult.isError); + } + + @Override + public int hashCode() { + return Objects.hash(type, toolUseId, content, isError); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartToolResult {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" toolUseId: ").append(toIndentedString(toolUseId)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" isError: ").append(toIndentedString(isError)).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 MessagesContentPartToolResult instance; + + public Builder() { + this(new MessagesContentPartToolResult()); + } + + protected Builder(MessagesContentPartToolResult instance) { + this.instance = instance; + } + + public MessagesContentPartToolResult.Builder type(ContentPartType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartToolResult.Builder toolUseId(String toolUseId) { + this.instance.toolUseId = toolUseId; + return this; + } + public MessagesContentPartToolResult.Builder content(MessagesToolResultContent content) { + this.instance.content = content; + return this; + } + public MessagesContentPartToolResult.Builder isError(Boolean isError) { + this.instance.isError = isError; + return this; + } + + + /** + * returns a built MessagesContentPartToolResult instance. + * + * The builder is not reusable. + */ + public MessagesContentPartToolResult 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 MessagesContentPartToolResult.Builder builder() { + return new MessagesContentPartToolResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartToolResult.Builder toBuilder() { + return new MessagesContentPartToolResult.Builder() + .type(getType()) + .toolUseId(getToolUseId()) + .content(getContent()) + .isError(getIsError()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartToolUse.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartToolUse.java new file mode 100644 index 0000000..dd5c2b1 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartToolUse.java @@ -0,0 +1,270 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesContentPartToolUse + */ +@JsonPropertyOrder({ + MessagesContentPartToolUse.JSON_PROPERTY_TYPE, + MessagesContentPartToolUse.JSON_PROPERTY_ID, + MessagesContentPartToolUse.JSON_PROPERTY_NAME, + MessagesContentPartToolUse.JSON_PROPERTY_INPUT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartToolUse implements MessagesContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentPartType type = ContentPartType.TOOL_USE; + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_INPUT = "input"; + @javax.annotation.Nonnull + private Map input; + + public MessagesContentPartToolUse() { + } + + public MessagesContentPartToolUse type(@javax.annotation.Nonnull ContentPartType 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 ContentPartType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentPartType type) { + this.type = type; + } + + public MessagesContentPartToolUse id(@javax.annotation.Nonnull String id) { + + this.id = id; + return this; + } + + /** + * The id of the tool invocation. + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + public MessagesContentPartToolUse name(@javax.annotation.Nonnull String name) { + + this.name = name; + return this; + } + + /** + * The name of the invoked tool. + * @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 MessagesContentPartToolUse input(@javax.annotation.Nonnull Map input) { + + this.input = input; + return this; + } + + public MessagesContentPartToolUse putInputItem(String key, Object inputItem) { + this.input.put(key, inputItem); + return this; + } + + /** + * The input generated for the tool. + * @return input + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INPUT, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + + public Map getInput() { + return input; + } + + + @JsonProperty(value = JSON_PROPERTY_INPUT, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setInput(@javax.annotation.Nonnull Map input) { + this.input = input; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartToolUse messagesContentPartToolUse = (MessagesContentPartToolUse) o; + return Objects.equals(this.type, messagesContentPartToolUse.type) && + Objects.equals(this.id, messagesContentPartToolUse.id) && + Objects.equals(this.name, messagesContentPartToolUse.name) && + Objects.equals(this.input, messagesContentPartToolUse.input); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, name, input); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartToolUse {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).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 MessagesContentPartToolUse instance; + + public Builder() { + this(new MessagesContentPartToolUse()); + } + + protected Builder(MessagesContentPartToolUse instance) { + this.instance = instance; + } + + public MessagesContentPartToolUse.Builder type(ContentPartType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartToolUse.Builder id(String id) { + this.instance.id = id; + return this; + } + public MessagesContentPartToolUse.Builder name(String name) { + this.instance.name = name; + return this; + } + public MessagesContentPartToolUse.Builder input(Map input) { + this.instance.input = input; + return this; + } + + + /** + * returns a built MessagesContentPartToolUse instance. + * + * The builder is not reusable. + */ + public MessagesContentPartToolUse 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 MessagesContentPartToolUse.Builder builder() { + return new MessagesContentPartToolUse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartToolUse.Builder toBuilder() { + return new MessagesContentPartToolUse.Builder() + .type(getType()) + .id(getId()) + .name(getName()) + .input(getInput()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartWebSearchToolResult.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartWebSearchToolResult.java new file mode 100644 index 0000000..e165f43 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContentPartWebSearchToolResult.java @@ -0,0 +1,264 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContentPartWebSearchToolResult + */ +@JsonPropertyOrder({ + MessagesContentPartWebSearchToolResult.JSON_PROPERTY_TYPE, + MessagesContentPartWebSearchToolResult.JSON_PROPERTY_TOOL_USE_ID, + MessagesContentPartWebSearchToolResult.JSON_PROPERTY_CONTENT, + MessagesContentPartWebSearchToolResult.JSON_PROPERTY_CALLER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContentPartWebSearchToolResult implements MessagesContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentPartType type = ContentPartType.WEB_SEARCH_TOOL_RESULT; + + public static final String JSON_PROPERTY_TOOL_USE_ID = "tool_use_id"; + @javax.annotation.Nonnull + private String toolUseId; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nonnull + private MessagesWebSearchToolResultContent content; + + public static final String JSON_PROPERTY_CALLER = "caller"; + @javax.annotation.Nullable + private MessagesServerToolCaller caller; + + public MessagesContentPartWebSearchToolResult() { + } + + public MessagesContentPartWebSearchToolResult type(@javax.annotation.Nonnull ContentPartType 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 ContentPartType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentPartType type) { + this.type = type; + } + + public MessagesContentPartWebSearchToolResult toolUseId(@javax.annotation.Nonnull String toolUseId) { + + this.toolUseId = toolUseId; + return this; + } + + /** + * The server-tool invocation this result answers. + * @return toolUseId + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TOOL_USE_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getToolUseId() { + return toolUseId; + } + + + @JsonProperty(value = JSON_PROPERTY_TOOL_USE_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setToolUseId(@javax.annotation.Nonnull String toolUseId) { + this.toolUseId = toolUseId; + } + + public MessagesContentPartWebSearchToolResult content(@javax.annotation.Nonnull MessagesWebSearchToolResultContent content) { + + this.content = content; + return this; + } + + /** + * Get content + * @return content + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesWebSearchToolResultContent getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(@javax.annotation.Nonnull MessagesWebSearchToolResultContent content) { + this.content = content; + } + + public MessagesContentPartWebSearchToolResult caller(@javax.annotation.Nullable MessagesServerToolCaller caller) { + + this.caller = caller; + return this; + } + + /** + * Get caller + * @return caller + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CALLER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesServerToolCaller getCaller() { + return caller; + } + + + @JsonProperty(value = JSON_PROPERTY_CALLER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCaller(@javax.annotation.Nullable MessagesServerToolCaller caller) { + this.caller = caller; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContentPartWebSearchToolResult messagesContentPartWebSearchToolResult = (MessagesContentPartWebSearchToolResult) o; + return Objects.equals(this.type, messagesContentPartWebSearchToolResult.type) && + Objects.equals(this.toolUseId, messagesContentPartWebSearchToolResult.toolUseId) && + Objects.equals(this.content, messagesContentPartWebSearchToolResult.content) && + Objects.equals(this.caller, messagesContentPartWebSearchToolResult.caller); + } + + @Override + public int hashCode() { + return Objects.hash(type, toolUseId, content, caller); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContentPartWebSearchToolResult {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" toolUseId: ").append(toIndentedString(toolUseId)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" caller: ").append(toIndentedString(caller)).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 MessagesContentPartWebSearchToolResult instance; + + public Builder() { + this(new MessagesContentPartWebSearchToolResult()); + } + + protected Builder(MessagesContentPartWebSearchToolResult instance) { + this.instance = instance; + } + + public MessagesContentPartWebSearchToolResult.Builder type(ContentPartType type) { + this.instance.type = type; + return this; + } + public MessagesContentPartWebSearchToolResult.Builder toolUseId(String toolUseId) { + this.instance.toolUseId = toolUseId; + return this; + } + public MessagesContentPartWebSearchToolResult.Builder content(MessagesWebSearchToolResultContent content) { + this.instance.content = content; + return this; + } + public MessagesContentPartWebSearchToolResult.Builder caller(MessagesServerToolCaller caller) { + this.instance.caller = caller; + return this; + } + + + /** + * returns a built MessagesContentPartWebSearchToolResult instance. + * + * The builder is not reusable. + */ + public MessagesContentPartWebSearchToolResult 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 MessagesContentPartWebSearchToolResult.Builder builder() { + return new MessagesContentPartWebSearchToolResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContentPartWebSearchToolResult.Builder toBuilder() { + return new MessagesContentPartWebSearchToolResult.Builder() + .type(getType()) + .toolUseId(getToolUseId()) + .content(getContent()) + .caller(getCaller()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagement.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagement.java new file mode 100644 index 0000000..694e4f2 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagement.java @@ -0,0 +1,163 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesContextManagement + */ +@JsonPropertyOrder({ + MessagesContextManagement.JSON_PROPERTY_EDITS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContextManagement { + public static final String JSON_PROPERTY_EDITS = "edits"; + @javax.annotation.Nullable + private List edits; + + public MessagesContextManagement() { + } + + public MessagesContextManagement edits(@javax.annotation.Nullable List edits) { + + this.edits = edits; + return this; + } + + public MessagesContextManagement addEditsItem(MessagesContextManagementEdit editsItem) { + if (this.edits == null) { + this.edits = new ArrayList<>(); + } + this.edits.add(editsItem); + return this; + } + + /** + * Get edits + * @return edits + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EDITS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + + public List getEdits() { + return edits; + } + + + @JsonProperty(value = JSON_PROPERTY_EDITS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + public void setEdits(@javax.annotation.Nullable List edits) { + this.edits = edits; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContextManagement messagesContextManagement = (MessagesContextManagement) o; + return Objects.equals(this.edits, messagesContextManagement.edits); + } + + @Override + public int hashCode() { + return Objects.hash(edits); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContextManagement {\n"); + sb.append(" edits: ").append(toIndentedString(edits)).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 MessagesContextManagement instance; + + public Builder() { + this(new MessagesContextManagement()); + } + + protected Builder(MessagesContextManagement instance) { + this.instance = instance; + } + + public MessagesContextManagement.Builder edits(List edits) { + this.instance.edits = edits; + return this; + } + + + /** + * returns a built MessagesContextManagement instance. + * + * The builder is not reusable. + */ + public MessagesContextManagement 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 MessagesContextManagement.Builder builder() { + return new MessagesContextManagement.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContextManagement.Builder toBuilder() { + return new MessagesContextManagement.Builder() + .edits(getEdits()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementClearThinking.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementClearThinking.java new file mode 100644 index 0000000..1182da5 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementClearThinking.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesContextManagementClearThinking + */ +@JsonPropertyOrder({ + MessagesContextManagementClearThinking.JSON_PROPERTY_TYPE, + MessagesContextManagementClearThinking.JSON_PROPERTY_KEEP +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContextManagementClearThinking implements MessagesContextManagementEdit { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesContextManagementEditType type = MessagesContextManagementEditType.CLEAR_THINKING; + + public static final String JSON_PROPERTY_KEEP = "keep"; + @javax.annotation.Nullable + private MessagesContextManagementKeep keep; + + public MessagesContextManagementClearThinking() { + } + + public MessagesContextManagementClearThinking type(@javax.annotation.Nonnull MessagesContextManagementEditType 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 MessagesContextManagementEditType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesContextManagementEditType type) { + this.type = type; + } + + public MessagesContextManagementClearThinking keep(@javax.annotation.Nullable MessagesContextManagementKeep keep) { + + this.keep = keep; + return this; + } + + /** + * Get keep + * @return keep + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KEEP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesContextManagementKeep getKeep() { + return keep; + } + + + @JsonProperty(value = JSON_PROPERTY_KEEP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeep(@javax.annotation.Nullable MessagesContextManagementKeep keep) { + this.keep = keep; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContextManagementClearThinking messagesContextManagementClearThinking = (MessagesContextManagementClearThinking) o; + return Objects.equals(this.type, messagesContextManagementClearThinking.type) && + Objects.equals(this.keep, messagesContextManagementClearThinking.keep); + } + + @Override + public int hashCode() { + return Objects.hash(type, keep); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContextManagementClearThinking {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" keep: ").append(toIndentedString(keep)).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 MessagesContextManagementClearThinking instance; + + public Builder() { + this(new MessagesContextManagementClearThinking()); + } + + protected Builder(MessagesContextManagementClearThinking instance) { + this.instance = instance; + } + + public MessagesContextManagementClearThinking.Builder type(MessagesContextManagementEditType type) { + this.instance.type = type; + return this; + } + public MessagesContextManagementClearThinking.Builder keep(MessagesContextManagementKeep keep) { + this.instance.keep = keep; + return this; + } + + + /** + * returns a built MessagesContextManagementClearThinking instance. + * + * The builder is not reusable. + */ + public MessagesContextManagementClearThinking 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 MessagesContextManagementClearThinking.Builder builder() { + return new MessagesContextManagementClearThinking.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContextManagementClearThinking.Builder toBuilder() { + return new MessagesContextManagementClearThinking.Builder() + .type(getType()) + .keep(getKeep()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementClearToolUses.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementClearToolUses.java new file mode 100644 index 0000000..f89160a --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementClearToolUses.java @@ -0,0 +1,311 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesContextManagementClearToolUses + */ +@JsonPropertyOrder({ + MessagesContextManagementClearToolUses.JSON_PROPERTY_TYPE, + MessagesContextManagementClearToolUses.JSON_PROPERTY_KEEP, + MessagesContextManagementClearToolUses.JSON_PROPERTY_EXCLUDE_TOOLS, + MessagesContextManagementClearToolUses.JSON_PROPERTY_CLEAR_TOOL_INPUTS, + MessagesContextManagementClearToolUses.JSON_PROPERTY_TRIGGER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContextManagementClearToolUses implements MessagesContextManagementEdit { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesContextManagementEditType type = MessagesContextManagementEditType.CLEAR_TOOL_USES; + + public static final String JSON_PROPERTY_KEEP = "keep"; + @javax.annotation.Nullable + private MessagesContextManagementKeep keep; + + public static final String JSON_PROPERTY_EXCLUDE_TOOLS = "exclude_tools"; + @javax.annotation.Nullable + private List excludeTools; + + public static final String JSON_PROPERTY_CLEAR_TOOL_INPUTS = "clear_tool_inputs"; + @javax.annotation.Nullable + private Boolean clearToolInputs; + + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + @javax.annotation.Nullable + private MessagesContextManagementClearToolUsesTrigger trigger; + + public MessagesContextManagementClearToolUses() { + } + + public MessagesContextManagementClearToolUses type(@javax.annotation.Nonnull MessagesContextManagementEditType 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 MessagesContextManagementEditType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesContextManagementEditType type) { + this.type = type; + } + + public MessagesContextManagementClearToolUses keep(@javax.annotation.Nullable MessagesContextManagementKeep keep) { + + this.keep = keep; + return this; + } + + /** + * Get keep + * @return keep + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_KEEP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesContextManagementKeep getKeep() { + return keep; + } + + + @JsonProperty(value = JSON_PROPERTY_KEEP, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKeep(@javax.annotation.Nullable MessagesContextManagementKeep keep) { + this.keep = keep; + } + + public MessagesContextManagementClearToolUses excludeTools(@javax.annotation.Nullable List excludeTools) { + + this.excludeTools = excludeTools; + return this; + } + + public MessagesContextManagementClearToolUses addExcludeToolsItem(String excludeToolsItem) { + if (this.excludeTools == null) { + this.excludeTools = new ArrayList<>(); + } + this.excludeTools.add(excludeToolsItem); + return this; + } + + /** + * Get excludeTools + * @return excludeTools + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EXCLUDE_TOOLS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + + public List getExcludeTools() { + return excludeTools; + } + + + @JsonProperty(value = JSON_PROPERTY_EXCLUDE_TOOLS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + public void setExcludeTools(@javax.annotation.Nullable List excludeTools) { + this.excludeTools = excludeTools; + } + + public MessagesContextManagementClearToolUses clearToolInputs(@javax.annotation.Nullable Boolean clearToolInputs) { + + this.clearToolInputs = clearToolInputs; + return this; + } + + /** + * Get clearToolInputs + * @return clearToolInputs + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CLEAR_TOOL_INPUTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getClearToolInputs() { + return clearToolInputs; + } + + + @JsonProperty(value = JSON_PROPERTY_CLEAR_TOOL_INPUTS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClearToolInputs(@javax.annotation.Nullable Boolean clearToolInputs) { + this.clearToolInputs = clearToolInputs; + } + + public MessagesContextManagementClearToolUses trigger(@javax.annotation.Nullable MessagesContextManagementClearToolUsesTrigger trigger) { + + this.trigger = trigger; + return this; + } + + /** + * Get trigger + * @return trigger + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TRIGGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesContextManagementClearToolUsesTrigger getTrigger() { + return trigger; + } + + + @JsonProperty(value = JSON_PROPERTY_TRIGGER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTrigger(@javax.annotation.Nullable MessagesContextManagementClearToolUsesTrigger trigger) { + this.trigger = trigger; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContextManagementClearToolUses messagesContextManagementClearToolUses = (MessagesContextManagementClearToolUses) o; + return Objects.equals(this.type, messagesContextManagementClearToolUses.type) && + Objects.equals(this.keep, messagesContextManagementClearToolUses.keep) && + Objects.equals(this.excludeTools, messagesContextManagementClearToolUses.excludeTools) && + Objects.equals(this.clearToolInputs, messagesContextManagementClearToolUses.clearToolInputs) && + Objects.equals(this.trigger, messagesContextManagementClearToolUses.trigger); + } + + @Override + public int hashCode() { + return Objects.hash(type, keep, excludeTools, clearToolInputs, trigger); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContextManagementClearToolUses {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" keep: ").append(toIndentedString(keep)).append("\n"); + sb.append(" excludeTools: ").append(toIndentedString(excludeTools)).append("\n"); + sb.append(" clearToolInputs: ").append(toIndentedString(clearToolInputs)).append("\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).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 MessagesContextManagementClearToolUses instance; + + public Builder() { + this(new MessagesContextManagementClearToolUses()); + } + + protected Builder(MessagesContextManagementClearToolUses instance) { + this.instance = instance; + } + + public MessagesContextManagementClearToolUses.Builder type(MessagesContextManagementEditType type) { + this.instance.type = type; + return this; + } + public MessagesContextManagementClearToolUses.Builder keep(MessagesContextManagementKeep keep) { + this.instance.keep = keep; + return this; + } + public MessagesContextManagementClearToolUses.Builder excludeTools(List excludeTools) { + this.instance.excludeTools = excludeTools; + return this; + } + public MessagesContextManagementClearToolUses.Builder clearToolInputs(Boolean clearToolInputs) { + this.instance.clearToolInputs = clearToolInputs; + return this; + } + public MessagesContextManagementClearToolUses.Builder trigger(MessagesContextManagementClearToolUsesTrigger trigger) { + this.instance.trigger = trigger; + return this; + } + + + /** + * returns a built MessagesContextManagementClearToolUses instance. + * + * The builder is not reusable. + */ + public MessagesContextManagementClearToolUses 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 MessagesContextManagementClearToolUses.Builder builder() { + return new MessagesContextManagementClearToolUses.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContextManagementClearToolUses.Builder toBuilder() { + return new MessagesContextManagementClearToolUses.Builder() + .type(getType()) + .keep(getKeep()) + .excludeTools(getExcludeTools()) + .clearToolInputs(getClearToolInputs()) + .trigger(getTrigger()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementClearToolUsesTrigger.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementClearToolUsesTrigger.java new file mode 100644 index 0000000..16cbb18 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementClearToolUsesTrigger.java @@ -0,0 +1,225 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesContextManagementClearToolUsesTrigger + */ +@JsonPropertyOrder({ + MessagesContextManagementClearToolUsesTrigger.JSON_PROPERTY_TYPE, + MessagesContextManagementClearToolUsesTrigger.JSON_PROPERTY_VALUE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContextManagementClearToolUsesTrigger { + /** + * Gets or Sets type + */ + public enum TypeEnum { + TOOL_USES(String.valueOf("tool_uses")); + + 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_VALUE = "value"; + @javax.annotation.Nonnull + private Integer value; + + public MessagesContextManagementClearToolUsesTrigger() { + } + + public MessagesContextManagementClearToolUsesTrigger 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 MessagesContextManagementClearToolUsesTrigger value(@javax.annotation.Nonnull Integer value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getValue() { + return value; + } + + + @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(@javax.annotation.Nonnull Integer value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContextManagementClearToolUsesTrigger messagesContextManagementClearToolUsesTrigger = (MessagesContextManagementClearToolUsesTrigger) o; + return Objects.equals(this.type, messagesContextManagementClearToolUsesTrigger.type) && + Objects.equals(this.value, messagesContextManagementClearToolUsesTrigger.value); + } + + @Override + public int hashCode() { + return Objects.hash(type, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContextManagementClearToolUsesTrigger {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 MessagesContextManagementClearToolUsesTrigger instance; + + public Builder() { + this(new MessagesContextManagementClearToolUsesTrigger()); + } + + protected Builder(MessagesContextManagementClearToolUsesTrigger instance) { + this.instance = instance; + } + + public MessagesContextManagementClearToolUsesTrigger.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public MessagesContextManagementClearToolUsesTrigger.Builder value(Integer value) { + this.instance.value = value; + return this; + } + + + /** + * returns a built MessagesContextManagementClearToolUsesTrigger instance. + * + * The builder is not reusable. + */ + public MessagesContextManagementClearToolUsesTrigger 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 MessagesContextManagementClearToolUsesTrigger.Builder builder() { + return new MessagesContextManagementClearToolUsesTrigger.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContextManagementClearToolUsesTrigger.Builder toBuilder() { + return new MessagesContextManagementClearToolUsesTrigger.Builder() + .type(getType()) + .value(getValue()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementEdit.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementEdit.java new file mode 100644 index 0000000..1162206 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementEdit.java @@ -0,0 +1,31 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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 = MessagesContextManagementClearThinking.class, name = "clear_thinking"), + @JsonSubTypes.Type(value = MessagesContextManagementClearToolUses.class, name = "clear_tool_uses"), +}) + +public interface MessagesContextManagementEdit { + public MessagesContextManagementEditType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementEditType.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementEditType.java new file mode 100644 index 0000000..5459c97 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementEditType.java @@ -0,0 +1,57 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MessagesContextManagementEditType + */ +public enum MessagesContextManagementEditType { + + CLEAR_THINKING("clear_thinking"), + + CLEAR_TOOL_USES("clear_tool_uses"); + + private String value; + + MessagesContextManagementEditType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesContextManagementEditType fromValue(String value) { + for (MessagesContextManagementEditType b : MessagesContextManagementEditType.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/messages/MessagesContextManagementKeep.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeep.java new file mode 100644 index 0000000..99f890f --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeep.java @@ -0,0 +1,229 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * What context to retain while applying a context-management edit. + */ +@JsonPropertyOrder({ + MessagesContextManagementKeep.JSON_PROPERTY_TYPE, + MessagesContextManagementKeep.JSON_PROPERTY_VALUE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContextManagementKeep { + /** + * Gets or Sets type + */ + public enum TypeEnum { + ALL(String.valueOf("all")), + + THINKING_TURNS(String.valueOf("thinking_turns")), + + TOOL_USES(String.valueOf("tool_uses")); + + 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_VALUE = "value"; + @javax.annotation.Nonnull + private Integer value; + + public MessagesContextManagementKeep() { + } + + public MessagesContextManagementKeep 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 MessagesContextManagementKeep value(@javax.annotation.Nonnull Integer value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getValue() { + return value; + } + + + @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(@javax.annotation.Nonnull Integer value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContextManagementKeep messagesContextManagementKeep = (MessagesContextManagementKeep) o; + return Objects.equals(this.type, messagesContextManagementKeep.type) && + Objects.equals(this.value, messagesContextManagementKeep.value); + } + + @Override + public int hashCode() { + return Objects.hash(type, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContextManagementKeep {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 MessagesContextManagementKeep instance; + + public Builder() { + this(new MessagesContextManagementKeep()); + } + + protected Builder(MessagesContextManagementKeep instance) { + this.instance = instance; + } + + public MessagesContextManagementKeep.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public MessagesContextManagementKeep.Builder value(Integer value) { + this.instance.value = value; + return this; + } + + + /** + * returns a built MessagesContextManagementKeep instance. + * + * The builder is not reusable. + */ + public MessagesContextManagementKeep 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 MessagesContextManagementKeep.Builder builder() { + return new MessagesContextManagementKeep.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContextManagementKeep.Builder toBuilder() { + return new MessagesContextManagementKeep.Builder() + .type(getType()) + .value(getValue()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeepAll.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeepAll.java new file mode 100644 index 0000000..75c3ebc --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeepAll.java @@ -0,0 +1,188 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesContextManagementKeepAll + */ +@JsonPropertyOrder({ + MessagesContextManagementKeepAll.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContextManagementKeepAll { + /** + * Gets or Sets type + */ + public enum TypeEnum { + ALL(String.valueOf("all")); + + 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 MessagesContextManagementKeepAll() { + } + + public MessagesContextManagementKeepAll 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; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContextManagementKeepAll messagesContextManagementKeepAll = (MessagesContextManagementKeepAll) o; + return Objects.equals(this.type, messagesContextManagementKeepAll.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContextManagementKeepAll {\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 MessagesContextManagementKeepAll instance; + + public Builder() { + this(new MessagesContextManagementKeepAll()); + } + + protected Builder(MessagesContextManagementKeepAll instance) { + this.instance = instance; + } + + public MessagesContextManagementKeepAll.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + + + /** + * returns a built MessagesContextManagementKeepAll instance. + * + * The builder is not reusable. + */ + public MessagesContextManagementKeepAll 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 MessagesContextManagementKeepAll.Builder builder() { + return new MessagesContextManagementKeepAll.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContextManagementKeepAll.Builder toBuilder() { + return new MessagesContextManagementKeepAll.Builder() + .type(getType()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeepThinkingTurns.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeepThinkingTurns.java new file mode 100644 index 0000000..ce56ad5 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeepThinkingTurns.java @@ -0,0 +1,225 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesContextManagementKeepThinkingTurns + */ +@JsonPropertyOrder({ + MessagesContextManagementKeepThinkingTurns.JSON_PROPERTY_TYPE, + MessagesContextManagementKeepThinkingTurns.JSON_PROPERTY_VALUE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContextManagementKeepThinkingTurns { + /** + * Gets or Sets type + */ + public enum TypeEnum { + THINKING_TURNS(String.valueOf("thinking_turns")); + + 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_VALUE = "value"; + @javax.annotation.Nonnull + private Integer value; + + public MessagesContextManagementKeepThinkingTurns() { + } + + public MessagesContextManagementKeepThinkingTurns 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 MessagesContextManagementKeepThinkingTurns value(@javax.annotation.Nonnull Integer value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getValue() { + return value; + } + + + @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(@javax.annotation.Nonnull Integer value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContextManagementKeepThinkingTurns messagesContextManagementKeepThinkingTurns = (MessagesContextManagementKeepThinkingTurns) o; + return Objects.equals(this.type, messagesContextManagementKeepThinkingTurns.type) && + Objects.equals(this.value, messagesContextManagementKeepThinkingTurns.value); + } + + @Override + public int hashCode() { + return Objects.hash(type, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContextManagementKeepThinkingTurns {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 MessagesContextManagementKeepThinkingTurns instance; + + public Builder() { + this(new MessagesContextManagementKeepThinkingTurns()); + } + + protected Builder(MessagesContextManagementKeepThinkingTurns instance) { + this.instance = instance; + } + + public MessagesContextManagementKeepThinkingTurns.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public MessagesContextManagementKeepThinkingTurns.Builder value(Integer value) { + this.instance.value = value; + return this; + } + + + /** + * returns a built MessagesContextManagementKeepThinkingTurns instance. + * + * The builder is not reusable. + */ + public MessagesContextManagementKeepThinkingTurns 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 MessagesContextManagementKeepThinkingTurns.Builder builder() { + return new MessagesContextManagementKeepThinkingTurns.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContextManagementKeepThinkingTurns.Builder toBuilder() { + return new MessagesContextManagementKeepThinkingTurns.Builder() + .type(getType()) + .value(getValue()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeepToolUses.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeepToolUses.java new file mode 100644 index 0000000..de9abdf --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesContextManagementKeepToolUses.java @@ -0,0 +1,225 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesContextManagementKeepToolUses + */ +@JsonPropertyOrder({ + MessagesContextManagementKeepToolUses.JSON_PROPERTY_TYPE, + MessagesContextManagementKeepToolUses.JSON_PROPERTY_VALUE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesContextManagementKeepToolUses { + /** + * Gets or Sets type + */ + public enum TypeEnum { + TOOL_USES(String.valueOf("tool_uses")); + + 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_VALUE = "value"; + @javax.annotation.Nonnull + private Integer value; + + public MessagesContextManagementKeepToolUses() { + } + + public MessagesContextManagementKeepToolUses 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 MessagesContextManagementKeepToolUses value(@javax.annotation.Nonnull Integer value) { + + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getValue() { + return value; + } + + + @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(@javax.annotation.Nonnull Integer value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesContextManagementKeepToolUses messagesContextManagementKeepToolUses = (MessagesContextManagementKeepToolUses) o; + return Objects.equals(this.type, messagesContextManagementKeepToolUses.type) && + Objects.equals(this.value, messagesContextManagementKeepToolUses.value); + } + + @Override + public int hashCode() { + return Objects.hash(type, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesContextManagementKeepToolUses {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 MessagesContextManagementKeepToolUses instance; + + public Builder() { + this(new MessagesContextManagementKeepToolUses()); + } + + protected Builder(MessagesContextManagementKeepToolUses instance) { + this.instance = instance; + } + + public MessagesContextManagementKeepToolUses.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public MessagesContextManagementKeepToolUses.Builder value(Integer value) { + this.instance.value = value; + return this; + } + + + /** + * returns a built MessagesContextManagementKeepToolUses instance. + * + * The builder is not reusable. + */ + public MessagesContextManagementKeepToolUses 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 MessagesContextManagementKeepToolUses.Builder builder() { + return new MessagesContextManagementKeepToolUses.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesContextManagementKeepToolUses.Builder toBuilder() { + return new MessagesContextManagementKeepToolUses.Builder() + .type(getType()) + .value(getValue()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesDocumentSourceType.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesDocumentSourceType.java new file mode 100644 index 0000000..5a52b70 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesDocumentSourceType.java @@ -0,0 +1,61 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MessagesDocumentSourceType + */ +public enum MessagesDocumentSourceType { + + BASE64("base64"), + + TEXT("text"), + + URL("url"), + + CONTENT("content"); + + private String value; + + MessagesDocumentSourceType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesDocumentSourceType fromValue(String value) { + for (MessagesDocumentSourceType b : MessagesDocumentSourceType.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/messages/MessagesErrorResponse.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesErrorResponse.java new file mode 100644 index 0000000..d40b89f --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesErrorResponse.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesErrorResponse + */ +@JsonPropertyOrder({ + MessagesErrorResponse.JSON_PROPERTY_TYPE, + MessagesErrorResponse.JSON_PROPERTY_ERROR +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesErrorResponse implements MessagesStreamEvent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesStreamEventType type = MessagesStreamEventType.ERROR; + + public static final String JSON_PROPERTY_ERROR = "error"; + @javax.annotation.Nonnull + private Error error; + + public MessagesErrorResponse() { + } + + public MessagesErrorResponse type(@javax.annotation.Nonnull MessagesStreamEventType 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 MessagesStreamEventType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesStreamEventType type) { + this.type = type; + } + + public MessagesErrorResponse error(@javax.annotation.Nonnull Error error) { + + this.error = error; + return this; + } + + /** + * Get error + * @return error + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ERROR, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Error getError() { + return error; + } + + + @JsonProperty(value = JSON_PROPERTY_ERROR, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setError(@javax.annotation.Nonnull Error error) { + this.error = error; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesErrorResponse messagesErrorResponse = (MessagesErrorResponse) o; + return Objects.equals(this.type, messagesErrorResponse.type) && + Objects.equals(this.error, messagesErrorResponse.error); + } + + @Override + public int hashCode() { + return Objects.hash(type, error); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesErrorResponse {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\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 MessagesErrorResponse instance; + + public Builder() { + this(new MessagesErrorResponse()); + } + + protected Builder(MessagesErrorResponse instance) { + this.instance = instance; + } + + public MessagesErrorResponse.Builder type(MessagesStreamEventType type) { + this.instance.type = type; + return this; + } + public MessagesErrorResponse.Builder error(Error error) { + this.instance.error = error; + return this; + } + + + /** + * returns a built MessagesErrorResponse instance. + * + * The builder is not reusable. + */ + public MessagesErrorResponse 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 MessagesErrorResponse.Builder builder() { + return new MessagesErrorResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesErrorResponse.Builder toBuilder() { + return new MessagesErrorResponse.Builder() + .type(getType()) + .error(getError()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesImageSourceType.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesImageSourceType.java new file mode 100644 index 0000000..5256577 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesImageSourceType.java @@ -0,0 +1,57 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MessagesImageSourceType + */ +public enum MessagesImageSourceType { + + URL("url"), + + BASE64("base64"); + + private String value; + + MessagesImageSourceType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesImageSourceType fromValue(String value) { + for (MessagesImageSourceType b : MessagesImageSourceType.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/messages/MessagesIterationUsage.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesIterationUsage.java new file mode 100644 index 0000000..1751e6b --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesIterationUsage.java @@ -0,0 +1,264 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesIterationUsage + */ +@JsonPropertyOrder({ + MessagesIterationUsage.JSON_PROPERTY_TYPE, + MessagesIterationUsage.JSON_PROPERTY_INPUT_TOKENS, + MessagesIterationUsage.JSON_PROPERTY_OUTPUT_TOKENS, + MessagesIterationUsage.JSON_PROPERTY_CACHE_READ_INPUT_TOKENS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesIterationUsage { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type; + + public static final String JSON_PROPERTY_INPUT_TOKENS = "input_tokens"; + @javax.annotation.Nonnull + private Integer inputTokens; + + public static final String JSON_PROPERTY_OUTPUT_TOKENS = "output_tokens"; + @javax.annotation.Nonnull + private Integer outputTokens; + + public static final String JSON_PROPERTY_CACHE_READ_INPUT_TOKENS = "cache_read_input_tokens"; + @javax.annotation.Nonnull + private Integer cacheReadInputTokens; + + public MessagesIterationUsage() { + } + + public MessagesIterationUsage type(@javax.annotation.Nonnull String type) { + + this.type = type; + return this; + } + + /** + * The iteration usage record type. + * @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; + } + + public MessagesIterationUsage inputTokens(@javax.annotation.Nonnull Integer inputTokens) { + + this.inputTokens = inputTokens; + return this; + } + + /** + * Number of input tokens consumed by this model iteration. + * @return inputTokens + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getInputTokens() { + return inputTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_INPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setInputTokens(@javax.annotation.Nonnull Integer inputTokens) { + this.inputTokens = inputTokens; + } + + public MessagesIterationUsage outputTokens(@javax.annotation.Nonnull Integer outputTokens) { + + this.outputTokens = outputTokens; + return this; + } + + /** + * Number of output tokens generated by this model iteration. + * @return outputTokens + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_OUTPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getOutputTokens() { + return outputTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_OUTPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOutputTokens(@javax.annotation.Nonnull Integer outputTokens) { + this.outputTokens = outputTokens; + } + + public MessagesIterationUsage cacheReadInputTokens(@javax.annotation.Nonnull Integer cacheReadInputTokens) { + + this.cacheReadInputTokens = cacheReadInputTokens; + return this; + } + + /** + * Number of cached input tokens read by this model iteration. + * @return cacheReadInputTokens + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CACHE_READ_INPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getCacheReadInputTokens() { + return cacheReadInputTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_CACHE_READ_INPUT_TOKENS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCacheReadInputTokens(@javax.annotation.Nonnull Integer cacheReadInputTokens) { + this.cacheReadInputTokens = cacheReadInputTokens; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesIterationUsage messagesIterationUsage = (MessagesIterationUsage) o; + return Objects.equals(this.type, messagesIterationUsage.type) && + Objects.equals(this.inputTokens, messagesIterationUsage.inputTokens) && + Objects.equals(this.outputTokens, messagesIterationUsage.outputTokens) && + Objects.equals(this.cacheReadInputTokens, messagesIterationUsage.cacheReadInputTokens); + } + + @Override + public int hashCode() { + return Objects.hash(type, inputTokens, outputTokens, cacheReadInputTokens); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesIterationUsage {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" inputTokens: ").append(toIndentedString(inputTokens)).append("\n"); + sb.append(" outputTokens: ").append(toIndentedString(outputTokens)).append("\n"); + sb.append(" cacheReadInputTokens: ").append(toIndentedString(cacheReadInputTokens)).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 MessagesIterationUsage instance; + + public Builder() { + this(new MessagesIterationUsage()); + } + + protected Builder(MessagesIterationUsage instance) { + this.instance = instance; + } + + public MessagesIterationUsage.Builder type(String type) { + this.instance.type = type; + return this; + } + public MessagesIterationUsage.Builder inputTokens(Integer inputTokens) { + this.instance.inputTokens = inputTokens; + return this; + } + public MessagesIterationUsage.Builder outputTokens(Integer outputTokens) { + this.instance.outputTokens = outputTokens; + return this; + } + public MessagesIterationUsage.Builder cacheReadInputTokens(Integer cacheReadInputTokens) { + this.instance.cacheReadInputTokens = cacheReadInputTokens; + return this; + } + + + /** + * returns a built MessagesIterationUsage instance. + * + * The builder is not reusable. + */ + public MessagesIterationUsage 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 MessagesIterationUsage.Builder builder() { + return new MessagesIterationUsage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesIterationUsage.Builder toBuilder() { + return new MessagesIterationUsage.Builder() + .type(getType()) + .inputTokens(getInputTokens()) + .outputTokens(getOutputTokens()) + .cacheReadInputTokens(getCacheReadInputTokens()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesMessageContent.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesMessageContent.java new file mode 100644 index 0000000..5802f52 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesMessageContent.java @@ -0,0 +1,120 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesMessageContent + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: String, 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 = MessagesMessageContent.Deserializer.class) +public class MessagesMessageContent { + + private final Object value; + + @JsonCreator + public MessagesMessageContent(Object value) { + this.value = value; + } + + public MessagesMessageContent() { + this.value = null; + } + + public static MessagesMessageContent ofString(String value) { + return new MessagesMessageContent(value); + } + + public static MessagesMessageContent ofList(java.util.List value) { + return new MessagesMessageContent(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public MessagesMessageContent deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isTextual()) { + return new MessagesMessageContent(mapper.treeToValue(node, String.class)); + } + if (node.isArray()) { + return new MessagesMessageContent( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + MessagesMessageContent.class, + "no MessagesMessageContent variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MessagesMessageContent other = (MessagesMessageContent) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class MessagesMessageContent {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public MessagesMessageContent build() { return new MessagesMessageContent(this.value); } + } + + public static MessagesMessageContent.Builder builder() { return new MessagesMessageContent.Builder(); } + + public MessagesMessageContent.Builder toBuilder() { + return new MessagesMessageContent.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesMetadata.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesMetadata.java new file mode 100644 index 0000000..a8cc110 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesMetadata.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesMetadata + */ +@JsonPropertyOrder({ + MessagesMetadata.JSON_PROPERTY_USER_ID +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesMetadata { + public static final String JSON_PROPERTY_USER_ID = "user_id"; + @javax.annotation.Nullable + private String userId; + + public MessagesMetadata() { + } + + public MessagesMetadata userId(@javax.annotation.Nullable String userId) { + + this.userId = userId; + return this; + } + + /** + * An external identifier for the user associated with the request. + * @return userId + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getUserId() { + return userId; + } + + + @JsonProperty(value = JSON_PROPERTY_USER_ID, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserId(@javax.annotation.Nullable String userId) { + this.userId = userId; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesMetadata messagesMetadata = (MessagesMetadata) o; + return Objects.equals(this.userId, messagesMetadata.userId); + } + + @Override + public int hashCode() { + return Objects.hash(userId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesMetadata {\n"); + sb.append(" userId: ").append(toIndentedString(userId)).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 MessagesMetadata instance; + + public Builder() { + this(new MessagesMetadata()); + } + + protected Builder(MessagesMetadata instance) { + this.instance = instance; + } + + public MessagesMetadata.Builder userId(String userId) { + this.instance.userId = userId; + return this; + } + + + /** + * returns a built MessagesMetadata instance. + * + * The builder is not reusable. + */ + public MessagesMetadata 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 MessagesMetadata.Builder builder() { + return new MessagesMetadata.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesMetadata.Builder toBuilder() { + return new MessagesMetadata.Builder() + .userId(getUserId()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesOutputConfig.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesOutputConfig.java new file mode 100644 index 0000000..97c51a7 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesOutputConfig.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesOutputConfig + */ +@JsonPropertyOrder({ + MessagesOutputConfig.JSON_PROPERTY_EFFORT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesOutputConfig { + public static final String JSON_PROPERTY_EFFORT = "effort"; + @javax.annotation.Nullable + private String effort; + + public MessagesOutputConfig() { + } + + public MessagesOutputConfig effort(@javax.annotation.Nullable String effort) { + + this.effort = effort; + return this; + } + + /** + * Requested reasoning effort. + * @return effort + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_EFFORT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getEffort() { + return effort; + } + + + @JsonProperty(value = JSON_PROPERTY_EFFORT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEffort(@javax.annotation.Nullable String effort) { + this.effort = effort; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesOutputConfig messagesOutputConfig = (MessagesOutputConfig) o; + return Objects.equals(this.effort, messagesOutputConfig.effort); + } + + @Override + public int hashCode() { + return Objects.hash(effort); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesOutputConfig {\n"); + sb.append(" effort: ").append(toIndentedString(effort)).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 MessagesOutputConfig instance; + + public Builder() { + this(new MessagesOutputConfig()); + } + + protected Builder(MessagesOutputConfig instance) { + this.instance = instance; + } + + public MessagesOutputConfig.Builder effort(String effort) { + this.instance.effort = effort; + return this; + } + + + /** + * returns a built MessagesOutputConfig instance. + * + * The builder is not reusable. + */ + public MessagesOutputConfig 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 MessagesOutputConfig.Builder builder() { + return new MessagesOutputConfig.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesOutputConfig.Builder toBuilder() { + return new MessagesOutputConfig.Builder() + .effort(getEffort()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesOutputFormat.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesOutputFormat.java new file mode 100644 index 0000000..762fde5 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesOutputFormat.java @@ -0,0 +1,200 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesOutputFormat + */ +@JsonPropertyOrder({ + MessagesOutputFormat.JSON_PROPERTY_TYPE, + MessagesOutputFormat.JSON_PROPERTY_SCHEMA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesOutputFormat { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesOutputFormatType type; + + public static final String JSON_PROPERTY_SCHEMA = "schema"; + @javax.annotation.Nullable + private Map schema; + + public MessagesOutputFormat() { + } + + public MessagesOutputFormat type(@javax.annotation.Nonnull MessagesOutputFormatType type) { + + this.type = type; + return this; + } + + /** + * The requested output format. + * @return type + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesOutputFormatType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesOutputFormatType type) { + this.type = type; + } + + public MessagesOutputFormat schema(@javax.annotation.Nullable Map schema) { + + this.schema = schema; + return this; + } + + public MessagesOutputFormat putSchemaItem(String key, Object schemaItem) { + if (this.schema == null) { + this.schema = new HashMap<>(); + } + this.schema.put(key, schemaItem); + return this; + } + + /** + * JSON Schema used when `type` is `json_schema`. + * @return schema + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.NON_EMPTY) + + public Map getSchema() { + return schema; + } + + + @JsonProperty(value = JSON_PROPERTY_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.NON_EMPTY) + public void setSchema(@javax.annotation.Nullable Map schema) { + this.schema = schema; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesOutputFormat messagesOutputFormat = (MessagesOutputFormat) o; + return Objects.equals(this.type, messagesOutputFormat.type) && + Objects.equals(this.schema, messagesOutputFormat.schema); + } + + @Override + public int hashCode() { + return Objects.hash(type, schema); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesOutputFormat {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" schema: ").append(toIndentedString(schema)).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 MessagesOutputFormat instance; + + public Builder() { + this(new MessagesOutputFormat()); + } + + protected Builder(MessagesOutputFormat instance) { + this.instance = instance; + } + + public MessagesOutputFormat.Builder type(MessagesOutputFormatType type) { + this.instance.type = type; + return this; + } + public MessagesOutputFormat.Builder schema(Map schema) { + this.instance.schema = schema; + return this; + } + + + /** + * returns a built MessagesOutputFormat instance. + * + * The builder is not reusable. + */ + public MessagesOutputFormat 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 MessagesOutputFormat.Builder builder() { + return new MessagesOutputFormat.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesOutputFormat.Builder toBuilder() { + return new MessagesOutputFormat.Builder() + .type(getType()) + .schema(getSchema()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesOutputFormatType.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesOutputFormatType.java new file mode 100644 index 0000000..986f282 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesOutputFormatType.java @@ -0,0 +1,59 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MessagesOutputFormatType + */ +public enum MessagesOutputFormatType { + + TEXT("text"), + + JSON_OBJECT("json_object"), + + JSON_SCHEMA("json_schema"); + + private String value; + + MessagesOutputFormatType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesOutputFormatType fromValue(String value) { + for (MessagesOutputFormatType b : MessagesOutputFormatType.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/messages/MessagesRequest.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRequest.java new file mode 100644 index 0000000..22edb4e --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRequest.java @@ -0,0 +1,995 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Creates a model response for the supplied conversation. + */ +@JsonPropertyOrder({ + MessagesRequest.JSON_PROPERTY_MESSAGES, + MessagesRequest.JSON_PROPERTY_MODEL, + MessagesRequest.JSON_PROPERTY_SYSTEM, + MessagesRequest.JSON_PROPERTY_FREQUENCY_PENALTY, + MessagesRequest.JSON_PROPERTY_LOGIT_BIAS, + MessagesRequest.JSON_PROPERTY_LOGPROBS, + MessagesRequest.JSON_PROPERTY_MAX_TOKENS, + MessagesRequest.JSON_PROPERTY_PRESENCE_PENALTY, + MessagesRequest.JSON_PROPERTY_REPETITION_PENALTY, + MessagesRequest.JSON_PROPERTY_OUTPUT_FORMAT, + MessagesRequest.JSON_PROPERTY_STOP_SEQUENCES, + MessagesRequest.JSON_PROPERTY_STREAM, + MessagesRequest.JSON_PROPERTY_STREAM_OPTIONS, + MessagesRequest.JSON_PROPERTY_TEMPERATURE, + MessagesRequest.JSON_PROPERTY_TOOL_CHOICE, + MessagesRequest.JSON_PROPERTY_TOOLS, + MessagesRequest.JSON_PROPERTY_TOP_LOGPROBS, + MessagesRequest.JSON_PROPERTY_TOP_P, + MessagesRequest.JSON_PROPERTY_SERVICE_TIER, + MessagesRequest.JSON_PROPERTY_THINKING, + MessagesRequest.JSON_PROPERTY_OUTPUT_CONFIG, + MessagesRequest.JSON_PROPERTY_METADATA, + MessagesRequest.JSON_PROPERTY_CONTEXT_MANAGEMENT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesRequest { + public static final String JSON_PROPERTY_MESSAGES = "messages"; + @javax.annotation.Nonnull + private List messages; + + public static final String JSON_PROPERTY_MODEL = "model"; + @javax.annotation.Nonnull + private String model; + + public static final String JSON_PROPERTY_SYSTEM = "system"; + @javax.annotation.Nullable + private MessagesSystem system; + + public static final String JSON_PROPERTY_FREQUENCY_PENALTY = "frequency_penalty"; + @javax.annotation.Nullable + private Double frequencyPenalty; + + public static final String JSON_PROPERTY_LOGIT_BIAS = "logit_bias"; + @javax.annotation.Nullable + private Map logitBias; + + public static final String JSON_PROPERTY_LOGPROBS = "logprobs"; + @javax.annotation.Nullable + private Boolean logprobs; + + public static final String JSON_PROPERTY_MAX_TOKENS = "max_tokens"; + @javax.annotation.Nullable + private Integer maxTokens; + + public static final String JSON_PROPERTY_PRESENCE_PENALTY = "presence_penalty"; + @javax.annotation.Nullable + private Double presencePenalty; + + public static final String JSON_PROPERTY_REPETITION_PENALTY = "repetition_penalty"; + @javax.annotation.Nullable + private Double repetitionPenalty; + + public static final String JSON_PROPERTY_OUTPUT_FORMAT = "output_format"; + @javax.annotation.Nullable + private MessagesOutputFormat outputFormat; + + public static final String JSON_PROPERTY_STOP_SEQUENCES = "stop_sequences"; + @javax.annotation.Nullable + private MessagesStopSequences stopSequences; + + public static final String JSON_PROPERTY_STREAM = "stream"; + @javax.annotation.Nullable + private Boolean stream; + + public static final String JSON_PROPERTY_STREAM_OPTIONS = "stream_options"; + @javax.annotation.Nullable + private MessagesStreamOptions streamOptions; + + public static final String JSON_PROPERTY_TEMPERATURE = "temperature"; + @javax.annotation.Nullable + private Double temperature; + + public static final String JSON_PROPERTY_TOOL_CHOICE = "tool_choice"; + @javax.annotation.Nullable + private MessagesToolChoice toolChoice; + + public static final String JSON_PROPERTY_TOOLS = "tools"; + @javax.annotation.Nullable + private List tools; + + public static final String JSON_PROPERTY_TOP_LOGPROBS = "top_logprobs"; + @javax.annotation.Nullable + private Integer topLogprobs; + + public static final String JSON_PROPERTY_TOP_P = "top_p"; + @javax.annotation.Nullable + private Double topP; + + public static final String JSON_PROPERTY_SERVICE_TIER = "service_tier"; + @javax.annotation.Nullable + private MessagesRequestServiceTier serviceTier; + + public static final String JSON_PROPERTY_THINKING = "thinking"; + @javax.annotation.Nullable + private MessagesThinking thinking; + + public static final String JSON_PROPERTY_OUTPUT_CONFIG = "output_config"; + @javax.annotation.Nullable + private MessagesOutputConfig outputConfig; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + @javax.annotation.Nullable + private MessagesMetadata metadata; + + public static final String JSON_PROPERTY_CONTEXT_MANAGEMENT = "context_management"; + @javax.annotation.Nullable + private MessagesContextManagement contextManagement; + + public MessagesRequest() { + } + + public MessagesRequest messages(@javax.annotation.Nonnull List messages) { + + this.messages = messages; + return this; + } + + public MessagesRequest addMessagesItem(MessagesRequestMessage messagesItem) { + if (this.messages == null) { + this.messages = new ArrayList<>(); + } + this.messages.add(messagesItem); + return this; + } + + /** + * A list of messages comprising the conversation so far. + * @return messages + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_MESSAGES, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getMessages() { + return messages; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGES, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessages(@javax.annotation.Nonnull List messages) { + this.messages = messages; + } + + public MessagesRequest model(@javax.annotation.Nonnull String model) { + + this.model = model; + return this; + } + + /** + * Endpoint ID of the model to use. + * @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 MessagesRequest system(@javax.annotation.Nullable MessagesSystem system) { + + this.system = system; + return this; + } + + /** + * A system prompt supplied separately from the conversation messages. + * @return system + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SYSTEM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesSystem getSystem() { + return system; + } + + + @JsonProperty(value = JSON_PROPERTY_SYSTEM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSystem(@javax.annotation.Nullable MessagesSystem system) { + this.system = system; + } + + public MessagesRequest frequencyPenalty(@javax.annotation.Nullable Double frequencyPenalty) { + + this.frequencyPenalty = frequencyPenalty; + return this; + } + + /** + * Number between -2.0 and 2.0. Positive values penalize tokens based on their existing frequency in the generated text. + * @return frequencyPenalty + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_FREQUENCY_PENALTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getFrequencyPenalty() { + return frequencyPenalty; + } + + + @JsonProperty(value = JSON_PROPERTY_FREQUENCY_PENALTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFrequencyPenalty(@javax.annotation.Nullable Double frequencyPenalty) { + this.frequencyPenalty = frequencyPenalty; + } + + public MessagesRequest logitBias(@javax.annotation.Nullable Map logitBias) { + + this.logitBias = logitBias; + return this; + } + + public MessagesRequest putLogitBiasItem(String key, Float logitBiasItem) { + if (this.logitBias == null) { + this.logitBias = new HashMap<>(); + } + this.logitBias.put(key, logitBiasItem); + return this; + } + + /** + * Modify the likelihood of token IDs appearing in the response. Values range from -100 to 100. + * @return logitBias + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LOGIT_BIAS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + + public Map getLogitBias() { + return logitBias; + } + + + @JsonProperty(value = JSON_PROPERTY_LOGIT_BIAS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + public void setLogitBias(@javax.annotation.Nullable Map logitBias) { + this.logitBias = logitBias; + } + + public MessagesRequest logprobs(@javax.annotation.Nullable Boolean logprobs) { + + this.logprobs = logprobs; + return this; + } + + /** + * Whether to return log probabilities of output tokens. + * @return logprobs + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_LOGPROBS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getLogprobs() { + return logprobs; + } + + + @JsonProperty(value = JSON_PROPERTY_LOGPROBS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLogprobs(@javax.annotation.Nullable Boolean logprobs) { + this.logprobs = logprobs; + } + + public MessagesRequest maxTokens(@javax.annotation.Nullable Integer maxTokens) { + + this.maxTokens = maxTokens; + return this; + } + + /** + * Maximum number of tokens that may be generated. + * @return maxTokens + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAX_TOKENS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxTokens() { + return maxTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_MAX_TOKENS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxTokens(@javax.annotation.Nullable Integer maxTokens) { + this.maxTokens = maxTokens; + } + + public MessagesRequest presencePenalty(@javax.annotation.Nullable Double presencePenalty) { + + this.presencePenalty = presencePenalty; + return this; + } + + /** + * Number between -2.0 and 2.0. Positive values penalize tokens based on whether they have appeared in the generated text. + * @return presencePenalty + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PRESENCE_PENALTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getPresencePenalty() { + return presencePenalty; + } + + + @JsonProperty(value = JSON_PROPERTY_PRESENCE_PENALTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPresencePenalty(@javax.annotation.Nullable Double presencePenalty) { + this.presencePenalty = presencePenalty; + } + + public MessagesRequest repetitionPenalty(@javax.annotation.Nullable Double repetitionPenalty) { + + this.repetitionPenalty = repetitionPenalty; + return this; + } + + /** + * Number between 0.0 and 2.0 that penalizes repetition. + * @return repetitionPenalty + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REPETITION_PENALTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getRepetitionPenalty() { + return repetitionPenalty; + } + + + @JsonProperty(value = JSON_PROPERTY_REPETITION_PENALTY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRepetitionPenalty(@javax.annotation.Nullable Double repetitionPenalty) { + this.repetitionPenalty = repetitionPenalty; + } + + public MessagesRequest outputFormat(@javax.annotation.Nullable MessagesOutputFormat outputFormat) { + + this.outputFormat = outputFormat; + return this; + } + + /** + * The format the model must produce. + * @return outputFormat + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OUTPUT_FORMAT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesOutputFormat getOutputFormat() { + return outputFormat; + } + + + @JsonProperty(value = JSON_PROPERTY_OUTPUT_FORMAT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputFormat(@javax.annotation.Nullable MessagesOutputFormat outputFormat) { + this.outputFormat = outputFormat; + } + + public MessagesRequest stopSequences(@javax.annotation.Nullable MessagesStopSequences stopSequences) { + + this.stopSequences = stopSequences; + return this; + } + + /** + * Sequences that stop generation when produced. + * @return stopSequences + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STOP_SEQUENCES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesStopSequences getStopSequences() { + return stopSequences; + } + + + @JsonProperty(value = JSON_PROPERTY_STOP_SEQUENCES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStopSequences(@javax.annotation.Nullable MessagesStopSequences stopSequences) { + this.stopSequences = stopSequences; + } + + public MessagesRequest stream(@javax.annotation.Nullable Boolean stream) { + + this.stream = stream; + return this; + } + + /** + * Whether to stream the response as server-sent events. + * @return stream + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STREAM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getStream() { + return stream; + } + + + @JsonProperty(value = JSON_PROPERTY_STREAM, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStream(@javax.annotation.Nullable Boolean stream) { + this.stream = stream; + } + + public MessagesRequest streamOptions(@javax.annotation.Nullable MessagesStreamOptions streamOptions) { + + this.streamOptions = streamOptions; + return this; + } + + /** + * Options for streaming responses. + * @return streamOptions + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STREAM_OPTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesStreamOptions getStreamOptions() { + return streamOptions; + } + + + @JsonProperty(value = JSON_PROPERTY_STREAM_OPTIONS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStreamOptions(@javax.annotation.Nullable MessagesStreamOptions streamOptions) { + this.streamOptions = streamOptions; + } + + public MessagesRequest temperature(@javax.annotation.Nullable Double temperature) { + + this.temperature = temperature; + return this; + } + + /** + * Sampling temperature between 0 and 2. + * @return temperature + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TEMPERATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getTemperature() { + return temperature; + } + + + @JsonProperty(value = JSON_PROPERTY_TEMPERATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTemperature(@javax.annotation.Nullable Double temperature) { + this.temperature = temperature; + } + + public MessagesRequest toolChoice(@javax.annotation.Nullable MessagesToolChoice toolChoice) { + + this.toolChoice = toolChoice; + return this; + } + + /** + * Controls which tool, if any, the model calls. + * @return toolChoice + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOOL_CHOICE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesToolChoice getToolChoice() { + return toolChoice; + } + + + @JsonProperty(value = JSON_PROPERTY_TOOL_CHOICE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setToolChoice(@javax.annotation.Nullable MessagesToolChoice toolChoice) { + this.toolChoice = toolChoice; + } + + public MessagesRequest tools(@javax.annotation.Nullable List tools) { + + this.tools = tools; + return this; + } + + public MessagesRequest addToolsItem(MessagesTool toolsItem) { + if (this.tools == null) { + this.tools = new ArrayList<>(); + } + this.tools.add(toolsItem); + return this; + } + + /** + * Tools the model may call. + * @return tools + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOOLS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + + public List getTools() { + return tools; + } + + + @JsonProperty(value = JSON_PROPERTY_TOOLS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + public void setTools(@javax.annotation.Nullable List tools) { + this.tools = tools; + } + + public MessagesRequest topLogprobs(@javax.annotation.Nullable Integer topLogprobs) { + + this.topLogprobs = topLogprobs; + return this; + } + + /** + * Number of most-likely tokens returned at each position. Range 0-20. + * @return topLogprobs + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOP_LOGPROBS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getTopLogprobs() { + return topLogprobs; + } + + + @JsonProperty(value = JSON_PROPERTY_TOP_LOGPROBS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTopLogprobs(@javax.annotation.Nullable Integer topLogprobs) { + this.topLogprobs = topLogprobs; + } + + public MessagesRequest topP(@javax.annotation.Nullable Double topP) { + + this.topP = topP; + return this; + } + + /** + * Nucleus sampling probability between 0 and 1. + * @return topP + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TOP_P, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Double getTopP() { + return topP; + } + + + @JsonProperty(value = JSON_PROPERTY_TOP_P, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTopP(@javax.annotation.Nullable Double topP) { + this.topP = topP; + } + + public MessagesRequest serviceTier(@javax.annotation.Nullable MessagesRequestServiceTier serviceTier) { + + this.serviceTier = serviceTier; + return this; + } + + /** + * Latency tier used to process the request. + * @return serviceTier + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SERVICE_TIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesRequestServiceTier getServiceTier() { + return serviceTier; + } + + + @JsonProperty(value = JSON_PROPERTY_SERVICE_TIER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceTier(@javax.annotation.Nullable MessagesRequestServiceTier serviceTier) { + this.serviceTier = serviceTier; + } + + public MessagesRequest thinking(@javax.annotation.Nullable MessagesThinking thinking) { + + this.thinking = thinking; + return this; + } + + /** + * Thinking-mode configuration. + * @return thinking + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_THINKING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesThinking getThinking() { + return thinking; + } + + + @JsonProperty(value = JSON_PROPERTY_THINKING, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setThinking(@javax.annotation.Nullable MessagesThinking thinking) { + this.thinking = thinking; + } + + public MessagesRequest outputConfig(@javax.annotation.Nullable MessagesOutputConfig outputConfig) { + + this.outputConfig = outputConfig; + return this; + } + + /** + * Output configuration for reasoning models. + * @return outputConfig + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OUTPUT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesOutputConfig getOutputConfig() { + return outputConfig; + } + + + @JsonProperty(value = JSON_PROPERTY_OUTPUT_CONFIG, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputConfig(@javax.annotation.Nullable MessagesOutputConfig outputConfig) { + this.outputConfig = outputConfig; + } + + public MessagesRequest metadata(@javax.annotation.Nullable MessagesMetadata metadata) { + + this.metadata = metadata; + return this; + } + + /** + * Metadata associated with the request. + * @return metadata + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesMetadata getMetadata() { + return metadata; + } + + + @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMetadata(@javax.annotation.Nullable MessagesMetadata metadata) { + this.metadata = metadata; + } + + public MessagesRequest contextManagement(@javax.annotation.Nullable MessagesContextManagement contextManagement) { + + this.contextManagement = contextManagement; + return this; + } + + /** + * Context-editing rules applied before inference. + * @return contextManagement + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CONTEXT_MANAGEMENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesContextManagement getContextManagement() { + return contextManagement; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTEXT_MANAGEMENT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setContextManagement(@javax.annotation.Nullable MessagesContextManagement contextManagement) { + this.contextManagement = contextManagement; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesRequest messagesRequest = (MessagesRequest) o; + return Objects.equals(this.messages, messagesRequest.messages) && + Objects.equals(this.model, messagesRequest.model) && + Objects.equals(this.system, messagesRequest.system) && + Objects.equals(this.frequencyPenalty, messagesRequest.frequencyPenalty) && + Objects.equals(this.logitBias, messagesRequest.logitBias) && + Objects.equals(this.logprobs, messagesRequest.logprobs) && + Objects.equals(this.maxTokens, messagesRequest.maxTokens) && + Objects.equals(this.presencePenalty, messagesRequest.presencePenalty) && + Objects.equals(this.repetitionPenalty, messagesRequest.repetitionPenalty) && + Objects.equals(this.outputFormat, messagesRequest.outputFormat) && + Objects.equals(this.stopSequences, messagesRequest.stopSequences) && + Objects.equals(this.stream, messagesRequest.stream) && + Objects.equals(this.streamOptions, messagesRequest.streamOptions) && + Objects.equals(this.temperature, messagesRequest.temperature) && + Objects.equals(this.toolChoice, messagesRequest.toolChoice) && + Objects.equals(this.tools, messagesRequest.tools) && + Objects.equals(this.topLogprobs, messagesRequest.topLogprobs) && + Objects.equals(this.topP, messagesRequest.topP) && + Objects.equals(this.serviceTier, messagesRequest.serviceTier) && + Objects.equals(this.thinking, messagesRequest.thinking) && + Objects.equals(this.outputConfig, messagesRequest.outputConfig) && + Objects.equals(this.metadata, messagesRequest.metadata) && + Objects.equals(this.contextManagement, messagesRequest.contextManagement); + } + + @Override + public int hashCode() { + return Objects.hash(messages, model, system, frequencyPenalty, logitBias, logprobs, maxTokens, presencePenalty, repetitionPenalty, outputFormat, stopSequences, stream, streamOptions, temperature, toolChoice, tools, topLogprobs, topP, serviceTier, thinking, outputConfig, metadata, contextManagement); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesRequest {\n"); + sb.append(" messages: ").append(toIndentedString(messages)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" system: ").append(toIndentedString(system)).append("\n"); + sb.append(" frequencyPenalty: ").append(toIndentedString(frequencyPenalty)).append("\n"); + sb.append(" logitBias: ").append(toIndentedString(logitBias)).append("\n"); + sb.append(" logprobs: ").append(toIndentedString(logprobs)).append("\n"); + sb.append(" maxTokens: ").append(toIndentedString(maxTokens)).append("\n"); + sb.append(" presencePenalty: ").append(toIndentedString(presencePenalty)).append("\n"); + sb.append(" repetitionPenalty: ").append(toIndentedString(repetitionPenalty)).append("\n"); + sb.append(" outputFormat: ").append(toIndentedString(outputFormat)).append("\n"); + sb.append(" stopSequences: ").append(toIndentedString(stopSequences)).append("\n"); + sb.append(" stream: ").append(toIndentedString(stream)).append("\n"); + sb.append(" streamOptions: ").append(toIndentedString(streamOptions)).append("\n"); + sb.append(" temperature: ").append(toIndentedString(temperature)).append("\n"); + sb.append(" toolChoice: ").append(toIndentedString(toolChoice)).append("\n"); + sb.append(" tools: ").append(toIndentedString(tools)).append("\n"); + sb.append(" topLogprobs: ").append(toIndentedString(topLogprobs)).append("\n"); + sb.append(" topP: ").append(toIndentedString(topP)).append("\n"); + sb.append(" serviceTier: ").append(toIndentedString(serviceTier)).append("\n"); + sb.append(" thinking: ").append(toIndentedString(thinking)).append("\n"); + sb.append(" outputConfig: ").append(toIndentedString(outputConfig)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" contextManagement: ").append(toIndentedString(contextManagement)).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 MessagesRequest instance; + + public Builder() { + this(new MessagesRequest()); + } + + protected Builder(MessagesRequest instance) { + this.instance = instance; + } + + public MessagesRequest.Builder messages(List messages) { + this.instance.messages = messages; + return this; + } + public MessagesRequest.Builder model(String model) { + this.instance.model = model; + return this; + } + public MessagesRequest.Builder system(MessagesSystem system) { + this.instance.system = system; + return this; + } + public MessagesRequest.Builder frequencyPenalty(Double frequencyPenalty) { + this.instance.frequencyPenalty = frequencyPenalty; + return this; + } + public MessagesRequest.Builder logitBias(Map logitBias) { + this.instance.logitBias = logitBias; + return this; + } + public MessagesRequest.Builder logprobs(Boolean logprobs) { + this.instance.logprobs = logprobs; + return this; + } + public MessagesRequest.Builder maxTokens(Integer maxTokens) { + this.instance.maxTokens = maxTokens; + return this; + } + public MessagesRequest.Builder presencePenalty(Double presencePenalty) { + this.instance.presencePenalty = presencePenalty; + return this; + } + public MessagesRequest.Builder repetitionPenalty(Double repetitionPenalty) { + this.instance.repetitionPenalty = repetitionPenalty; + return this; + } + public MessagesRequest.Builder outputFormat(MessagesOutputFormat outputFormat) { + this.instance.outputFormat = outputFormat; + return this; + } + public MessagesRequest.Builder stopSequences(MessagesStopSequences stopSequences) { + this.instance.stopSequences = stopSequences; + return this; + } + public MessagesRequest.Builder stream(Boolean stream) { + this.instance.stream = stream; + return this; + } + public MessagesRequest.Builder streamOptions(MessagesStreamOptions streamOptions) { + this.instance.streamOptions = streamOptions; + return this; + } + public MessagesRequest.Builder temperature(Double temperature) { + this.instance.temperature = temperature; + return this; + } + public MessagesRequest.Builder toolChoice(MessagesToolChoice toolChoice) { + this.instance.toolChoice = toolChoice; + return this; + } + public MessagesRequest.Builder tools(List tools) { + this.instance.tools = tools; + return this; + } + public MessagesRequest.Builder topLogprobs(Integer topLogprobs) { + this.instance.topLogprobs = topLogprobs; + return this; + } + public MessagesRequest.Builder topP(Double topP) { + this.instance.topP = topP; + return this; + } + public MessagesRequest.Builder serviceTier(MessagesRequestServiceTier serviceTier) { + this.instance.serviceTier = serviceTier; + return this; + } + public MessagesRequest.Builder thinking(MessagesThinking thinking) { + this.instance.thinking = thinking; + return this; + } + public MessagesRequest.Builder outputConfig(MessagesOutputConfig outputConfig) { + this.instance.outputConfig = outputConfig; + return this; + } + public MessagesRequest.Builder metadata(MessagesMetadata metadata) { + this.instance.metadata = metadata; + return this; + } + public MessagesRequest.Builder contextManagement(MessagesContextManagement contextManagement) { + this.instance.contextManagement = contextManagement; + return this; + } + + + /** + * returns a built MessagesRequest instance. + * + * The builder is not reusable. + */ + public MessagesRequest 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 MessagesRequest.Builder builder() { + return new MessagesRequest.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesRequest.Builder toBuilder() { + return new MessagesRequest.Builder() + .messages(getMessages()) + .model(getModel()) + .system(getSystem()) + .frequencyPenalty(getFrequencyPenalty()) + .logitBias(getLogitBias()) + .logprobs(getLogprobs()) + .maxTokens(getMaxTokens()) + .presencePenalty(getPresencePenalty()) + .repetitionPenalty(getRepetitionPenalty()) + .outputFormat(getOutputFormat()) + .stopSequences(getStopSequences()) + .stream(getStream()) + .streamOptions(getStreamOptions()) + .temperature(getTemperature()) + .toolChoice(getToolChoice()) + .tools(getTools()) + .topLogprobs(getTopLogprobs()) + .topP(getTopP()) + .serviceTier(getServiceTier()) + .thinking(getThinking()) + .outputConfig(getOutputConfig()) + .metadata(getMetadata()) + .contextManagement(getContextManagement()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRequestMessage.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRequestMessage.java new file mode 100644 index 0000000..e431c53 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRequestMessage.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesRequestMessage + */ +@JsonPropertyOrder({ + MessagesRequestMessage.JSON_PROPERTY_ROLE, + MessagesRequestMessage.JSON_PROPERTY_CONTENT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesRequestMessage { + public static final String JSON_PROPERTY_ROLE = "role"; + @javax.annotation.Nonnull + private MessagesRole role; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nonnull + private MessagesMessageContent content; + + public MessagesRequestMessage() { + } + + public MessagesRequestMessage role(@javax.annotation.Nonnull MessagesRole role) { + + this.role = role; + return this; + } + + /** + * The role of the message author. + * @return role + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ROLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesRole getRole() { + return role; + } + + + @JsonProperty(value = JSON_PROPERTY_ROLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRole(@javax.annotation.Nonnull MessagesRole role) { + this.role = role; + } + + public MessagesRequestMessage content(@javax.annotation.Nonnull MessagesMessageContent content) { + + this.content = content; + return this; + } + + /** + * The contents of the message. + * @return content + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesMessageContent getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(@javax.annotation.Nonnull MessagesMessageContent content) { + this.content = content; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesRequestMessage messagesRequestMessage = (MessagesRequestMessage) o; + return Objects.equals(this.role, messagesRequestMessage.role) && + Objects.equals(this.content, messagesRequestMessage.content); + } + + @Override + public int hashCode() { + return Objects.hash(role, content); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesRequestMessage {\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).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 MessagesRequestMessage instance; + + public Builder() { + this(new MessagesRequestMessage()); + } + + protected Builder(MessagesRequestMessage instance) { + this.instance = instance; + } + + public MessagesRequestMessage.Builder role(MessagesRole role) { + this.instance.role = role; + return this; + } + public MessagesRequestMessage.Builder content(MessagesMessageContent content) { + this.instance.content = content; + return this; + } + + + /** + * returns a built MessagesRequestMessage instance. + * + * The builder is not reusable. + */ + public MessagesRequestMessage 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 MessagesRequestMessage.Builder builder() { + return new MessagesRequestMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesRequestMessage.Builder toBuilder() { + return new MessagesRequestMessage.Builder() + .role(getRole()) + .content(getContent()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRequestServiceTier.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRequestServiceTier.java new file mode 100644 index 0000000..994afc0 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRequestServiceTier.java @@ -0,0 +1,57 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MessagesRequestServiceTier + */ +public enum MessagesRequestServiceTier { + + AUTO("auto"), + + DEFAULT("default"); + + private String value; + + MessagesRequestServiceTier(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesRequestServiceTier fromValue(String value) { + for (MessagesRequestServiceTier b : MessagesRequestServiceTier.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/messages/MessagesResponse.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponse.java new file mode 100644 index 0000000..7f7a9c2 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponse.java @@ -0,0 +1,527 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * A Messages API response. + */ +@JsonPropertyOrder({ + MessagesResponse.JSON_PROPERTY_ID, + MessagesResponse.JSON_PROPERTY_TYPE, + MessagesResponse.JSON_PROPERTY_ROLE, + MessagesResponse.JSON_PROPERTY_MODEL, + MessagesResponse.JSON_PROPERTY_SERVICE_STATUS, + MessagesResponse.JSON_PROPERTY_CONTENT, + MessagesResponse.JSON_PROPERTY_STOP_REASON, + MessagesResponse.JSON_PROPERTY_STOP_SEQUENCE, + MessagesResponse.JSON_PROPERTY_USAGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponse { + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull + private String id; + + /** + * The response object type. Always `message`. + */ + public enum TypeEnum { + MESSAGE(String.valueOf("message")); + + 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; + + /** + * The response role. Always `assistant`. + */ + public enum RoleEnum { + ASSISTANT(String.valueOf("assistant")); + + private String value; + + RoleEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ROLE = "role"; + @javax.annotation.Nonnull + private RoleEnum role; + + public static final String JSON_PROPERTY_MODEL = "model"; + @javax.annotation.Nonnull + private String model; + + public static final String JSON_PROPERTY_SERVICE_STATUS = "service_status"; + @javax.annotation.Nullable + private MessagesServiceStatus serviceStatus; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nonnull + private List content; + + public static final String JSON_PROPERTY_STOP_REASON = "stop_reason"; + @javax.annotation.Nullable + private MessagesResponseStopReason stopReason; + + public static final String JSON_PROPERTY_STOP_SEQUENCE = "stop_sequence"; + @javax.annotation.Nullable + private String stopSequence; + + public static final String JSON_PROPERTY_USAGE = "usage"; + @javax.annotation.Nullable + private MessagesUsage usage; + + public MessagesResponse() { + } + + public MessagesResponse id(@javax.annotation.Nonnull String id) { + + this.id = id; + return this; + } + + /** + * A unique identifier for the response. + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + public MessagesResponse type(@javax.annotation.Nonnull TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The response object type. Always `message`. + * @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 MessagesResponse role(@javax.annotation.Nonnull RoleEnum role) { + + this.role = role; + return this; + } + + /** + * The response role. Always `assistant`. + * @return role + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ROLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public RoleEnum getRole() { + return role; + } + + + @JsonProperty(value = JSON_PROPERTY_ROLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRole(@javax.annotation.Nonnull RoleEnum role) { + this.role = role; + } + + public MessagesResponse model(@javax.annotation.Nonnull String model) { + + this.model = model; + return this; + } + + /** + * The model used to generate the response. + * @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 MessagesResponse serviceStatus(@javax.annotation.Nullable MessagesServiceStatus serviceStatus) { + + this.serviceStatus = serviceStatus; + return this; + } + + /** + * Service status such as model fallback information. + * @return serviceStatus + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SERVICE_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesServiceStatus getServiceStatus() { + return serviceStatus; + } + + + @JsonProperty(value = JSON_PROPERTY_SERVICE_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceStatus(@javax.annotation.Nullable MessagesServiceStatus serviceStatus) { + this.serviceStatus = serviceStatus; + } + + public MessagesResponse content(@javax.annotation.Nonnull List content) { + + this.content = content; + return this; + } + + public MessagesResponse addContentItem(MessagesResponseContentPart contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Content generated by the model. + * @return content + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(@javax.annotation.Nonnull List content) { + this.content = content; + } + + public MessagesResponse stopReason(@javax.annotation.Nullable MessagesResponseStopReason stopReason) { + + this.stopReason = stopReason; + return this; + } + + /** + * The reason the model stopped generating tokens. + * @return stopReason + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STOP_REASON, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesResponseStopReason getStopReason() { + return stopReason; + } + + + @JsonProperty(value = JSON_PROPERTY_STOP_REASON, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStopReason(@javax.annotation.Nullable MessagesResponseStopReason stopReason) { + this.stopReason = stopReason; + } + + public MessagesResponse stopSequence(@javax.annotation.Nullable String stopSequence) { + + this.stopSequence = stopSequence; + return this; + } + + /** + * The custom stop sequence that was generated, if any. + * @return stopSequence + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STOP_SEQUENCE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getStopSequence() { + return stopSequence; + } + + + @JsonProperty(value = JSON_PROPERTY_STOP_SEQUENCE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStopSequence(@javax.annotation.Nullable String stopSequence) { + this.stopSequence = stopSequence; + } + + public MessagesResponse usage(@javax.annotation.Nullable MessagesUsage usage) { + + this.usage = usage; + return this; + } + + /** + * Usage statistics for this request. + * @return usage + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesUsage getUsage() { + return usage; + } + + + @JsonProperty(value = JSON_PROPERTY_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsage(@javax.annotation.Nullable MessagesUsage usage) { + this.usage = usage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponse messagesResponse = (MessagesResponse) o; + return Objects.equals(this.id, messagesResponse.id) && + Objects.equals(this.type, messagesResponse.type) && + Objects.equals(this.role, messagesResponse.role) && + Objects.equals(this.model, messagesResponse.model) && + Objects.equals(this.serviceStatus, messagesResponse.serviceStatus) && + Objects.equals(this.content, messagesResponse.content) && + Objects.equals(this.stopReason, messagesResponse.stopReason) && + Objects.equals(this.stopSequence, messagesResponse.stopSequence) && + Objects.equals(this.usage, messagesResponse.usage); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, role, model, serviceStatus, content, stopReason, stopSequence, usage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" serviceStatus: ").append(toIndentedString(serviceStatus)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" stopReason: ").append(toIndentedString(stopReason)).append("\n"); + sb.append(" stopSequence: ").append(toIndentedString(stopSequence)).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 MessagesResponse instance; + + public Builder() { + this(new MessagesResponse()); + } + + protected Builder(MessagesResponse instance) { + this.instance = instance; + } + + public MessagesResponse.Builder id(String id) { + this.instance.id = id; + return this; + } + public MessagesResponse.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public MessagesResponse.Builder role(RoleEnum role) { + this.instance.role = role; + return this; + } + public MessagesResponse.Builder model(String model) { + this.instance.model = model; + return this; + } + public MessagesResponse.Builder serviceStatus(MessagesServiceStatus serviceStatus) { + this.instance.serviceStatus = serviceStatus; + return this; + } + public MessagesResponse.Builder content(List content) { + this.instance.content = content; + return this; + } + public MessagesResponse.Builder stopReason(MessagesResponseStopReason stopReason) { + this.instance.stopReason = stopReason; + return this; + } + public MessagesResponse.Builder stopSequence(String stopSequence) { + this.instance.stopSequence = stopSequence; + return this; + } + public MessagesResponse.Builder usage(MessagesUsage usage) { + this.instance.usage = usage; + return this; + } + + + /** + * returns a built MessagesResponse instance. + * + * The builder is not reusable. + */ + public MessagesResponse 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 MessagesResponse.Builder builder() { + return new MessagesResponse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponse.Builder toBuilder() { + return new MessagesResponse.Builder() + .id(getId()) + .type(getType()) + .role(getRole()) + .model(getModel()) + .serviceStatus(getServiceStatus()) + .content(getContent()) + .stopReason(getStopReason()) + .stopSequence(getStopSequence()) + .usage(getUsage()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlock.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlock.java new file mode 100644 index 0000000..fd5f987 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlock.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseContentBlock + */ +@JsonPropertyOrder({ + MessagesResponseContentBlock.JSON_PROPERTY_TYPE, + MessagesResponseContentBlock.JSON_PROPERTY_INDEX, + MessagesResponseContentBlock.JSON_PROPERTY_DELTA +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentBlock implements MessagesStreamEvent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesStreamEventType type = MessagesStreamEventType.CONTENT_BLOCK_DELTA; + + public static final String JSON_PROPERTY_INDEX = "index"; + @javax.annotation.Nonnull + private Integer index; + + public static final String JSON_PROPERTY_DELTA = "delta"; + @javax.annotation.Nonnull + private MessagesResponseContentBlockDelta delta; + + public MessagesResponseContentBlock() { + } + + public MessagesResponseContentBlock type(@javax.annotation.Nonnull MessagesStreamEventType 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 MessagesStreamEventType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesStreamEventType type) { + this.type = type; + } + + public MessagesResponseContentBlock index(@javax.annotation.Nonnull Integer index) { + + this.index = index; + return this; + } + + /** + * Get index + * @return index + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INDEX, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getIndex() { + return index; + } + + + @JsonProperty(value = JSON_PROPERTY_INDEX, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIndex(@javax.annotation.Nonnull Integer index) { + this.index = index; + } + + public MessagesResponseContentBlock delta(@javax.annotation.Nonnull MessagesResponseContentBlockDelta delta) { + + this.delta = delta; + return this; + } + + /** + * Get delta + * @return delta + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_DELTA, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesResponseContentBlockDelta getDelta() { + return delta; + } + + + @JsonProperty(value = JSON_PROPERTY_DELTA, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDelta(@javax.annotation.Nonnull MessagesResponseContentBlockDelta delta) { + this.delta = delta; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentBlock messagesResponseContentBlock = (MessagesResponseContentBlock) o; + return Objects.equals(this.type, messagesResponseContentBlock.type) && + Objects.equals(this.index, messagesResponseContentBlock.index) && + Objects.equals(this.delta, messagesResponseContentBlock.delta); + } + + @Override + public int hashCode() { + return Objects.hash(type, index, delta); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentBlock {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).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 MessagesResponseContentBlock instance; + + public Builder() { + this(new MessagesResponseContentBlock()); + } + + protected Builder(MessagesResponseContentBlock instance) { + this.instance = instance; + } + + public MessagesResponseContentBlock.Builder type(MessagesStreamEventType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentBlock.Builder index(Integer index) { + this.instance.index = index; + return this; + } + public MessagesResponseContentBlock.Builder delta(MessagesResponseContentBlockDelta delta) { + this.instance.delta = delta; + return this; + } + + + /** + * returns a built MessagesResponseContentBlock instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentBlock 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 MessagesResponseContentBlock.Builder builder() { + return new MessagesResponseContentBlock.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentBlock.Builder toBuilder() { + return new MessagesResponseContentBlock.Builder() + .type(getType()) + .index(getIndex()) + .delta(getDelta()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDelta.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDelta.java new file mode 100644 index 0000000..c68cc96 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDelta.java @@ -0,0 +1,33 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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 = MessagesResponseContentBlockDeltaToolUse.class, name = "input_json_delta"), + @JsonSubTypes.Type(value = MessagesResponseContentBlockDeltaSignature.class, name = "signature_delta"), + @JsonSubTypes.Type(value = MessagesResponseContentBlockDeltaText.class, name = "text_delta"), + @JsonSubTypes.Type(value = MessagesResponseContentBlockDeltaThinking.class, name = "thinking_delta"), +}) + +public interface MessagesResponseContentBlockDelta { + public MessagesResponseContentBlockDeltaType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaSignature.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaSignature.java new file mode 100644 index 0000000..163d3cf --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaSignature.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseContentBlockDeltaSignature + */ +@JsonPropertyOrder({ + MessagesResponseContentBlockDeltaSignature.JSON_PROPERTY_TYPE, + MessagesResponseContentBlockDeltaSignature.JSON_PROPERTY_SIGNATURE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentBlockDeltaSignature implements MessagesResponseContentBlockDelta { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesResponseContentBlockDeltaType type = MessagesResponseContentBlockDeltaType.SIGNATURE_DELTA; + + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @javax.annotation.Nonnull + private String signature; + + public MessagesResponseContentBlockDeltaSignature() { + } + + public MessagesResponseContentBlockDeltaSignature type(@javax.annotation.Nonnull MessagesResponseContentBlockDeltaType 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 MessagesResponseContentBlockDeltaType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesResponseContentBlockDeltaType type) { + this.type = type; + } + + public MessagesResponseContentBlockDeltaSignature signature(@javax.annotation.Nonnull String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getSignature() { + return signature; + } + + + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSignature(@javax.annotation.Nonnull String signature) { + this.signature = signature; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentBlockDeltaSignature messagesResponseContentBlockDeltaSignature = (MessagesResponseContentBlockDeltaSignature) o; + return Objects.equals(this.type, messagesResponseContentBlockDeltaSignature.type) && + Objects.equals(this.signature, messagesResponseContentBlockDeltaSignature.signature); + } + + @Override + public int hashCode() { + return Objects.hash(type, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentBlockDeltaSignature {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).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 MessagesResponseContentBlockDeltaSignature instance; + + public Builder() { + this(new MessagesResponseContentBlockDeltaSignature()); + } + + protected Builder(MessagesResponseContentBlockDeltaSignature instance) { + this.instance = instance; + } + + public MessagesResponseContentBlockDeltaSignature.Builder type(MessagesResponseContentBlockDeltaType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentBlockDeltaSignature.Builder signature(String signature) { + this.instance.signature = signature; + return this; + } + + + /** + * returns a built MessagesResponseContentBlockDeltaSignature instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentBlockDeltaSignature 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 MessagesResponseContentBlockDeltaSignature.Builder builder() { + return new MessagesResponseContentBlockDeltaSignature.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentBlockDeltaSignature.Builder toBuilder() { + return new MessagesResponseContentBlockDeltaSignature.Builder() + .type(getType()) + .signature(getSignature()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaText.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaText.java new file mode 100644 index 0000000..c5c1bfd --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaText.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseContentBlockDeltaText + */ +@JsonPropertyOrder({ + MessagesResponseContentBlockDeltaText.JSON_PROPERTY_TYPE, + MessagesResponseContentBlockDeltaText.JSON_PROPERTY_TEXT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentBlockDeltaText implements MessagesResponseContentBlockDelta { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesResponseContentBlockDeltaType type = MessagesResponseContentBlockDeltaType.TEXT_DELTA; + + public static final String JSON_PROPERTY_TEXT = "text"; + @javax.annotation.Nonnull + private String text; + + public MessagesResponseContentBlockDeltaText() { + } + + public MessagesResponseContentBlockDeltaText type(@javax.annotation.Nonnull MessagesResponseContentBlockDeltaType 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 MessagesResponseContentBlockDeltaType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesResponseContentBlockDeltaType type) { + this.type = type; + } + + public MessagesResponseContentBlockDeltaText text(@javax.annotation.Nonnull String text) { + + this.text = text; + return this; + } + + /** + * Get text + * @return text + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getText() { + return text; + } + + + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(@javax.annotation.Nonnull String text) { + this.text = text; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentBlockDeltaText messagesResponseContentBlockDeltaText = (MessagesResponseContentBlockDeltaText) o; + return Objects.equals(this.type, messagesResponseContentBlockDeltaText.type) && + Objects.equals(this.text, messagesResponseContentBlockDeltaText.text); + } + + @Override + public int hashCode() { + return Objects.hash(type, text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentBlockDeltaText {\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 MessagesResponseContentBlockDeltaText instance; + + public Builder() { + this(new MessagesResponseContentBlockDeltaText()); + } + + protected Builder(MessagesResponseContentBlockDeltaText instance) { + this.instance = instance; + } + + public MessagesResponseContentBlockDeltaText.Builder type(MessagesResponseContentBlockDeltaType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentBlockDeltaText.Builder text(String text) { + this.instance.text = text; + return this; + } + + + /** + * returns a built MessagesResponseContentBlockDeltaText instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentBlockDeltaText 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 MessagesResponseContentBlockDeltaText.Builder builder() { + return new MessagesResponseContentBlockDeltaText.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentBlockDeltaText.Builder toBuilder() { + return new MessagesResponseContentBlockDeltaText.Builder() + .type(getType()) + .text(getText()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaThinking.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaThinking.java new file mode 100644 index 0000000..3a08452 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaThinking.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseContentBlockDeltaThinking + */ +@JsonPropertyOrder({ + MessagesResponseContentBlockDeltaThinking.JSON_PROPERTY_TYPE, + MessagesResponseContentBlockDeltaThinking.JSON_PROPERTY_THINKING +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentBlockDeltaThinking implements MessagesResponseContentBlockDelta { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesResponseContentBlockDeltaType type = MessagesResponseContentBlockDeltaType.THINKING_DELTA; + + public static final String JSON_PROPERTY_THINKING = "thinking"; + @javax.annotation.Nonnull + private String thinking; + + public MessagesResponseContentBlockDeltaThinking() { + } + + public MessagesResponseContentBlockDeltaThinking type(@javax.annotation.Nonnull MessagesResponseContentBlockDeltaType 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 MessagesResponseContentBlockDeltaType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesResponseContentBlockDeltaType type) { + this.type = type; + } + + public MessagesResponseContentBlockDeltaThinking thinking(@javax.annotation.Nonnull String thinking) { + + this.thinking = thinking; + return this; + } + + /** + * Get thinking + * @return thinking + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_THINKING, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getThinking() { + return thinking; + } + + + @JsonProperty(value = JSON_PROPERTY_THINKING, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setThinking(@javax.annotation.Nonnull String thinking) { + this.thinking = thinking; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentBlockDeltaThinking messagesResponseContentBlockDeltaThinking = (MessagesResponseContentBlockDeltaThinking) o; + return Objects.equals(this.type, messagesResponseContentBlockDeltaThinking.type) && + Objects.equals(this.thinking, messagesResponseContentBlockDeltaThinking.thinking); + } + + @Override + public int hashCode() { + return Objects.hash(type, thinking); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentBlockDeltaThinking {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" thinking: ").append(toIndentedString(thinking)).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 MessagesResponseContentBlockDeltaThinking instance; + + public Builder() { + this(new MessagesResponseContentBlockDeltaThinking()); + } + + protected Builder(MessagesResponseContentBlockDeltaThinking instance) { + this.instance = instance; + } + + public MessagesResponseContentBlockDeltaThinking.Builder type(MessagesResponseContentBlockDeltaType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentBlockDeltaThinking.Builder thinking(String thinking) { + this.instance.thinking = thinking; + return this; + } + + + /** + * returns a built MessagesResponseContentBlockDeltaThinking instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentBlockDeltaThinking 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 MessagesResponseContentBlockDeltaThinking.Builder builder() { + return new MessagesResponseContentBlockDeltaThinking.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentBlockDeltaThinking.Builder toBuilder() { + return new MessagesResponseContentBlockDeltaThinking.Builder() + .type(getType()) + .thinking(getThinking()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaToolUse.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaToolUse.java new file mode 100644 index 0000000..58f9d71 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaToolUse.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseContentBlockDeltaToolUse + */ +@JsonPropertyOrder({ + MessagesResponseContentBlockDeltaToolUse.JSON_PROPERTY_TYPE, + MessagesResponseContentBlockDeltaToolUse.JSON_PROPERTY_PARTIAL_JSON +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentBlockDeltaToolUse implements MessagesResponseContentBlockDelta { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesResponseContentBlockDeltaType type = MessagesResponseContentBlockDeltaType.INPUT_JSON_DELTA; + + public static final String JSON_PROPERTY_PARTIAL_JSON = "partial_json"; + @javax.annotation.Nonnull + private String partialJson; + + public MessagesResponseContentBlockDeltaToolUse() { + } + + public MessagesResponseContentBlockDeltaToolUse type(@javax.annotation.Nonnull MessagesResponseContentBlockDeltaType 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 MessagesResponseContentBlockDeltaType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesResponseContentBlockDeltaType type) { + this.type = type; + } + + public MessagesResponseContentBlockDeltaToolUse partialJson(@javax.annotation.Nonnull String partialJson) { + + this.partialJson = partialJson; + return this; + } + + /** + * Get partialJson + * @return partialJson + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_PARTIAL_JSON, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getPartialJson() { + return partialJson; + } + + + @JsonProperty(value = JSON_PROPERTY_PARTIAL_JSON, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPartialJson(@javax.annotation.Nonnull String partialJson) { + this.partialJson = partialJson; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentBlockDeltaToolUse messagesResponseContentBlockDeltaToolUse = (MessagesResponseContentBlockDeltaToolUse) o; + return Objects.equals(this.type, messagesResponseContentBlockDeltaToolUse.type) && + Objects.equals(this.partialJson, messagesResponseContentBlockDeltaToolUse.partialJson); + } + + @Override + public int hashCode() { + return Objects.hash(type, partialJson); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentBlockDeltaToolUse {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" partialJson: ").append(toIndentedString(partialJson)).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 MessagesResponseContentBlockDeltaToolUse instance; + + public Builder() { + this(new MessagesResponseContentBlockDeltaToolUse()); + } + + protected Builder(MessagesResponseContentBlockDeltaToolUse instance) { + this.instance = instance; + } + + public MessagesResponseContentBlockDeltaToolUse.Builder type(MessagesResponseContentBlockDeltaType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentBlockDeltaToolUse.Builder partialJson(String partialJson) { + this.instance.partialJson = partialJson; + return this; + } + + + /** + * returns a built MessagesResponseContentBlockDeltaToolUse instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentBlockDeltaToolUse 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 MessagesResponseContentBlockDeltaToolUse.Builder builder() { + return new MessagesResponseContentBlockDeltaToolUse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentBlockDeltaToolUse.Builder toBuilder() { + return new MessagesResponseContentBlockDeltaToolUse.Builder() + .type(getType()) + .partialJson(getPartialJson()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaType.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaType.java new file mode 100644 index 0000000..50ad6ef --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockDeltaType.java @@ -0,0 +1,61 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MessagesResponseContentBlockDeltaType + */ +public enum MessagesResponseContentBlockDeltaType { + + INPUT_JSON_DELTA("input_json_delta"), + + SIGNATURE_DELTA("signature_delta"), + + TEXT_DELTA("text_delta"), + + THINKING_DELTA("thinking_delta"); + + private String value; + + MessagesResponseContentBlockDeltaType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesResponseContentBlockDeltaType fromValue(String value) { + for (MessagesResponseContentBlockDeltaType b : MessagesResponseContentBlockDeltaType.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/messages/MessagesResponseContentBlockStop.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockStop.java new file mode 100644 index 0000000..ed99b9f --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentBlockStop.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseContentBlockStop + */ +@JsonPropertyOrder({ + MessagesResponseContentBlockStop.JSON_PROPERTY_TYPE, + MessagesResponseContentBlockStop.JSON_PROPERTY_INDEX +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentBlockStop implements MessagesStreamEvent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesStreamEventType type = MessagesStreamEventType.CONTENT_BLOCK_STOP; + + public static final String JSON_PROPERTY_INDEX = "index"; + @javax.annotation.Nonnull + private Integer index; + + public MessagesResponseContentBlockStop() { + } + + public MessagesResponseContentBlockStop type(@javax.annotation.Nonnull MessagesStreamEventType 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 MessagesStreamEventType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesStreamEventType type) { + this.type = type; + } + + public MessagesResponseContentBlockStop index(@javax.annotation.Nonnull Integer index) { + + this.index = index; + return this; + } + + /** + * Get index + * @return index + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INDEX, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getIndex() { + return index; + } + + + @JsonProperty(value = JSON_PROPERTY_INDEX, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIndex(@javax.annotation.Nonnull Integer index) { + this.index = index; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentBlockStop messagesResponseContentBlockStop = (MessagesResponseContentBlockStop) o; + return Objects.equals(this.type, messagesResponseContentBlockStop.type) && + Objects.equals(this.index, messagesResponseContentBlockStop.index); + } + + @Override + public int hashCode() { + return Objects.hash(type, index); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentBlockStop {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" index: ").append(toIndentedString(index)).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 MessagesResponseContentBlockStop instance; + + public Builder() { + this(new MessagesResponseContentBlockStop()); + } + + protected Builder(MessagesResponseContentBlockStop instance) { + this.instance = instance; + } + + public MessagesResponseContentBlockStop.Builder type(MessagesStreamEventType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentBlockStop.Builder index(Integer index) { + this.instance.index = index; + return this; + } + + + /** + * returns a built MessagesResponseContentBlockStop instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentBlockStop 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 MessagesResponseContentBlockStop.Builder builder() { + return new MessagesResponseContentBlockStop.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentBlockStop.Builder toBuilder() { + return new MessagesResponseContentBlockStop.Builder() + .type(getType()) + .index(getIndex()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPart.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPart.java new file mode 100644 index 0000000..b2f5c9d --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPart.java @@ -0,0 +1,34 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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 = MessagesResponseContentPartServerToolUse.class, name = "server_tool_use"), + @JsonSubTypes.Type(value = MessagesResponseContentPartText.class, name = "text"), + @JsonSubTypes.Type(value = MessagesResponseContentPartThinking.class, name = "thinking"), + @JsonSubTypes.Type(value = MessagesResponseContentPartToolUse.class, name = "tool_use"), + @JsonSubTypes.Type(value = MessagesResponseContentPartWebSearchToolResult.class, name = "web_search_tool_result"), +}) + +public interface MessagesResponseContentPart { + public ContentBlockStartContentBlockType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartServerToolUse.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartServerToolUse.java new file mode 100644 index 0000000..24a9b8e --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartServerToolUse.java @@ -0,0 +1,270 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesResponseContentPartServerToolUse + */ +@JsonPropertyOrder({ + MessagesResponseContentPartServerToolUse.JSON_PROPERTY_TYPE, + MessagesResponseContentPartServerToolUse.JSON_PROPERTY_ID, + MessagesResponseContentPartServerToolUse.JSON_PROPERTY_NAME, + MessagesResponseContentPartServerToolUse.JSON_PROPERTY_INPUT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentPartServerToolUse implements ContentBlockStartContentBlock, MessagesResponseContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentBlockStartContentBlockType type = ContentBlockStartContentBlockType.SERVER_TOOL_USE; + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_INPUT = "input"; + @javax.annotation.Nonnull + private Map input; + + public MessagesResponseContentPartServerToolUse() { + } + + public MessagesResponseContentPartServerToolUse type(@javax.annotation.Nonnull ContentBlockStartContentBlockType 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 ContentBlockStartContentBlockType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentBlockStartContentBlockType type) { + this.type = type; + } + + public MessagesResponseContentPartServerToolUse id(@javax.annotation.Nonnull String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + public MessagesResponseContentPartServerToolUse name(@javax.annotation.Nonnull String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @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 MessagesResponseContentPartServerToolUse input(@javax.annotation.Nonnull Map input) { + + this.input = input; + return this; + } + + public MessagesResponseContentPartServerToolUse putInputItem(String key, Object inputItem) { + this.input.put(key, inputItem); + return this; + } + + /** + * Get input + * @return input + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INPUT, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + + public Map getInput() { + return input; + } + + + @JsonProperty(value = JSON_PROPERTY_INPUT, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setInput(@javax.annotation.Nonnull Map input) { + this.input = input; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentPartServerToolUse messagesResponseContentPartServerToolUse = (MessagesResponseContentPartServerToolUse) o; + return Objects.equals(this.type, messagesResponseContentPartServerToolUse.type) && + Objects.equals(this.id, messagesResponseContentPartServerToolUse.id) && + Objects.equals(this.name, messagesResponseContentPartServerToolUse.name) && + Objects.equals(this.input, messagesResponseContentPartServerToolUse.input); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, name, input); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentPartServerToolUse {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).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 MessagesResponseContentPartServerToolUse instance; + + public Builder() { + this(new MessagesResponseContentPartServerToolUse()); + } + + protected Builder(MessagesResponseContentPartServerToolUse instance) { + this.instance = instance; + } + + public MessagesResponseContentPartServerToolUse.Builder type(ContentBlockStartContentBlockType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentPartServerToolUse.Builder id(String id) { + this.instance.id = id; + return this; + } + public MessagesResponseContentPartServerToolUse.Builder name(String name) { + this.instance.name = name; + return this; + } + public MessagesResponseContentPartServerToolUse.Builder input(Map input) { + this.instance.input = input; + return this; + } + + + /** + * returns a built MessagesResponseContentPartServerToolUse instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentPartServerToolUse 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 MessagesResponseContentPartServerToolUse.Builder builder() { + return new MessagesResponseContentPartServerToolUse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentPartServerToolUse.Builder toBuilder() { + return new MessagesResponseContentPartServerToolUse.Builder() + .type(getType()) + .id(getId()) + .name(getName()) + .input(getInput()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartText.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartText.java new file mode 100644 index 0000000..0cf33fe --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartText.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseContentPartText + */ +@JsonPropertyOrder({ + MessagesResponseContentPartText.JSON_PROPERTY_TYPE, + MessagesResponseContentPartText.JSON_PROPERTY_TEXT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentPartText implements ContentBlockStartContentBlock, MessagesResponseContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentBlockStartContentBlockType type = ContentBlockStartContentBlockType.TEXT; + + public static final String JSON_PROPERTY_TEXT = "text"; + @javax.annotation.Nonnull + private String text; + + public MessagesResponseContentPartText() { + } + + public MessagesResponseContentPartText type(@javax.annotation.Nonnull ContentBlockStartContentBlockType 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 ContentBlockStartContentBlockType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentBlockStartContentBlockType type) { + this.type = type; + } + + public MessagesResponseContentPartText text(@javax.annotation.Nonnull String text) { + + this.text = text; + return this; + } + + /** + * Get text + * @return text + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getText() { + return text; + } + + + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(@javax.annotation.Nonnull String text) { + this.text = text; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentPartText messagesResponseContentPartText = (MessagesResponseContentPartText) o; + return Objects.equals(this.type, messagesResponseContentPartText.type) && + Objects.equals(this.text, messagesResponseContentPartText.text); + } + + @Override + public int hashCode() { + return Objects.hash(type, text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentPartText {\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 MessagesResponseContentPartText instance; + + public Builder() { + this(new MessagesResponseContentPartText()); + } + + protected Builder(MessagesResponseContentPartText instance) { + this.instance = instance; + } + + public MessagesResponseContentPartText.Builder type(ContentBlockStartContentBlockType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentPartText.Builder text(String text) { + this.instance.text = text; + return this; + } + + + /** + * returns a built MessagesResponseContentPartText instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentPartText 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 MessagesResponseContentPartText.Builder builder() { + return new MessagesResponseContentPartText.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentPartText.Builder toBuilder() { + return new MessagesResponseContentPartText.Builder() + .type(getType()) + .text(getText()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartThinking.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartThinking.java new file mode 100644 index 0000000..e17f7c1 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartThinking.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseContentPartThinking + */ +@JsonPropertyOrder({ + MessagesResponseContentPartThinking.JSON_PROPERTY_TYPE, + MessagesResponseContentPartThinking.JSON_PROPERTY_THINKING, + MessagesResponseContentPartThinking.JSON_PROPERTY_SIGNATURE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentPartThinking implements ContentBlockStartContentBlock, MessagesResponseContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentBlockStartContentBlockType type = ContentBlockStartContentBlockType.THINKING; + + public static final String JSON_PROPERTY_THINKING = "thinking"; + @javax.annotation.Nonnull + private String thinking; + + public static final String JSON_PROPERTY_SIGNATURE = "signature"; + @javax.annotation.Nullable + private String signature; + + public MessagesResponseContentPartThinking() { + } + + public MessagesResponseContentPartThinking type(@javax.annotation.Nonnull ContentBlockStartContentBlockType 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 ContentBlockStartContentBlockType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentBlockStartContentBlockType type) { + this.type = type; + } + + public MessagesResponseContentPartThinking thinking(@javax.annotation.Nonnull String thinking) { + + this.thinking = thinking; + return this; + } + + /** + * Get thinking + * @return thinking + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_THINKING, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getThinking() { + return thinking; + } + + + @JsonProperty(value = JSON_PROPERTY_THINKING, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setThinking(@javax.annotation.Nonnull String thinking) { + this.thinking = thinking; + } + + public MessagesResponseContentPartThinking signature(@javax.annotation.Nullable String signature) { + + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSignature() { + return signature; + } + + + @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSignature(@javax.annotation.Nullable String signature) { + this.signature = signature; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentPartThinking messagesResponseContentPartThinking = (MessagesResponseContentPartThinking) o; + return Objects.equals(this.type, messagesResponseContentPartThinking.type) && + Objects.equals(this.thinking, messagesResponseContentPartThinking.thinking) && + Objects.equals(this.signature, messagesResponseContentPartThinking.signature); + } + + @Override + public int hashCode() { + return Objects.hash(type, thinking, signature); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentPartThinking {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" thinking: ").append(toIndentedString(thinking)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).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 MessagesResponseContentPartThinking instance; + + public Builder() { + this(new MessagesResponseContentPartThinking()); + } + + protected Builder(MessagesResponseContentPartThinking instance) { + this.instance = instance; + } + + public MessagesResponseContentPartThinking.Builder type(ContentBlockStartContentBlockType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentPartThinking.Builder thinking(String thinking) { + this.instance.thinking = thinking; + return this; + } + public MessagesResponseContentPartThinking.Builder signature(String signature) { + this.instance.signature = signature; + return this; + } + + + /** + * returns a built MessagesResponseContentPartThinking instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentPartThinking 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 MessagesResponseContentPartThinking.Builder builder() { + return new MessagesResponseContentPartThinking.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentPartThinking.Builder toBuilder() { + return new MessagesResponseContentPartThinking.Builder() + .type(getType()) + .thinking(getThinking()) + .signature(getSignature()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartToolUse.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartToolUse.java new file mode 100644 index 0000000..5e93823 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartToolUse.java @@ -0,0 +1,270 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesResponseContentPartToolUse + */ +@JsonPropertyOrder({ + MessagesResponseContentPartToolUse.JSON_PROPERTY_TYPE, + MessagesResponseContentPartToolUse.JSON_PROPERTY_ID, + MessagesResponseContentPartToolUse.JSON_PROPERTY_NAME, + MessagesResponseContentPartToolUse.JSON_PROPERTY_INPUT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentPartToolUse implements ContentBlockStartContentBlock, MessagesResponseContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentBlockStartContentBlockType type = ContentBlockStartContentBlockType.TOOL_USE; + + public static final String JSON_PROPERTY_ID = "id"; + @javax.annotation.Nonnull + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_INPUT = "input"; + @javax.annotation.Nonnull + private Map input; + + public MessagesResponseContentPartToolUse() { + } + + public MessagesResponseContentPartToolUse type(@javax.annotation.Nonnull ContentBlockStartContentBlockType 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 ContentBlockStartContentBlockType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentBlockStartContentBlockType type) { + this.type = type; + } + + public MessagesResponseContentPartToolUse id(@javax.annotation.Nonnull String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + public MessagesResponseContentPartToolUse name(@javax.annotation.Nonnull String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @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 MessagesResponseContentPartToolUse input(@javax.annotation.Nonnull Map input) { + + this.input = input; + return this; + } + + public MessagesResponseContentPartToolUse putInputItem(String key, Object inputItem) { + this.input.put(key, inputItem); + return this; + } + + /** + * Get input + * @return input + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_INPUT, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + + public Map getInput() { + return input; + } + + + @JsonProperty(value = JSON_PROPERTY_INPUT, required = true) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.ALWAYS) + public void setInput(@javax.annotation.Nonnull Map input) { + this.input = input; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentPartToolUse messagesResponseContentPartToolUse = (MessagesResponseContentPartToolUse) o; + return Objects.equals(this.type, messagesResponseContentPartToolUse.type) && + Objects.equals(this.id, messagesResponseContentPartToolUse.id) && + Objects.equals(this.name, messagesResponseContentPartToolUse.name) && + Objects.equals(this.input, messagesResponseContentPartToolUse.input); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, name, input); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentPartToolUse {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" input: ").append(toIndentedString(input)).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 MessagesResponseContentPartToolUse instance; + + public Builder() { + this(new MessagesResponseContentPartToolUse()); + } + + protected Builder(MessagesResponseContentPartToolUse instance) { + this.instance = instance; + } + + public MessagesResponseContentPartToolUse.Builder type(ContentBlockStartContentBlockType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentPartToolUse.Builder id(String id) { + this.instance.id = id; + return this; + } + public MessagesResponseContentPartToolUse.Builder name(String name) { + this.instance.name = name; + return this; + } + public MessagesResponseContentPartToolUse.Builder input(Map input) { + this.instance.input = input; + return this; + } + + + /** + * returns a built MessagesResponseContentPartToolUse instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentPartToolUse 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 MessagesResponseContentPartToolUse.Builder builder() { + return new MessagesResponseContentPartToolUse.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentPartToolUse.Builder toBuilder() { + return new MessagesResponseContentPartToolUse.Builder() + .type(getType()) + .id(getId()) + .name(getName()) + .input(getInput()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartWebSearchToolResult.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartWebSearchToolResult.java new file mode 100644 index 0000000..9fe6864 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseContentPartWebSearchToolResult.java @@ -0,0 +1,264 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseContentPartWebSearchToolResult + */ +@JsonPropertyOrder({ + MessagesResponseContentPartWebSearchToolResult.JSON_PROPERTY_TYPE, + MessagesResponseContentPartWebSearchToolResult.JSON_PROPERTY_TOOL_USE_ID, + MessagesResponseContentPartWebSearchToolResult.JSON_PROPERTY_CONTENT, + MessagesResponseContentPartWebSearchToolResult.JSON_PROPERTY_CALLER +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseContentPartWebSearchToolResult implements ContentBlockStartContentBlock, MessagesResponseContentPart { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private ContentBlockStartContentBlockType type = ContentBlockStartContentBlockType.WEB_SEARCH_TOOL_RESULT; + + public static final String JSON_PROPERTY_TOOL_USE_ID = "tool_use_id"; + @javax.annotation.Nonnull + private String toolUseId; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nonnull + private MessagesWebSearchToolResultContent content; + + public static final String JSON_PROPERTY_CALLER = "caller"; + @javax.annotation.Nullable + private MessagesServerToolCaller caller; + + public MessagesResponseContentPartWebSearchToolResult() { + } + + public MessagesResponseContentPartWebSearchToolResult type(@javax.annotation.Nonnull ContentBlockStartContentBlockType 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 ContentBlockStartContentBlockType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull ContentBlockStartContentBlockType type) { + this.type = type; + } + + public MessagesResponseContentPartWebSearchToolResult toolUseId(@javax.annotation.Nonnull String toolUseId) { + + this.toolUseId = toolUseId; + return this; + } + + /** + * Get toolUseId + * @return toolUseId + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TOOL_USE_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getToolUseId() { + return toolUseId; + } + + + @JsonProperty(value = JSON_PROPERTY_TOOL_USE_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setToolUseId(@javax.annotation.Nonnull String toolUseId) { + this.toolUseId = toolUseId; + } + + public MessagesResponseContentPartWebSearchToolResult content(@javax.annotation.Nonnull MessagesWebSearchToolResultContent content) { + + this.content = content; + return this; + } + + /** + * Get content + * @return content + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesWebSearchToolResultContent getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(@javax.annotation.Nonnull MessagesWebSearchToolResultContent content) { + this.content = content; + } + + public MessagesResponseContentPartWebSearchToolResult caller(@javax.annotation.Nullable MessagesServerToolCaller caller) { + + this.caller = caller; + return this; + } + + /** + * Get caller + * @return caller + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CALLER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesServerToolCaller getCaller() { + return caller; + } + + + @JsonProperty(value = JSON_PROPERTY_CALLER, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCaller(@javax.annotation.Nullable MessagesServerToolCaller caller) { + this.caller = caller; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseContentPartWebSearchToolResult messagesResponseContentPartWebSearchToolResult = (MessagesResponseContentPartWebSearchToolResult) o; + return Objects.equals(this.type, messagesResponseContentPartWebSearchToolResult.type) && + Objects.equals(this.toolUseId, messagesResponseContentPartWebSearchToolResult.toolUseId) && + Objects.equals(this.content, messagesResponseContentPartWebSearchToolResult.content) && + Objects.equals(this.caller, messagesResponseContentPartWebSearchToolResult.caller); + } + + @Override + public int hashCode() { + return Objects.hash(type, toolUseId, content, caller); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseContentPartWebSearchToolResult {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" toolUseId: ").append(toIndentedString(toolUseId)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" caller: ").append(toIndentedString(caller)).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 MessagesResponseContentPartWebSearchToolResult instance; + + public Builder() { + this(new MessagesResponseContentPartWebSearchToolResult()); + } + + protected Builder(MessagesResponseContentPartWebSearchToolResult instance) { + this.instance = instance; + } + + public MessagesResponseContentPartWebSearchToolResult.Builder type(ContentBlockStartContentBlockType type) { + this.instance.type = type; + return this; + } + public MessagesResponseContentPartWebSearchToolResult.Builder toolUseId(String toolUseId) { + this.instance.toolUseId = toolUseId; + return this; + } + public MessagesResponseContentPartWebSearchToolResult.Builder content(MessagesWebSearchToolResultContent content) { + this.instance.content = content; + return this; + } + public MessagesResponseContentPartWebSearchToolResult.Builder caller(MessagesServerToolCaller caller) { + this.instance.caller = caller; + return this; + } + + + /** + * returns a built MessagesResponseContentPartWebSearchToolResult instance. + * + * The builder is not reusable. + */ + public MessagesResponseContentPartWebSearchToolResult 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 MessagesResponseContentPartWebSearchToolResult.Builder builder() { + return new MessagesResponseContentPartWebSearchToolResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseContentPartWebSearchToolResult.Builder toBuilder() { + return new MessagesResponseContentPartWebSearchToolResult.Builder() + .type(getType()) + .toolUseId(getToolUseId()) + .content(getContent()) + .caller(getCaller()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStopReason.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStopReason.java new file mode 100644 index 0000000..a2fdf9e --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStopReason.java @@ -0,0 +1,65 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The reason the model stopped generating tokens. + */ +public enum MessagesResponseStopReason { + + END_TURN("end_turn"), + + MAX_TOKENS("max_tokens"), + + STOP_SEQUENCE("stop_sequence"), + + TOOL_USE("tool_use"), + + PAUSE_TURN("pause_turn"), + + REFUSAL("refusal"); + + private String value; + + MessagesResponseStopReason(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesResponseStopReason fromValue(String value) { + for (MessagesResponseStopReason b : MessagesResponseStopReason.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/messages/MessagesResponseStreamMessageDelta.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageDelta.java new file mode 100644 index 0000000..be9203a --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageDelta.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseStreamMessageDelta + */ +@JsonPropertyOrder({ + MessagesResponseStreamMessageDelta.JSON_PROPERTY_TYPE, + MessagesResponseStreamMessageDelta.JSON_PROPERTY_DELTA, + MessagesResponseStreamMessageDelta.JSON_PROPERTY_USAGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseStreamMessageDelta implements MessagesStreamEvent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesStreamEventType type = MessagesStreamEventType.MESSAGE_DELTA; + + public static final String JSON_PROPERTY_DELTA = "delta"; + @javax.annotation.Nonnull + private MessagesResponseStreamMessageDeltaDelta delta; + + public static final String JSON_PROPERTY_USAGE = "usage"; + @javax.annotation.Nullable + private MessagesUsage usage; + + public MessagesResponseStreamMessageDelta() { + } + + public MessagesResponseStreamMessageDelta type(@javax.annotation.Nonnull MessagesStreamEventType 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 MessagesStreamEventType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesStreamEventType type) { + this.type = type; + } + + public MessagesResponseStreamMessageDelta delta(@javax.annotation.Nonnull MessagesResponseStreamMessageDeltaDelta delta) { + + this.delta = delta; + return this; + } + + /** + * Get delta + * @return delta + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_DELTA, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesResponseStreamMessageDeltaDelta getDelta() { + return delta; + } + + + @JsonProperty(value = JSON_PROPERTY_DELTA, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDelta(@javax.annotation.Nonnull MessagesResponseStreamMessageDeltaDelta delta) { + this.delta = delta; + } + + public MessagesResponseStreamMessageDelta usage(@javax.annotation.Nullable MessagesUsage usage) { + + this.usage = usage; + return this; + } + + /** + * Get usage + * @return usage + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesUsage getUsage() { + return usage; + } + + + @JsonProperty(value = JSON_PROPERTY_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUsage(@javax.annotation.Nullable MessagesUsage usage) { + this.usage = usage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseStreamMessageDelta messagesResponseStreamMessageDelta = (MessagesResponseStreamMessageDelta) o; + return Objects.equals(this.type, messagesResponseStreamMessageDelta.type) && + Objects.equals(this.delta, messagesResponseStreamMessageDelta.delta) && + Objects.equals(this.usage, messagesResponseStreamMessageDelta.usage); + } + + @Override + public int hashCode() { + return Objects.hash(type, delta, usage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseStreamMessageDelta {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" delta: ").append(toIndentedString(delta)).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 MessagesResponseStreamMessageDelta instance; + + public Builder() { + this(new MessagesResponseStreamMessageDelta()); + } + + protected Builder(MessagesResponseStreamMessageDelta instance) { + this.instance = instance; + } + + public MessagesResponseStreamMessageDelta.Builder type(MessagesStreamEventType type) { + this.instance.type = type; + return this; + } + public MessagesResponseStreamMessageDelta.Builder delta(MessagesResponseStreamMessageDeltaDelta delta) { + this.instance.delta = delta; + return this; + } + public MessagesResponseStreamMessageDelta.Builder usage(MessagesUsage usage) { + this.instance.usage = usage; + return this; + } + + + /** + * returns a built MessagesResponseStreamMessageDelta instance. + * + * The builder is not reusable. + */ + public MessagesResponseStreamMessageDelta 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 MessagesResponseStreamMessageDelta.Builder builder() { + return new MessagesResponseStreamMessageDelta.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseStreamMessageDelta.Builder toBuilder() { + return new MessagesResponseStreamMessageDelta.Builder() + .type(getType()) + .delta(getDelta()) + .usage(getUsage()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageDeltaDelta.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageDeltaDelta.java new file mode 100644 index 0000000..2483d60 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageDeltaDelta.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseStreamMessageDeltaDelta + */ +@JsonPropertyOrder({ + MessagesResponseStreamMessageDeltaDelta.JSON_PROPERTY_STOP_REASON, + MessagesResponseStreamMessageDeltaDelta.JSON_PROPERTY_STOP_SEQUENCE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseStreamMessageDeltaDelta { + public static final String JSON_PROPERTY_STOP_REASON = "stop_reason"; + @javax.annotation.Nonnull + private MessagesResponseStopReason stopReason; + + public static final String JSON_PROPERTY_STOP_SEQUENCE = "stop_sequence"; + @javax.annotation.Nullable + private String stopSequence; + + public MessagesResponseStreamMessageDeltaDelta() { + } + + public MessagesResponseStreamMessageDeltaDelta stopReason(@javax.annotation.Nonnull MessagesResponseStopReason stopReason) { + + this.stopReason = stopReason; + return this; + } + + /** + * Get stopReason + * @return stopReason + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_STOP_REASON, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesResponseStopReason getStopReason() { + return stopReason; + } + + + @JsonProperty(value = JSON_PROPERTY_STOP_REASON, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStopReason(@javax.annotation.Nonnull MessagesResponseStopReason stopReason) { + this.stopReason = stopReason; + } + + public MessagesResponseStreamMessageDeltaDelta stopSequence(@javax.annotation.Nullable String stopSequence) { + + this.stopSequence = stopSequence; + return this; + } + + /** + * Get stopSequence + * @return stopSequence + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STOP_SEQUENCE, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStopSequence() { + return stopSequence; + } + + + @JsonProperty(value = JSON_PROPERTY_STOP_SEQUENCE, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStopSequence(@javax.annotation.Nullable String stopSequence) { + this.stopSequence = stopSequence; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseStreamMessageDeltaDelta messagesResponseStreamMessageDeltaDelta = (MessagesResponseStreamMessageDeltaDelta) o; + return Objects.equals(this.stopReason, messagesResponseStreamMessageDeltaDelta.stopReason) && + Objects.equals(this.stopSequence, messagesResponseStreamMessageDeltaDelta.stopSequence); + } + + @Override + public int hashCode() { + return Objects.hash(stopReason, stopSequence); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseStreamMessageDeltaDelta {\n"); + sb.append(" stopReason: ").append(toIndentedString(stopReason)).append("\n"); + sb.append(" stopSequence: ").append(toIndentedString(stopSequence)).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 MessagesResponseStreamMessageDeltaDelta instance; + + public Builder() { + this(new MessagesResponseStreamMessageDeltaDelta()); + } + + protected Builder(MessagesResponseStreamMessageDeltaDelta instance) { + this.instance = instance; + } + + public MessagesResponseStreamMessageDeltaDelta.Builder stopReason(MessagesResponseStopReason stopReason) { + this.instance.stopReason = stopReason; + return this; + } + public MessagesResponseStreamMessageDeltaDelta.Builder stopSequence(String stopSequence) { + this.instance.stopSequence = stopSequence; + return this; + } + + + /** + * returns a built MessagesResponseStreamMessageDeltaDelta instance. + * + * The builder is not reusable. + */ + public MessagesResponseStreamMessageDeltaDelta 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 MessagesResponseStreamMessageDeltaDelta.Builder builder() { + return new MessagesResponseStreamMessageDeltaDelta.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseStreamMessageDeltaDelta.Builder toBuilder() { + return new MessagesResponseStreamMessageDeltaDelta.Builder() + .stopReason(getStopReason()) + .stopSequence(getStopSequence()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageStart.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageStart.java new file mode 100644 index 0000000..01cdbbe --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageStart.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseStreamMessageStart + */ +@JsonPropertyOrder({ + MessagesResponseStreamMessageStart.JSON_PROPERTY_TYPE, + MessagesResponseStreamMessageStart.JSON_PROPERTY_MESSAGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseStreamMessageStart implements MessagesStreamEvent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesStreamEventType type = MessagesStreamEventType.MESSAGE_START; + + public static final String JSON_PROPERTY_MESSAGE = "message"; + @javax.annotation.Nonnull + private MessagesResponseStreamMessageStartMessage message; + + public MessagesResponseStreamMessageStart() { + } + + public MessagesResponseStreamMessageStart type(@javax.annotation.Nonnull MessagesStreamEventType 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 MessagesStreamEventType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesStreamEventType type) { + this.type = type; + } + + public MessagesResponseStreamMessageStart message(@javax.annotation.Nonnull MessagesResponseStreamMessageStartMessage message) { + + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesResponseStreamMessageStartMessage getMessage() { + return message; + } + + + @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setMessage(@javax.annotation.Nonnull MessagesResponseStreamMessageStartMessage message) { + this.message = message; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseStreamMessageStart messagesResponseStreamMessageStart = (MessagesResponseStreamMessageStart) o; + return Objects.equals(this.type, messagesResponseStreamMessageStart.type) && + Objects.equals(this.message, messagesResponseStreamMessageStart.message); + } + + @Override + public int hashCode() { + return Objects.hash(type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseStreamMessageStart {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).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 MessagesResponseStreamMessageStart instance; + + public Builder() { + this(new MessagesResponseStreamMessageStart()); + } + + protected Builder(MessagesResponseStreamMessageStart instance) { + this.instance = instance; + } + + public MessagesResponseStreamMessageStart.Builder type(MessagesStreamEventType type) { + this.instance.type = type; + return this; + } + public MessagesResponseStreamMessageStart.Builder message(MessagesResponseStreamMessageStartMessage message) { + this.instance.message = message; + return this; + } + + + /** + * returns a built MessagesResponseStreamMessageStart instance. + * + * The builder is not reusable. + */ + public MessagesResponseStreamMessageStart 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 MessagesResponseStreamMessageStart.Builder builder() { + return new MessagesResponseStreamMessageStart.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseStreamMessageStart.Builder toBuilder() { + return new MessagesResponseStreamMessageStart.Builder() + .type(getType()) + .message(getMessage()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageStartMessage.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageStartMessage.java new file mode 100644 index 0000000..d36d174 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageStartMessage.java @@ -0,0 +1,527 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * MessagesResponseStreamMessageStartMessage + */ +@JsonPropertyOrder({ + MessagesResponseStreamMessageStartMessage.JSON_PROPERTY_TYPE, + MessagesResponseStreamMessageStartMessage.JSON_PROPERTY_ID, + MessagesResponseStreamMessageStartMessage.JSON_PROPERTY_ROLE, + MessagesResponseStreamMessageStartMessage.JSON_PROPERTY_CONTENT, + MessagesResponseStreamMessageStartMessage.JSON_PROPERTY_MODEL, + MessagesResponseStreamMessageStartMessage.JSON_PROPERTY_SERVICE_STATUS, + MessagesResponseStreamMessageStartMessage.JSON_PROPERTY_STOP_REASON, + MessagesResponseStreamMessageStartMessage.JSON_PROPERTY_STOP_SEQUENCE, + MessagesResponseStreamMessageStartMessage.JSON_PROPERTY_USAGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseStreamMessageStartMessage { + /** + * Gets or Sets type + */ + public enum TypeEnum { + MESSAGE(String.valueOf("message")); + + 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_ID = "id"; + @javax.annotation.Nonnull + private String id; + + /** + * Gets or Sets role + */ + public enum RoleEnum { + ASSISTANT(String.valueOf("assistant")); + + private String value; + + RoleEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static RoleEnum fromValue(String value) { + for (RoleEnum b : RoleEnum.values()) { + if (b.value.equalsIgnoreCase(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ROLE = "role"; + @javax.annotation.Nonnull + private RoleEnum role; + + public static final String JSON_PROPERTY_CONTENT = "content"; + @javax.annotation.Nonnull + private List content; + + public static final String JSON_PROPERTY_MODEL = "model"; + @javax.annotation.Nonnull + private String model; + + public static final String JSON_PROPERTY_SERVICE_STATUS = "service_status"; + @javax.annotation.Nullable + private MessagesServiceStatus serviceStatus; + + public static final String JSON_PROPERTY_STOP_REASON = "stop_reason"; + @javax.annotation.Nullable + private MessagesResponseStopReason stopReason; + + public static final String JSON_PROPERTY_STOP_SEQUENCE = "stop_sequence"; + @javax.annotation.Nullable + private String stopSequence; + + public static final String JSON_PROPERTY_USAGE = "usage"; + @javax.annotation.Nullable + private MessagesUsage usage; + + public MessagesResponseStreamMessageStartMessage() { + } + + public MessagesResponseStreamMessageStartMessage 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 MessagesResponseStreamMessageStartMessage id(@javax.annotation.Nonnull String id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getId() { + return id; + } + + + @JsonProperty(value = JSON_PROPERTY_ID, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + public MessagesResponseStreamMessageStartMessage role(@javax.annotation.Nonnull RoleEnum role) { + + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ROLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public RoleEnum getRole() { + return role; + } + + + @JsonProperty(value = JSON_PROPERTY_ROLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRole(@javax.annotation.Nonnull RoleEnum role) { + this.role = role; + } + + public MessagesResponseStreamMessageStartMessage content(@javax.annotation.Nonnull List content) { + + this.content = content; + return this; + } + + public MessagesResponseStreamMessageStartMessage addContentItem(Object contentItem) { + if (this.content == null) { + this.content = new ArrayList<>(); + } + this.content.add(contentItem); + return this; + } + + /** + * Get content + * @return content + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getContent() { + return content; + } + + + @JsonProperty(value = JSON_PROPERTY_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setContent(@javax.annotation.Nonnull List content) { + this.content = content; + } + + public MessagesResponseStreamMessageStartMessage model(@javax.annotation.Nonnull String model) { + + this.model = model; + return this; + } + + /** + * Get model + * @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 MessagesResponseStreamMessageStartMessage serviceStatus(@javax.annotation.Nullable MessagesServiceStatus serviceStatus) { + + this.serviceStatus = serviceStatus; + return this; + } + + /** + * Get serviceStatus + * @return serviceStatus + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SERVICE_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesServiceStatus getServiceStatus() { + return serviceStatus; + } + + + @JsonProperty(value = JSON_PROPERTY_SERVICE_STATUS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServiceStatus(@javax.annotation.Nullable MessagesServiceStatus serviceStatus) { + this.serviceStatus = serviceStatus; + } + + public MessagesResponseStreamMessageStartMessage stopReason(@javax.annotation.Nullable MessagesResponseStopReason stopReason) { + + this.stopReason = stopReason; + return this; + } + + /** + * Get stopReason + * @return stopReason + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STOP_REASON, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesResponseStopReason getStopReason() { + return stopReason; + } + + + @JsonProperty(value = JSON_PROPERTY_STOP_REASON, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStopReason(@javax.annotation.Nullable MessagesResponseStopReason stopReason) { + this.stopReason = stopReason; + } + + public MessagesResponseStreamMessageStartMessage stopSequence(@javax.annotation.Nullable String stopSequence) { + + this.stopSequence = stopSequence; + return this; + } + + /** + * Get stopSequence + * @return stopSequence + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STOP_SEQUENCE, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStopSequence() { + return stopSequence; + } + + + @JsonProperty(value = JSON_PROPERTY_STOP_SEQUENCE, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStopSequence(@javax.annotation.Nullable String stopSequence) { + this.stopSequence = stopSequence; + } + + public MessagesResponseStreamMessageStartMessage usage(@javax.annotation.Nullable MessagesUsage usage) { + + this.usage = usage; + return this; + } + + /** + * Get usage + * @return usage + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public MessagesUsage getUsage() { + return usage; + } + + + @JsonProperty(value = JSON_PROPERTY_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUsage(@javax.annotation.Nullable MessagesUsage usage) { + this.usage = usage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseStreamMessageStartMessage messagesResponseStreamMessageStartMessage = (MessagesResponseStreamMessageStartMessage) o; + return Objects.equals(this.type, messagesResponseStreamMessageStartMessage.type) && + Objects.equals(this.id, messagesResponseStreamMessageStartMessage.id) && + Objects.equals(this.role, messagesResponseStreamMessageStartMessage.role) && + Objects.equals(this.content, messagesResponseStreamMessageStartMessage.content) && + Objects.equals(this.model, messagesResponseStreamMessageStartMessage.model) && + Objects.equals(this.serviceStatus, messagesResponseStreamMessageStartMessage.serviceStatus) && + Objects.equals(this.stopReason, messagesResponseStreamMessageStartMessage.stopReason) && + Objects.equals(this.stopSequence, messagesResponseStreamMessageStartMessage.stopSequence) && + Objects.equals(this.usage, messagesResponseStreamMessageStartMessage.usage); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, role, content, model, serviceStatus, stopReason, stopSequence, usage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseStreamMessageStartMessage {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" model: ").append(toIndentedString(model)).append("\n"); + sb.append(" serviceStatus: ").append(toIndentedString(serviceStatus)).append("\n"); + sb.append(" stopReason: ").append(toIndentedString(stopReason)).append("\n"); + sb.append(" stopSequence: ").append(toIndentedString(stopSequence)).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 MessagesResponseStreamMessageStartMessage instance; + + public Builder() { + this(new MessagesResponseStreamMessageStartMessage()); + } + + protected Builder(MessagesResponseStreamMessageStartMessage instance) { + this.instance = instance; + } + + public MessagesResponseStreamMessageStartMessage.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public MessagesResponseStreamMessageStartMessage.Builder id(String id) { + this.instance.id = id; + return this; + } + public MessagesResponseStreamMessageStartMessage.Builder role(RoleEnum role) { + this.instance.role = role; + return this; + } + public MessagesResponseStreamMessageStartMessage.Builder content(List content) { + this.instance.content = content; + return this; + } + public MessagesResponseStreamMessageStartMessage.Builder model(String model) { + this.instance.model = model; + return this; + } + public MessagesResponseStreamMessageStartMessage.Builder serviceStatus(MessagesServiceStatus serviceStatus) { + this.instance.serviceStatus = serviceStatus; + return this; + } + public MessagesResponseStreamMessageStartMessage.Builder stopReason(MessagesResponseStopReason stopReason) { + this.instance.stopReason = stopReason; + return this; + } + public MessagesResponseStreamMessageStartMessage.Builder stopSequence(String stopSequence) { + this.instance.stopSequence = stopSequence; + return this; + } + public MessagesResponseStreamMessageStartMessage.Builder usage(MessagesUsage usage) { + this.instance.usage = usage; + return this; + } + + + /** + * returns a built MessagesResponseStreamMessageStartMessage instance. + * + * The builder is not reusable. + */ + public MessagesResponseStreamMessageStartMessage 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 MessagesResponseStreamMessageStartMessage.Builder builder() { + return new MessagesResponseStreamMessageStartMessage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseStreamMessageStartMessage.Builder toBuilder() { + return new MessagesResponseStreamMessageStartMessage.Builder() + .type(getType()) + .id(getId()) + .role(getRole()) + .content(getContent()) + .model(getModel()) + .serviceStatus(getServiceStatus()) + .stopReason(getStopReason()) + .stopSequence(getStopSequence()) + .usage(getUsage()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageStop.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageStop.java new file mode 100644 index 0000000..0d84398 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesResponseStreamMessageStop.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesResponseStreamMessageStop + */ +@JsonPropertyOrder({ + MessagesResponseStreamMessageStop.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesResponseStreamMessageStop implements MessagesStreamEvent { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesStreamEventType type = MessagesStreamEventType.MESSAGE_STOP; + + public MessagesResponseStreamMessageStop() { + } + + public MessagesResponseStreamMessageStop type(@javax.annotation.Nonnull MessagesStreamEventType 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 MessagesStreamEventType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesStreamEventType type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesResponseStreamMessageStop messagesResponseStreamMessageStop = (MessagesResponseStreamMessageStop) o; + return Objects.equals(this.type, messagesResponseStreamMessageStop.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesResponseStreamMessageStop {\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 MessagesResponseStreamMessageStop instance; + + public Builder() { + this(new MessagesResponseStreamMessageStop()); + } + + protected Builder(MessagesResponseStreamMessageStop instance) { + this.instance = instance; + } + + public MessagesResponseStreamMessageStop.Builder type(MessagesStreamEventType type) { + this.instance.type = type; + return this; + } + + + /** + * returns a built MessagesResponseStreamMessageStop instance. + * + * The builder is not reusable. + */ + public MessagesResponseStreamMessageStop 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 MessagesResponseStreamMessageStop.Builder builder() { + return new MessagesResponseStreamMessageStop.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesResponseStreamMessageStop.Builder toBuilder() { + return new MessagesResponseStreamMessageStop.Builder() + .type(getType()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRole.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRole.java new file mode 100644 index 0000000..cae3195 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesRole.java @@ -0,0 +1,59 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MessagesRole + */ +public enum MessagesRole { + + ASSISTANT("assistant"), + + USER("user"), + + SYSTEM("system"); + + private String value; + + MessagesRole(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesRole fromValue(String value) { + for (MessagesRole b : MessagesRole.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/messages/MessagesServerToolCaller.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesServerToolCaller.java new file mode 100644 index 0000000..f69c47b --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesServerToolCaller.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesServerToolCaller + */ +@JsonPropertyOrder({ + MessagesServerToolCaller.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesServerToolCaller { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type; + + public MessagesServerToolCaller() { + } + + public MessagesServerToolCaller type(@javax.annotation.Nonnull String type) { + + this.type = type; + return this; + } + + /** + * Identifies the server-side caller that produced this result. + * @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; + } + MessagesServerToolCaller messagesServerToolCaller = (MessagesServerToolCaller) o; + return Objects.equals(this.type, messagesServerToolCaller.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesServerToolCaller {\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 MessagesServerToolCaller instance; + + public Builder() { + this(new MessagesServerToolCaller()); + } + + protected Builder(MessagesServerToolCaller instance) { + this.instance = instance; + } + + public MessagesServerToolCaller.Builder type(String type) { + this.instance.type = type; + return this; + } + + + /** + * returns a built MessagesServerToolCaller instance. + * + * The builder is not reusable. + */ + public MessagesServerToolCaller 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 MessagesServerToolCaller.Builder builder() { + return new MessagesServerToolCaller.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesServerToolCaller.Builder toBuilder() { + return new MessagesServerToolCaller.Builder() + .type(getType()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesServerToolUsage.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesServerToolUsage.java new file mode 100644 index 0000000..01b0a24 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesServerToolUsage.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesServerToolUsage + */ +@JsonPropertyOrder({ + MessagesServerToolUsage.JSON_PROPERTY_WEB_SEARCH_REQUESTS, + MessagesServerToolUsage.JSON_PROPERTY_WEB_FETCH_REQUESTS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesServerToolUsage { + public static final String JSON_PROPERTY_WEB_SEARCH_REQUESTS = "web_search_requests"; + @javax.annotation.Nonnull + private Integer webSearchRequests; + + public static final String JSON_PROPERTY_WEB_FETCH_REQUESTS = "web_fetch_requests"; + @javax.annotation.Nonnull + private Integer webFetchRequests; + + public MessagesServerToolUsage() { + } + + public MessagesServerToolUsage webSearchRequests(@javax.annotation.Nonnull Integer webSearchRequests) { + + this.webSearchRequests = webSearchRequests; + return this; + } + + /** + * Number of web-search requests dispatched by server-managed tools. + * @return webSearchRequests + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_WEB_SEARCH_REQUESTS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getWebSearchRequests() { + return webSearchRequests; + } + + + @JsonProperty(value = JSON_PROPERTY_WEB_SEARCH_REQUESTS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWebSearchRequests(@javax.annotation.Nonnull Integer webSearchRequests) { + this.webSearchRequests = webSearchRequests; + } + + public MessagesServerToolUsage webFetchRequests(@javax.annotation.Nonnull Integer webFetchRequests) { + + this.webFetchRequests = webFetchRequests; + return this; + } + + /** + * Number of web-fetch requests dispatched by server-managed tools. + * @return webFetchRequests + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_WEB_FETCH_REQUESTS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Integer getWebFetchRequests() { + return webFetchRequests; + } + + + @JsonProperty(value = JSON_PROPERTY_WEB_FETCH_REQUESTS, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setWebFetchRequests(@javax.annotation.Nonnull Integer webFetchRequests) { + this.webFetchRequests = webFetchRequests; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesServerToolUsage messagesServerToolUsage = (MessagesServerToolUsage) o; + return Objects.equals(this.webSearchRequests, messagesServerToolUsage.webSearchRequests) && + Objects.equals(this.webFetchRequests, messagesServerToolUsage.webFetchRequests); + } + + @Override + public int hashCode() { + return Objects.hash(webSearchRequests, webFetchRequests); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesServerToolUsage {\n"); + sb.append(" webSearchRequests: ").append(toIndentedString(webSearchRequests)).append("\n"); + sb.append(" webFetchRequests: ").append(toIndentedString(webFetchRequests)).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 MessagesServerToolUsage instance; + + public Builder() { + this(new MessagesServerToolUsage()); + } + + protected Builder(MessagesServerToolUsage instance) { + this.instance = instance; + } + + public MessagesServerToolUsage.Builder webSearchRequests(Integer webSearchRequests) { + this.instance.webSearchRequests = webSearchRequests; + return this; + } + public MessagesServerToolUsage.Builder webFetchRequests(Integer webFetchRequests) { + this.instance.webFetchRequests = webFetchRequests; + return this; + } + + + /** + * returns a built MessagesServerToolUsage instance. + * + * The builder is not reusable. + */ + public MessagesServerToolUsage 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 MessagesServerToolUsage.Builder builder() { + return new MessagesServerToolUsage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesServerToolUsage.Builder toBuilder() { + return new MessagesServerToolUsage.Builder() + .webSearchRequests(getWebSearchRequests()) + .webFetchRequests(getWebFetchRequests()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesServiceStatus.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesServiceStatus.java new file mode 100644 index 0000000..2164777 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesServiceStatus.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesServiceStatus + */ +@JsonPropertyOrder({ + MessagesServiceStatus.JSON_PROPERTY_MODEL_FALLBACK +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesServiceStatus { + public static final String JSON_PROPERTY_MODEL_FALLBACK = "model_fallback"; + @javax.annotation.Nullable + private ModelFallbackStatus modelFallback; + + public MessagesServiceStatus() { + } + + public MessagesServiceStatus modelFallback(@javax.annotation.Nullable ModelFallbackStatus modelFallback) { + + this.modelFallback = modelFallback; + return this; + } + + /** + * Get modelFallback + * @return modelFallback + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MODEL_FALLBACK, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public ModelFallbackStatus getModelFallback() { + return modelFallback; + } + + + @JsonProperty(value = JSON_PROPERTY_MODEL_FALLBACK, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setModelFallback(@javax.annotation.Nullable ModelFallbackStatus modelFallback) { + this.modelFallback = modelFallback; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesServiceStatus messagesServiceStatus = (MessagesServiceStatus) o; + return Objects.equals(this.modelFallback, messagesServiceStatus.modelFallback); + } + + @Override + public int hashCode() { + return Objects.hash(modelFallback); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesServiceStatus {\n"); + sb.append(" modelFallback: ").append(toIndentedString(modelFallback)).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 MessagesServiceStatus instance; + + public Builder() { + this(new MessagesServiceStatus()); + } + + protected Builder(MessagesServiceStatus instance) { + this.instance = instance; + } + + public MessagesServiceStatus.Builder modelFallback(ModelFallbackStatus modelFallback) { + this.instance.modelFallback = modelFallback; + return this; + } + + + /** + * returns a built MessagesServiceStatus instance. + * + * The builder is not reusable. + */ + public MessagesServiceStatus 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 MessagesServiceStatus.Builder builder() { + return new MessagesServiceStatus.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesServiceStatus.Builder toBuilder() { + return new MessagesServiceStatus.Builder() + .modelFallback(getModelFallback()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStopSequences.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStopSequences.java new file mode 100644 index 0000000..807301f --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStopSequences.java @@ -0,0 +1,120 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesStopSequences + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: String, 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 = MessagesStopSequences.Deserializer.class) +public class MessagesStopSequences { + + private final Object value; + + @JsonCreator + public MessagesStopSequences(Object value) { + this.value = value; + } + + public MessagesStopSequences() { + this.value = null; + } + + public static MessagesStopSequences ofString(String value) { + return new MessagesStopSequences(value); + } + + public static MessagesStopSequences ofList(java.util.List value) { + return new MessagesStopSequences(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public MessagesStopSequences deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isTextual()) { + return new MessagesStopSequences(mapper.treeToValue(node, String.class)); + } + if (node.isArray()) { + return new MessagesStopSequences( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + MessagesStopSequences.class, + "no MessagesStopSequences variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MessagesStopSequences other = (MessagesStopSequences) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class MessagesStopSequences {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public MessagesStopSequences build() { return new MessagesStopSequences(this.value); } + } + + public static MessagesStopSequences.Builder builder() { return new MessagesStopSequences.Builder(); } + + public MessagesStopSequences.Builder toBuilder() { + return new MessagesStopSequences.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStreamEvent.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStreamEvent.java new file mode 100644 index 0000000..9cc9e0d --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStreamEvent.java @@ -0,0 +1,36 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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 = MessagesResponseContentBlock.class, name = "content_block_delta"), + @JsonSubTypes.Type(value = ContentBlockStart.class, name = "content_block_start"), + @JsonSubTypes.Type(value = MessagesResponseContentBlockStop.class, name = "content_block_stop"), + @JsonSubTypes.Type(value = MessagesErrorResponse.class, name = "error"), + @JsonSubTypes.Type(value = MessagesResponseStreamMessageDelta.class, name = "message_delta"), + @JsonSubTypes.Type(value = MessagesResponseStreamMessageStart.class, name = "message_start"), + @JsonSubTypes.Type(value = MessagesResponseStreamMessageStop.class, name = "message_stop"), +}) + +public interface MessagesStreamEvent { + public MessagesStreamEventType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStreamEventType.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStreamEventType.java new file mode 100644 index 0000000..ce75e50 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStreamEventType.java @@ -0,0 +1,67 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MessagesStreamEventType + */ +public enum MessagesStreamEventType { + + CONTENT_BLOCK_DELTA("content_block_delta"), + + CONTENT_BLOCK_START("content_block_start"), + + CONTENT_BLOCK_STOP("content_block_stop"), + + ERROR("error"), + + MESSAGE_DELTA("message_delta"), + + MESSAGE_START("message_start"), + + MESSAGE_STOP("message_stop"); + + private String value; + + MessagesStreamEventType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesStreamEventType fromValue(String value) { + for (MessagesStreamEventType b : MessagesStreamEventType.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/messages/MessagesStreamOptions.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStreamOptions.java new file mode 100644 index 0000000..1974d8c --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesStreamOptions.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesStreamOptions + */ +@JsonPropertyOrder({ + MessagesStreamOptions.JSON_PROPERTY_INCLUDE_USAGE, + MessagesStreamOptions.JSON_PROPERTY_CHUNK_INCLUDE_USAGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesStreamOptions { + public static final String JSON_PROPERTY_INCLUDE_USAGE = "include_usage"; + @javax.annotation.Nullable + private Boolean includeUsage; + + public static final String JSON_PROPERTY_CHUNK_INCLUDE_USAGE = "chunk_include_usage"; + @javax.annotation.Nullable + private Boolean chunkIncludeUsage; + + public MessagesStreamOptions() { + } + + public MessagesStreamOptions includeUsage(@javax.annotation.Nullable Boolean includeUsage) { + + this.includeUsage = includeUsage; + return this; + } + + /** + * Whether to include usage in the final stream event. + * @return includeUsage + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INCLUDE_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getIncludeUsage() { + return includeUsage; + } + + + @JsonProperty(value = JSON_PROPERTY_INCLUDE_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeUsage(@javax.annotation.Nullable Boolean includeUsage) { + this.includeUsage = includeUsage; + } + + public MessagesStreamOptions chunkIncludeUsage(@javax.annotation.Nullable Boolean chunkIncludeUsage) { + + this.chunkIncludeUsage = chunkIncludeUsage; + return this; + } + + /** + * Whether to include usage in every stream event. + * @return chunkIncludeUsage + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CHUNK_INCLUDE_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getChunkIncludeUsage() { + return chunkIncludeUsage; + } + + + @JsonProperty(value = JSON_PROPERTY_CHUNK_INCLUDE_USAGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setChunkIncludeUsage(@javax.annotation.Nullable Boolean chunkIncludeUsage) { + this.chunkIncludeUsage = chunkIncludeUsage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesStreamOptions messagesStreamOptions = (MessagesStreamOptions) o; + return Objects.equals(this.includeUsage, messagesStreamOptions.includeUsage) && + Objects.equals(this.chunkIncludeUsage, messagesStreamOptions.chunkIncludeUsage); + } + + @Override + public int hashCode() { + return Objects.hash(includeUsage, chunkIncludeUsage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesStreamOptions {\n"); + sb.append(" includeUsage: ").append(toIndentedString(includeUsage)).append("\n"); + sb.append(" chunkIncludeUsage: ").append(toIndentedString(chunkIncludeUsage)).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 MessagesStreamOptions instance; + + public Builder() { + this(new MessagesStreamOptions()); + } + + protected Builder(MessagesStreamOptions instance) { + this.instance = instance; + } + + public MessagesStreamOptions.Builder includeUsage(Boolean includeUsage) { + this.instance.includeUsage = includeUsage; + return this; + } + public MessagesStreamOptions.Builder chunkIncludeUsage(Boolean chunkIncludeUsage) { + this.instance.chunkIncludeUsage = chunkIncludeUsage; + return this; + } + + + /** + * returns a built MessagesStreamOptions instance. + * + * The builder is not reusable. + */ + public MessagesStreamOptions 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 MessagesStreamOptions.Builder builder() { + return new MessagesStreamOptions.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesStreamOptions.Builder toBuilder() { + return new MessagesStreamOptions.Builder() + .includeUsage(getIncludeUsage()) + .chunkIncludeUsage(getChunkIncludeUsage()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesSystem.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesSystem.java new file mode 100644 index 0000000..300d147 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesSystem.java @@ -0,0 +1,120 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesSystem + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: String, 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 = MessagesSystem.Deserializer.class) +public class MessagesSystem { + + private final Object value; + + @JsonCreator + public MessagesSystem(Object value) { + this.value = value; + } + + public MessagesSystem() { + this.value = null; + } + + public static MessagesSystem ofString(String value) { + return new MessagesSystem(value); + } + + public static MessagesSystem ofList(java.util.List value) { + return new MessagesSystem(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public MessagesSystem deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isTextual()) { + return new MessagesSystem(mapper.treeToValue(node, String.class)); + } + if (node.isArray()) { + return new MessagesSystem( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + MessagesSystem.class, + "no MessagesSystem variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MessagesSystem other = (MessagesSystem) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class MessagesSystem {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public MessagesSystem build() { return new MessagesSystem(this.value); } + } + + public static MessagesSystem.Builder builder() { return new MessagesSystem.Builder(); } + + public MessagesSystem.Builder toBuilder() { + return new MessagesSystem.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesSystemTextPart.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesSystemTextPart.java new file mode 100644 index 0000000..becc9bc --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesSystemTextPart.java @@ -0,0 +1,225 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesSystemTextPart + */ +@JsonPropertyOrder({ + MessagesSystemTextPart.JSON_PROPERTY_TYPE, + MessagesSystemTextPart.JSON_PROPERTY_TEXT +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesSystemTextPart { + /** + * The type of the system content part. Always `text`. + */ + 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; + + public MessagesSystemTextPart() { + } + + public MessagesSystemTextPart type(@javax.annotation.Nonnull TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of the system content part. Always `text`. + * @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 MessagesSystemTextPart text(@javax.annotation.Nonnull String text) { + + this.text = text; + return this; + } + + /** + * Get text + * @return text + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getText() { + return text; + } + + + @JsonProperty(value = JSON_PROPERTY_TEXT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setText(@javax.annotation.Nonnull String text) { + this.text = text; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesSystemTextPart messagesSystemTextPart = (MessagesSystemTextPart) o; + return Objects.equals(this.type, messagesSystemTextPart.type) && + Objects.equals(this.text, messagesSystemTextPart.text); + } + + @Override + public int hashCode() { + return Objects.hash(type, text); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesSystemTextPart {\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 MessagesSystemTextPart instance; + + public Builder() { + this(new MessagesSystemTextPart()); + } + + protected Builder(MessagesSystemTextPart instance) { + this.instance = instance; + } + + public MessagesSystemTextPart.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public MessagesSystemTextPart.Builder text(String text) { + this.instance.text = text; + return this; + } + + + /** + * returns a built MessagesSystemTextPart instance. + * + * The builder is not reusable. + */ + public MessagesSystemTextPart 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 MessagesSystemTextPart.Builder builder() { + return new MessagesSystemTextPart.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesSystemTextPart.Builder toBuilder() { + return new MessagesSystemTextPart.Builder() + .type(getType()) + .text(getText()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesThinking.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesThinking.java new file mode 100644 index 0000000..3a8974f --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesThinking.java @@ -0,0 +1,153 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesThinking + */ +@JsonPropertyOrder({ + MessagesThinking.JSON_PROPERTY_TYPE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesThinking { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private String type; + + public MessagesThinking() { + } + + public MessagesThinking type(@javax.annotation.Nonnull String type) { + + this.type = type; + return this; + } + + /** + * Thinking mode requested from the model. + * @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; + } + MessagesThinking messagesThinking = (MessagesThinking) o; + return Objects.equals(this.type, messagesThinking.type); + } + + @Override + public int hashCode() { + return Objects.hash(type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesThinking {\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 MessagesThinking instance; + + public Builder() { + this(new MessagesThinking()); + } + + protected Builder(MessagesThinking instance) { + this.instance = instance; + } + + public MessagesThinking.Builder type(String type) { + this.instance.type = type; + return this; + } + + + /** + * returns a built MessagesThinking instance. + * + * The builder is not reusable. + */ + public MessagesThinking 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 MessagesThinking.Builder builder() { + return new MessagesThinking.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesThinking.Builder toBuilder() { + return new MessagesThinking.Builder() + .type(getType()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesTool.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesTool.java new file mode 100644 index 0000000..791dbbd --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesTool.java @@ -0,0 +1,477 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * MessagesTool + */ +@JsonPropertyOrder({ + MessagesTool.JSON_PROPERTY_DESCRIPTION, + MessagesTool.JSON_PROPERTY_NAME, + MessagesTool.JSON_PROPERTY_INPUT_SCHEMA, + MessagesTool.JSON_PROPERTY_STRICT, + MessagesTool.JSON_PROPERTY_TYPE, + MessagesTool.JSON_PROPERTY_MAX_USES, + MessagesTool.JSON_PROPERTY_ALLOWED_DOMAINS, + MessagesTool.JSON_PROPERTY_BLOCKED_DOMAINS, + MessagesTool.JSON_PROPERTY_USER_LOCATION +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesTool { + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + @javax.annotation.Nullable + private String description; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public static final String JSON_PROPERTY_INPUT_SCHEMA = "input_schema"; + @javax.annotation.Nullable + private Map inputSchema; + + public static final String JSON_PROPERTY_STRICT = "strict"; + @javax.annotation.Nullable + private Boolean strict; + + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type; + + public static final String JSON_PROPERTY_MAX_USES = "max_uses"; + @javax.annotation.Nullable + private Integer maxUses; + + public static final String JSON_PROPERTY_ALLOWED_DOMAINS = "allowed_domains"; + @javax.annotation.Nullable + private List allowedDomains; + + public static final String JSON_PROPERTY_BLOCKED_DOMAINS = "blocked_domains"; + @javax.annotation.Nullable + private List blockedDomains; + + public static final String JSON_PROPERTY_USER_LOCATION = "user_location"; + @javax.annotation.Nullable + private MessagesToolUserLocation userLocation; + + public MessagesTool() { + } + + public MessagesTool description(@javax.annotation.Nullable String description) { + + this.description = description; + return this; + } + + /** + * A description of what the tool does and when the model should use it. + * @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 MessagesTool name(@javax.annotation.Nonnull String name) { + + this.name = name; + return this; + } + + /** + * The tool name. + * @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 MessagesTool inputSchema(@javax.annotation.Nullable Map inputSchema) { + + this.inputSchema = inputSchema; + return this; + } + + public MessagesTool putInputSchemaItem(String key, Object inputSchemaItem) { + if (this.inputSchema == null) { + this.inputSchema = new HashMap<>(); + } + this.inputSchema.put(key, inputSchemaItem); + return this; + } + + /** + * The tool input, described as a JSON Schema object. + * @return inputSchema + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INPUT_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.NON_EMPTY) + + public Map getInputSchema() { + return inputSchema; + } + + + @JsonProperty(value = JSON_PROPERTY_INPUT_SCHEMA, required = false) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.NON_EMPTY) + public void setInputSchema(@javax.annotation.Nullable Map inputSchema) { + this.inputSchema = inputSchema; + } + + public MessagesTool strict(@javax.annotation.Nullable Boolean strict) { + + this.strict = strict; + return this; + } + + /** + * Whether strict schema adherence is enabled for this tool. + * @return strict + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_STRICT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getStrict() { + return strict; + } + + + @JsonProperty(value = JSON_PROPERTY_STRICT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStrict(@javax.annotation.Nullable Boolean strict) { + this.strict = strict; + } + + public MessagesTool type(@javax.annotation.Nullable String type) { + + this.type = type; + return this; + } + + /** + * A server-managed tool version, such as `web_search_20250305`. + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + public MessagesTool maxUses(@javax.annotation.Nullable Integer maxUses) { + + this.maxUses = maxUses; + return this; + } + + /** + * Maximum number of times a server-managed tool may be dispatched. + * @return maxUses + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_MAX_USES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getMaxUses() { + return maxUses; + } + + + @JsonProperty(value = JSON_PROPERTY_MAX_USES, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMaxUses(@javax.annotation.Nullable Integer maxUses) { + this.maxUses = maxUses; + } + + public MessagesTool allowedDomains(@javax.annotation.Nullable List allowedDomains) { + + this.allowedDomains = allowedDomains; + return this; + } + + public MessagesTool addAllowedDomainsItem(String allowedDomainsItem) { + if (this.allowedDomains == null) { + this.allowedDomains = new ArrayList<>(); + } + this.allowedDomains.add(allowedDomainsItem); + return this; + } + + /** + * Domains that a server-managed web tool is allowed to access. + * @return allowedDomains + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ALLOWED_DOMAINS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + + public List getAllowedDomains() { + return allowedDomains; + } + + + @JsonProperty(value = JSON_PROPERTY_ALLOWED_DOMAINS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + public void setAllowedDomains(@javax.annotation.Nullable List allowedDomains) { + this.allowedDomains = allowedDomains; + } + + public MessagesTool blockedDomains(@javax.annotation.Nullable List blockedDomains) { + + this.blockedDomains = blockedDomains; + return this; + } + + public MessagesTool addBlockedDomainsItem(String blockedDomainsItem) { + if (this.blockedDomains == null) { + this.blockedDomains = new ArrayList<>(); + } + this.blockedDomains.add(blockedDomainsItem); + return this; + } + + /** + * Domains that a server-managed web tool must not access. + * @return blockedDomains + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_BLOCKED_DOMAINS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + + public List getBlockedDomains() { + return blockedDomains; + } + + + @JsonProperty(value = JSON_PROPERTY_BLOCKED_DOMAINS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + public void setBlockedDomains(@javax.annotation.Nullable List blockedDomains) { + this.blockedDomains = blockedDomains; + } + + public MessagesTool userLocation(@javax.annotation.Nullable MessagesToolUserLocation userLocation) { + + this.userLocation = userLocation; + return this; + } + + /** + * Optional user location supplied to a server-managed web tool. + * @return userLocation + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_USER_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesToolUserLocation getUserLocation() { + return userLocation; + } + + + @JsonProperty(value = JSON_PROPERTY_USER_LOCATION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserLocation(@javax.annotation.Nullable MessagesToolUserLocation userLocation) { + this.userLocation = userLocation; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesTool messagesTool = (MessagesTool) o; + return Objects.equals(this.description, messagesTool.description) && + Objects.equals(this.name, messagesTool.name) && + Objects.equals(this.inputSchema, messagesTool.inputSchema) && + Objects.equals(this.strict, messagesTool.strict) && + Objects.equals(this.type, messagesTool.type) && + Objects.equals(this.maxUses, messagesTool.maxUses) && + Objects.equals(this.allowedDomains, messagesTool.allowedDomains) && + Objects.equals(this.blockedDomains, messagesTool.blockedDomains) && + Objects.equals(this.userLocation, messagesTool.userLocation); + } + + @Override + public int hashCode() { + return Objects.hash(description, name, inputSchema, strict, type, maxUses, allowedDomains, blockedDomains, userLocation); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesTool {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" inputSchema: ").append(toIndentedString(inputSchema)).append("\n"); + sb.append(" strict: ").append(toIndentedString(strict)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" maxUses: ").append(toIndentedString(maxUses)).append("\n"); + sb.append(" allowedDomains: ").append(toIndentedString(allowedDomains)).append("\n"); + sb.append(" blockedDomains: ").append(toIndentedString(blockedDomains)).append("\n"); + sb.append(" userLocation: ").append(toIndentedString(userLocation)).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 MessagesTool instance; + + public Builder() { + this(new MessagesTool()); + } + + protected Builder(MessagesTool instance) { + this.instance = instance; + } + + public MessagesTool.Builder description(String description) { + this.instance.description = description; + return this; + } + public MessagesTool.Builder name(String name) { + this.instance.name = name; + return this; + } + public MessagesTool.Builder inputSchema(Map inputSchema) { + this.instance.inputSchema = inputSchema; + return this; + } + public MessagesTool.Builder strict(Boolean strict) { + this.instance.strict = strict; + return this; + } + public MessagesTool.Builder type(String type) { + this.instance.type = type; + return this; + } + public MessagesTool.Builder maxUses(Integer maxUses) { + this.instance.maxUses = maxUses; + return this; + } + public MessagesTool.Builder allowedDomains(List allowedDomains) { + this.instance.allowedDomains = allowedDomains; + return this; + } + public MessagesTool.Builder blockedDomains(List blockedDomains) { + this.instance.blockedDomains = blockedDomains; + return this; + } + public MessagesTool.Builder userLocation(MessagesToolUserLocation userLocation) { + this.instance.userLocation = userLocation; + return this; + } + + + /** + * returns a built MessagesTool instance. + * + * The builder is not reusable. + */ + public MessagesTool 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 MessagesTool.Builder builder() { + return new MessagesTool.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesTool.Builder toBuilder() { + return new MessagesTool.Builder() + .description(getDescription()) + .name(getName()) + .inputSchema(getInputSchema()) + .strict(getStrict()) + .type(getType()) + .maxUses(getMaxUses()) + .allowedDomains(getAllowedDomains()) + .blockedDomains(getBlockedDomains()) + .userLocation(getUserLocation()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoice.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoice.java new file mode 100644 index 0000000..512b57f --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoice.java @@ -0,0 +1,33 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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 = MessagesToolChoiceAny.class, name = "any"), + @JsonSubTypes.Type(value = MessagesToolChoiceAuto.class, name = "auto"), + @JsonSubTypes.Type(value = MessagesToolChoiceNone.class, name = "none"), + @JsonSubTypes.Type(value = MessagesToolChoiceTool.class, name = "tool"), +}) + +public interface MessagesToolChoice { + public MessagesToolChoiceType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceAny.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceAny.java new file mode 100644 index 0000000..5b929ec --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceAny.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesToolChoiceAny + */ +@JsonPropertyOrder({ + MessagesToolChoiceAny.JSON_PROPERTY_TYPE, + MessagesToolChoiceAny.JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesToolChoiceAny implements MessagesToolChoice { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesToolChoiceType type = MessagesToolChoiceType.ANY; + + public static final String JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE = "disable_parallel_tool_use"; + @javax.annotation.Nullable + private Boolean disableParallelToolUse; + + public MessagesToolChoiceAny() { + } + + public MessagesToolChoiceAny type(@javax.annotation.Nonnull MessagesToolChoiceType 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 MessagesToolChoiceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesToolChoiceType type) { + this.type = type; + } + + public MessagesToolChoiceAny disableParallelToolUse(@javax.annotation.Nullable Boolean disableParallelToolUse) { + + this.disableParallelToolUse = disableParallelToolUse; + return this; + } + + /** + * Get disableParallelToolUse + * @return disableParallelToolUse + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDisableParallelToolUse() { + return disableParallelToolUse; + } + + + @JsonProperty(value = JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableParallelToolUse(@javax.annotation.Nullable Boolean disableParallelToolUse) { + this.disableParallelToolUse = disableParallelToolUse; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesToolChoiceAny messagesToolChoiceAny = (MessagesToolChoiceAny) o; + return Objects.equals(this.type, messagesToolChoiceAny.type) && + Objects.equals(this.disableParallelToolUse, messagesToolChoiceAny.disableParallelToolUse); + } + + @Override + public int hashCode() { + return Objects.hash(type, disableParallelToolUse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesToolChoiceAny {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" disableParallelToolUse: ").append(toIndentedString(disableParallelToolUse)).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 MessagesToolChoiceAny instance; + + public Builder() { + this(new MessagesToolChoiceAny()); + } + + protected Builder(MessagesToolChoiceAny instance) { + this.instance = instance; + } + + public MessagesToolChoiceAny.Builder type(MessagesToolChoiceType type) { + this.instance.type = type; + return this; + } + public MessagesToolChoiceAny.Builder disableParallelToolUse(Boolean disableParallelToolUse) { + this.instance.disableParallelToolUse = disableParallelToolUse; + return this; + } + + + /** + * returns a built MessagesToolChoiceAny instance. + * + * The builder is not reusable. + */ + public MessagesToolChoiceAny 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 MessagesToolChoiceAny.Builder builder() { + return new MessagesToolChoiceAny.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesToolChoiceAny.Builder toBuilder() { + return new MessagesToolChoiceAny.Builder() + .type(getType()) + .disableParallelToolUse(getDisableParallelToolUse()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceAuto.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceAuto.java new file mode 100644 index 0000000..8d87c6d --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceAuto.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesToolChoiceAuto + */ +@JsonPropertyOrder({ + MessagesToolChoiceAuto.JSON_PROPERTY_TYPE, + MessagesToolChoiceAuto.JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesToolChoiceAuto implements MessagesToolChoice { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesToolChoiceType type = MessagesToolChoiceType.AUTO; + + public static final String JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE = "disable_parallel_tool_use"; + @javax.annotation.Nullable + private Boolean disableParallelToolUse; + + public MessagesToolChoiceAuto() { + } + + public MessagesToolChoiceAuto type(@javax.annotation.Nonnull MessagesToolChoiceType 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 MessagesToolChoiceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesToolChoiceType type) { + this.type = type; + } + + public MessagesToolChoiceAuto disableParallelToolUse(@javax.annotation.Nullable Boolean disableParallelToolUse) { + + this.disableParallelToolUse = disableParallelToolUse; + return this; + } + + /** + * Get disableParallelToolUse + * @return disableParallelToolUse + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDisableParallelToolUse() { + return disableParallelToolUse; + } + + + @JsonProperty(value = JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableParallelToolUse(@javax.annotation.Nullable Boolean disableParallelToolUse) { + this.disableParallelToolUse = disableParallelToolUse; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesToolChoiceAuto messagesToolChoiceAuto = (MessagesToolChoiceAuto) o; + return Objects.equals(this.type, messagesToolChoiceAuto.type) && + Objects.equals(this.disableParallelToolUse, messagesToolChoiceAuto.disableParallelToolUse); + } + + @Override + public int hashCode() { + return Objects.hash(type, disableParallelToolUse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesToolChoiceAuto {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" disableParallelToolUse: ").append(toIndentedString(disableParallelToolUse)).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 MessagesToolChoiceAuto instance; + + public Builder() { + this(new MessagesToolChoiceAuto()); + } + + protected Builder(MessagesToolChoiceAuto instance) { + this.instance = instance; + } + + public MessagesToolChoiceAuto.Builder type(MessagesToolChoiceType type) { + this.instance.type = type; + return this; + } + public MessagesToolChoiceAuto.Builder disableParallelToolUse(Boolean disableParallelToolUse) { + this.instance.disableParallelToolUse = disableParallelToolUse; + return this; + } + + + /** + * returns a built MessagesToolChoiceAuto instance. + * + * The builder is not reusable. + */ + public MessagesToolChoiceAuto 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 MessagesToolChoiceAuto.Builder builder() { + return new MessagesToolChoiceAuto.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesToolChoiceAuto.Builder toBuilder() { + return new MessagesToolChoiceAuto.Builder() + .type(getType()) + .disableParallelToolUse(getDisableParallelToolUse()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceNone.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceNone.java new file mode 100644 index 0000000..d9868a6 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceNone.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesToolChoiceNone + */ +@JsonPropertyOrder({ + MessagesToolChoiceNone.JSON_PROPERTY_TYPE, + MessagesToolChoiceNone.JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesToolChoiceNone implements MessagesToolChoice { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesToolChoiceType type = MessagesToolChoiceType.NONE; + + public static final String JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE = "disable_parallel_tool_use"; + @javax.annotation.Nullable + private Boolean disableParallelToolUse; + + public MessagesToolChoiceNone() { + } + + public MessagesToolChoiceNone type(@javax.annotation.Nonnull MessagesToolChoiceType 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 MessagesToolChoiceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesToolChoiceType type) { + this.type = type; + } + + public MessagesToolChoiceNone disableParallelToolUse(@javax.annotation.Nullable Boolean disableParallelToolUse) { + + this.disableParallelToolUse = disableParallelToolUse; + return this; + } + + /** + * Get disableParallelToolUse + * @return disableParallelToolUse + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDisableParallelToolUse() { + return disableParallelToolUse; + } + + + @JsonProperty(value = JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableParallelToolUse(@javax.annotation.Nullable Boolean disableParallelToolUse) { + this.disableParallelToolUse = disableParallelToolUse; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesToolChoiceNone messagesToolChoiceNone = (MessagesToolChoiceNone) o; + return Objects.equals(this.type, messagesToolChoiceNone.type) && + Objects.equals(this.disableParallelToolUse, messagesToolChoiceNone.disableParallelToolUse); + } + + @Override + public int hashCode() { + return Objects.hash(type, disableParallelToolUse); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesToolChoiceNone {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" disableParallelToolUse: ").append(toIndentedString(disableParallelToolUse)).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 MessagesToolChoiceNone instance; + + public Builder() { + this(new MessagesToolChoiceNone()); + } + + protected Builder(MessagesToolChoiceNone instance) { + this.instance = instance; + } + + public MessagesToolChoiceNone.Builder type(MessagesToolChoiceType type) { + this.instance.type = type; + return this; + } + public MessagesToolChoiceNone.Builder disableParallelToolUse(Boolean disableParallelToolUse) { + this.instance.disableParallelToolUse = disableParallelToolUse; + return this; + } + + + /** + * returns a built MessagesToolChoiceNone instance. + * + * The builder is not reusable. + */ + public MessagesToolChoiceNone 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 MessagesToolChoiceNone.Builder builder() { + return new MessagesToolChoiceNone.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesToolChoiceNone.Builder toBuilder() { + return new MessagesToolChoiceNone.Builder() + .type(getType()) + .disableParallelToolUse(getDisableParallelToolUse()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceTool.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceTool.java new file mode 100644 index 0000000..19d04bb --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceTool.java @@ -0,0 +1,227 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesToolChoiceTool + */ +@JsonPropertyOrder({ + MessagesToolChoiceTool.JSON_PROPERTY_TYPE, + MessagesToolChoiceTool.JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE, + MessagesToolChoiceTool.JSON_PROPERTY_NAME +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesToolChoiceTool implements MessagesToolChoice { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nonnull + private MessagesToolChoiceType type = MessagesToolChoiceType.TOOL; + + public static final String JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE = "disable_parallel_tool_use"; + @javax.annotation.Nullable + private Boolean disableParallelToolUse; + + public static final String JSON_PROPERTY_NAME = "name"; + @javax.annotation.Nonnull + private String name; + + public MessagesToolChoiceTool() { + } + + public MessagesToolChoiceTool type(@javax.annotation.Nonnull MessagesToolChoiceType 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 MessagesToolChoiceType getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setType(@javax.annotation.Nonnull MessagesToolChoiceType type) { + this.type = type; + } + + public MessagesToolChoiceTool disableParallelToolUse(@javax.annotation.Nullable Boolean disableParallelToolUse) { + + this.disableParallelToolUse = disableParallelToolUse; + return this; + } + + /** + * Get disableParallelToolUse + * @return disableParallelToolUse + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Boolean getDisableParallelToolUse() { + return disableParallelToolUse; + } + + + @JsonProperty(value = JSON_PROPERTY_DISABLE_PARALLEL_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisableParallelToolUse(@javax.annotation.Nullable Boolean disableParallelToolUse) { + this.disableParallelToolUse = disableParallelToolUse; + } + + public MessagesToolChoiceTool name(@javax.annotation.Nonnull String name) { + + this.name = name; + return this; + } + + /** + * The name of the tool the model must invoke. + * @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; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesToolChoiceTool messagesToolChoiceTool = (MessagesToolChoiceTool) o; + return Objects.equals(this.type, messagesToolChoiceTool.type) && + Objects.equals(this.disableParallelToolUse, messagesToolChoiceTool.disableParallelToolUse) && + Objects.equals(this.name, messagesToolChoiceTool.name); + } + + @Override + public int hashCode() { + return Objects.hash(type, disableParallelToolUse, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesToolChoiceTool {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" disableParallelToolUse: ").append(toIndentedString(disableParallelToolUse)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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 MessagesToolChoiceTool instance; + + public Builder() { + this(new MessagesToolChoiceTool()); + } + + protected Builder(MessagesToolChoiceTool instance) { + this.instance = instance; + } + + public MessagesToolChoiceTool.Builder type(MessagesToolChoiceType type) { + this.instance.type = type; + return this; + } + public MessagesToolChoiceTool.Builder disableParallelToolUse(Boolean disableParallelToolUse) { + this.instance.disableParallelToolUse = disableParallelToolUse; + return this; + } + public MessagesToolChoiceTool.Builder name(String name) { + this.instance.name = name; + return this; + } + + + /** + * returns a built MessagesToolChoiceTool instance. + * + * The builder is not reusable. + */ + public MessagesToolChoiceTool 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 MessagesToolChoiceTool.Builder builder() { + return new MessagesToolChoiceTool.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesToolChoiceTool.Builder toBuilder() { + return new MessagesToolChoiceTool.Builder() + .type(getType()) + .disableParallelToolUse(getDisableParallelToolUse()) + .name(getName()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceType.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceType.java new file mode 100644 index 0000000..1f9ccd9 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolChoiceType.java @@ -0,0 +1,61 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets MessagesToolChoiceType + */ +public enum MessagesToolChoiceType { + + ANY("any"), + + AUTO("auto"), + + NONE("none"), + + TOOL("tool"); + + private String value; + + MessagesToolChoiceType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static MessagesToolChoiceType fromValue(String value) { + for (MessagesToolChoiceType b : MessagesToolChoiceType.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/messages/MessagesToolResultContent.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolResultContent.java new file mode 100644 index 0000000..f0f930c --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolResultContent.java @@ -0,0 +1,120 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesToolResultContent + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: String, 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 = MessagesToolResultContent.Deserializer.class) +public class MessagesToolResultContent { + + private final Object value; + + @JsonCreator + public MessagesToolResultContent(Object value) { + this.value = value; + } + + public MessagesToolResultContent() { + this.value = null; + } + + public static MessagesToolResultContent ofString(String value) { + return new MessagesToolResultContent(value); + } + + public static MessagesToolResultContent ofList(java.util.List value) { + return new MessagesToolResultContent(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public MessagesToolResultContent deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isTextual()) { + return new MessagesToolResultContent(mapper.treeToValue(node, String.class)); + } + if (node.isArray()) { + return new MessagesToolResultContent( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + MessagesToolResultContent.class, + "no MessagesToolResultContent variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MessagesToolResultContent other = (MessagesToolResultContent) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class MessagesToolResultContent {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public MessagesToolResultContent build() { return new MessagesToolResultContent(this.value); } + } + + public static MessagesToolResultContent.Builder builder() { return new MessagesToolResultContent.Builder(); } + + public MessagesToolResultContent.Builder toBuilder() { + return new MessagesToolResultContent.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolResultContentPart.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolResultContentPart.java new file mode 100644 index 0000000..37655ea --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolResultContentPart.java @@ -0,0 +1,32 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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 = MessagesContentPartImage.class, name = "image"), + @JsonSubTypes.Type(value = MessagesContentPartText.class, name = "text"), + @JsonSubTypes.Type(value = MessagesContentPartToolReference.class, name = "tool_reference"), +}) + +public interface MessagesToolResultContentPart { + public ContentPartType getType(); +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolUserLocation.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolUserLocation.java new file mode 100644 index 0000000..bfea511 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesToolUserLocation.java @@ -0,0 +1,301 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * MessagesToolUserLocation + */ +@JsonPropertyOrder({ + MessagesToolUserLocation.JSON_PROPERTY_TYPE, + MessagesToolUserLocation.JSON_PROPERTY_CITY, + MessagesToolUserLocation.JSON_PROPERTY_REGION, + MessagesToolUserLocation.JSON_PROPERTY_COUNTRY, + MessagesToolUserLocation.JSON_PROPERTY_TIMEZONE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesToolUserLocation { + public static final String JSON_PROPERTY_TYPE = "type"; + @javax.annotation.Nullable + private String type; + + public static final String JSON_PROPERTY_CITY = "city"; + @javax.annotation.Nullable + private String city; + + public static final String JSON_PROPERTY_REGION = "region"; + @javax.annotation.Nullable + private String region; + + public static final String JSON_PROPERTY_COUNTRY = "country"; + @javax.annotation.Nullable + private String country; + + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; + @javax.annotation.Nullable + private String timezone; + + public MessagesToolUserLocation() { + } + + public MessagesToolUserLocation type(@javax.annotation.Nullable String type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getType() { + return type; + } + + + @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + public MessagesToolUserLocation city(@javax.annotation.Nullable String city) { + + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CITY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCity() { + return city; + } + + + @JsonProperty(value = JSON_PROPERTY_CITY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + public MessagesToolUserLocation region(@javax.annotation.Nullable String region) { + + this.region = region; + return this; + } + + /** + * Get region + * @return region + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_REGION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRegion() { + return region; + } + + + @JsonProperty(value = JSON_PROPERTY_REGION, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRegion(@javax.annotation.Nullable String region) { + this.region = region; + } + + public MessagesToolUserLocation country(@javax.annotation.Nullable String country) { + + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_COUNTRY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getCountry() { + return country; + } + + + @JsonProperty(value = JSON_PROPERTY_COUNTRY, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountry(@javax.annotation.Nullable String country) { + this.country = country; + } + + public MessagesToolUserLocation timezone(@javax.annotation.Nullable String timezone) { + + this.timezone = timezone; + return this; + } + + /** + * Get timezone + * @return timezone + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getTimezone() { + return timezone; + } + + + @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTimezone(@javax.annotation.Nullable String timezone) { + this.timezone = timezone; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesToolUserLocation messagesToolUserLocation = (MessagesToolUserLocation) o; + return Objects.equals(this.type, messagesToolUserLocation.type) && + Objects.equals(this.city, messagesToolUserLocation.city) && + Objects.equals(this.region, messagesToolUserLocation.region) && + Objects.equals(this.country, messagesToolUserLocation.country) && + Objects.equals(this.timezone, messagesToolUserLocation.timezone); + } + + @Override + public int hashCode() { + return Objects.hash(type, city, region, country, timezone); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesToolUserLocation {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).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 MessagesToolUserLocation instance; + + public Builder() { + this(new MessagesToolUserLocation()); + } + + protected Builder(MessagesToolUserLocation instance) { + this.instance = instance; + } + + public MessagesToolUserLocation.Builder type(String type) { + this.instance.type = type; + return this; + } + public MessagesToolUserLocation.Builder city(String city) { + this.instance.city = city; + return this; + } + public MessagesToolUserLocation.Builder region(String region) { + this.instance.region = region; + return this; + } + public MessagesToolUserLocation.Builder country(String country) { + this.instance.country = country; + return this; + } + public MessagesToolUserLocation.Builder timezone(String timezone) { + this.instance.timezone = timezone; + return this; + } + + + /** + * returns a built MessagesToolUserLocation instance. + * + * The builder is not reusable. + */ + public MessagesToolUserLocation 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 MessagesToolUserLocation.Builder builder() { + return new MessagesToolUserLocation.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesToolUserLocation.Builder toBuilder() { + return new MessagesToolUserLocation.Builder() + .type(getType()) + .city(getCity()) + .region(getRegion()) + .country(getCountry()) + .timezone(getTimezone()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesUsage.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesUsage.java new file mode 100644 index 0000000..c8ceafb --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesUsage.java @@ -0,0 +1,311 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * Usage statistics for the Messages API. + */ +@JsonPropertyOrder({ + MessagesUsage.JSON_PROPERTY_INPUT_TOKENS, + MessagesUsage.JSON_PROPERTY_OUTPUT_TOKENS, + MessagesUsage.JSON_PROPERTY_CACHE_READ_INPUT_TOKENS, + MessagesUsage.JSON_PROPERTY_SERVER_TOOL_USE, + MessagesUsage.JSON_PROPERTY_ITERATIONS +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesUsage { + public static final String JSON_PROPERTY_INPUT_TOKENS = "input_tokens"; + @javax.annotation.Nullable + private Integer inputTokens; + + public static final String JSON_PROPERTY_OUTPUT_TOKENS = "output_tokens"; + @javax.annotation.Nullable + private Integer outputTokens; + + public static final String JSON_PROPERTY_CACHE_READ_INPUT_TOKENS = "cache_read_input_tokens"; + @javax.annotation.Nullable + private Integer cacheReadInputTokens; + + public static final String JSON_PROPERTY_SERVER_TOOL_USE = "server_tool_use"; + @javax.annotation.Nullable + private MessagesServerToolUsage serverToolUse; + + public static final String JSON_PROPERTY_ITERATIONS = "iterations"; + @javax.annotation.Nullable + private List iterations; + + public MessagesUsage() { + } + + public MessagesUsage inputTokens(@javax.annotation.Nullable Integer inputTokens) { + + this.inputTokens = inputTokens; + return this; + } + + /** + * Number of tokens in the prompt. + * @return inputTokens + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_INPUT_TOKENS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getInputTokens() { + return inputTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_INPUT_TOKENS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInputTokens(@javax.annotation.Nullable Integer inputTokens) { + this.inputTokens = inputTokens; + } + + public MessagesUsage outputTokens(@javax.annotation.Nullable Integer outputTokens) { + + this.outputTokens = outputTokens; + return this; + } + + /** + * Number of tokens in the generated completion. + * @return outputTokens + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_OUTPUT_TOKENS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getOutputTokens() { + return outputTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_OUTPUT_TOKENS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutputTokens(@javax.annotation.Nullable Integer outputTokens) { + this.outputTokens = outputTokens; + } + + public MessagesUsage cacheReadInputTokens(@javax.annotation.Nullable Integer cacheReadInputTokens) { + + this.cacheReadInputTokens = cacheReadInputTokens; + return this; + } + + /** + * Number of prompt tokens read from the prefill cache. + * @return cacheReadInputTokens + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_CACHE_READ_INPUT_TOKENS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public Integer getCacheReadInputTokens() { + return cacheReadInputTokens; + } + + + @JsonProperty(value = JSON_PROPERTY_CACHE_READ_INPUT_TOKENS, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCacheReadInputTokens(@javax.annotation.Nullable Integer cacheReadInputTokens) { + this.cacheReadInputTokens = cacheReadInputTokens; + } + + public MessagesUsage serverToolUse(@javax.annotation.Nullable MessagesServerToolUsage serverToolUse) { + + this.serverToolUse = serverToolUse; + return this; + } + + /** + * Counts of requests dispatched by server-managed tools. + * @return serverToolUse + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_SERVER_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public MessagesServerToolUsage getServerToolUse() { + return serverToolUse; + } + + + @JsonProperty(value = JSON_PROPERTY_SERVER_TOOL_USE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setServerToolUse(@javax.annotation.Nullable MessagesServerToolUsage serverToolUse) { + this.serverToolUse = serverToolUse; + } + + public MessagesUsage iterations(@javax.annotation.Nullable List iterations) { + + this.iterations = iterations; + return this; + } + + public MessagesUsage addIterationsItem(MessagesIterationUsage iterationsItem) { + if (this.iterations == null) { + this.iterations = new ArrayList<>(); + } + this.iterations.add(iterationsItem); + return this; + } + + /** + * One token-usage record for each model iteration. + * @return iterations + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_ITERATIONS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + + public List getIterations() { + return iterations; + } + + + @JsonProperty(value = JSON_PROPERTY_ITERATIONS, required = false) + @JsonInclude(value = JsonInclude.Include.NON_EMPTY) + public void setIterations(@javax.annotation.Nullable List iterations) { + this.iterations = iterations; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesUsage messagesUsage = (MessagesUsage) o; + return Objects.equals(this.inputTokens, messagesUsage.inputTokens) && + Objects.equals(this.outputTokens, messagesUsage.outputTokens) && + Objects.equals(this.cacheReadInputTokens, messagesUsage.cacheReadInputTokens) && + Objects.equals(this.serverToolUse, messagesUsage.serverToolUse) && + Objects.equals(this.iterations, messagesUsage.iterations); + } + + @Override + public int hashCode() { + return Objects.hash(inputTokens, outputTokens, cacheReadInputTokens, serverToolUse, iterations); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesUsage {\n"); + sb.append(" inputTokens: ").append(toIndentedString(inputTokens)).append("\n"); + sb.append(" outputTokens: ").append(toIndentedString(outputTokens)).append("\n"); + sb.append(" cacheReadInputTokens: ").append(toIndentedString(cacheReadInputTokens)).append("\n"); + sb.append(" serverToolUse: ").append(toIndentedString(serverToolUse)).append("\n"); + sb.append(" iterations: ").append(toIndentedString(iterations)).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 MessagesUsage instance; + + public Builder() { + this(new MessagesUsage()); + } + + protected Builder(MessagesUsage instance) { + this.instance = instance; + } + + public MessagesUsage.Builder inputTokens(Integer inputTokens) { + this.instance.inputTokens = inputTokens; + return this; + } + public MessagesUsage.Builder outputTokens(Integer outputTokens) { + this.instance.outputTokens = outputTokens; + return this; + } + public MessagesUsage.Builder cacheReadInputTokens(Integer cacheReadInputTokens) { + this.instance.cacheReadInputTokens = cacheReadInputTokens; + return this; + } + public MessagesUsage.Builder serverToolUse(MessagesServerToolUsage serverToolUse) { + this.instance.serverToolUse = serverToolUse; + return this; + } + public MessagesUsage.Builder iterations(List iterations) { + this.instance.iterations = iterations; + return this; + } + + + /** + * returns a built MessagesUsage instance. + * + * The builder is not reusable. + */ + public MessagesUsage 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 MessagesUsage.Builder builder() { + return new MessagesUsage.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesUsage.Builder toBuilder() { + return new MessagesUsage.Builder() + .inputTokens(getInputTokens()) + .outputTokens(getOutputTokens()) + .cacheReadInputTokens(getCacheReadInputTokens()) + .serverToolUse(getServerToolUse()) + .iterations(getIterations()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesWebSearchResult.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesWebSearchResult.java new file mode 100644 index 0000000..bed2524 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesWebSearchResult.java @@ -0,0 +1,336 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesWebSearchResult + */ +@JsonPropertyOrder({ + MessagesWebSearchResult.JSON_PROPERTY_TYPE, + MessagesWebSearchResult.JSON_PROPERTY_TITLE, + MessagesWebSearchResult.JSON_PROPERTY_URL, + MessagesWebSearchResult.JSON_PROPERTY_ENCRYPTED_CONTENT, + MessagesWebSearchResult.JSON_PROPERTY_PAGE_AGE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesWebSearchResult { + /** + * The type of the result. Always `web_search_result`. + */ + public enum TypeEnum { + WEB_SEARCH_RESULT(String.valueOf("web_search_result")); + + 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_TITLE = "title"; + @javax.annotation.Nonnull + private String title; + + public static final String JSON_PROPERTY_URL = "url"; + @javax.annotation.Nonnull + private String url; + + public static final String JSON_PROPERTY_ENCRYPTED_CONTENT = "encrypted_content"; + @javax.annotation.Nonnull + private String encryptedContent; + + public static final String JSON_PROPERTY_PAGE_AGE = "page_age"; + @javax.annotation.Nullable + private String pageAge; + + public MessagesWebSearchResult() { + } + + public MessagesWebSearchResult type(@javax.annotation.Nonnull TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of the result. Always `web_search_result`. + * @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 MessagesWebSearchResult title(@javax.annotation.Nonnull String title) { + + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_TITLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTitle() { + return title; + } + + + @JsonProperty(value = JSON_PROPERTY_TITLE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTitle(@javax.annotation.Nonnull String title) { + this.title = title; + } + + public MessagesWebSearchResult url(@javax.annotation.Nonnull String url) { + + this.url = url; + return this; + } + + /** + * Get 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 MessagesWebSearchResult encryptedContent(@javax.annotation.Nonnull String encryptedContent) { + + this.encryptedContent = encryptedContent; + return this; + } + + /** + * Get encryptedContent + * @return encryptedContent + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ENCRYPTED_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getEncryptedContent() { + return encryptedContent; + } + + + @JsonProperty(value = JSON_PROPERTY_ENCRYPTED_CONTENT, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEncryptedContent(@javax.annotation.Nonnull String encryptedContent) { + this.encryptedContent = encryptedContent; + } + + public MessagesWebSearchResult pageAge(@javax.annotation.Nullable String pageAge) { + + this.pageAge = pageAge; + return this; + } + + /** + * Get pageAge + * @return pageAge + */ + @javax.annotation.Nullable + @JsonProperty(value = JSON_PROPERTY_PAGE_AGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPageAge() { + return pageAge; + } + + + @JsonProperty(value = JSON_PROPERTY_PAGE_AGE, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPageAge(@javax.annotation.Nullable String pageAge) { + this.pageAge = pageAge; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesWebSearchResult messagesWebSearchResult = (MessagesWebSearchResult) o; + return Objects.equals(this.type, messagesWebSearchResult.type) && + Objects.equals(this.title, messagesWebSearchResult.title) && + Objects.equals(this.url, messagesWebSearchResult.url) && + Objects.equals(this.encryptedContent, messagesWebSearchResult.encryptedContent) && + Objects.equals(this.pageAge, messagesWebSearchResult.pageAge); + } + + @Override + public int hashCode() { + return Objects.hash(type, title, url, encryptedContent, pageAge); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesWebSearchResult {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" encryptedContent: ").append(toIndentedString(encryptedContent)).append("\n"); + sb.append(" pageAge: ").append(toIndentedString(pageAge)).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 MessagesWebSearchResult instance; + + public Builder() { + this(new MessagesWebSearchResult()); + } + + protected Builder(MessagesWebSearchResult instance) { + this.instance = instance; + } + + public MessagesWebSearchResult.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public MessagesWebSearchResult.Builder title(String title) { + this.instance.title = title; + return this; + } + public MessagesWebSearchResult.Builder url(String url) { + this.instance.url = url; + return this; + } + public MessagesWebSearchResult.Builder encryptedContent(String encryptedContent) { + this.instance.encryptedContent = encryptedContent; + return this; + } + public MessagesWebSearchResult.Builder pageAge(String pageAge) { + this.instance.pageAge = pageAge; + return this; + } + + + /** + * returns a built MessagesWebSearchResult instance. + * + * The builder is not reusable. + */ + public MessagesWebSearchResult 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 MessagesWebSearchResult.Builder builder() { + return new MessagesWebSearchResult.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesWebSearchResult.Builder toBuilder() { + return new MessagesWebSearchResult.Builder() + .type(getType()) + .title(getTitle()) + .url(getUrl()) + .encryptedContent(getEncryptedContent()) + .pageAge(getPageAge()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesWebSearchToolResultContent.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesWebSearchToolResultContent.java new file mode 100644 index 0000000..c863f59 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesWebSearchToolResultContent.java @@ -0,0 +1,120 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesWebSearchToolResultContent + * + * Naked-union holder generated by gen/java/postprocess.py from the openapi + * anyOf schema (variants: java.util.List, MessagesWebSearchToolResultError). + * + * 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 = MessagesWebSearchToolResultContent.Deserializer.class) +public class MessagesWebSearchToolResultContent { + + private final Object value; + + @JsonCreator + public MessagesWebSearchToolResultContent(Object value) { + this.value = value; + } + + public MessagesWebSearchToolResultContent() { + this.value = null; + } + + public static MessagesWebSearchToolResultContent ofList(java.util.List value) { + return new MessagesWebSearchToolResultContent(value); + } + + public static MessagesWebSearchToolResultContent ofMessagesWebSearchToolResultError(MessagesWebSearchToolResultError value) { + return new MessagesWebSearchToolResultContent(value); + } + + @JsonValue + public Object getValue() { + return this.value; + } + + public static class Deserializer extends JsonDeserializer { + @Override + public MessagesWebSearchToolResultContent deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { + ObjectMapper mapper = (ObjectMapper) p.getCodec(); + JsonNode node = mapper.readTree(p); + if (node.isArray()) { + return new MessagesWebSearchToolResultContent( + mapper.convertValue(node, new com.fasterxml.jackson.core.type.TypeReference>() {})); + } + if (node.isObject()) { + return new MessagesWebSearchToolResultContent(mapper.treeToValue(node, MessagesWebSearchToolResultError.class)); + } + throw ctxt.weirdStringException( + node == null ? "null" : node.toString(), + MessagesWebSearchToolResultContent.class, + "no MessagesWebSearchToolResultContent variant matched JSON node shape"); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + MessagesWebSearchToolResultContent other = (MessagesWebSearchToolResultContent) o; + return Objects.equals(this.value, other.value); + } + + @Override + public int hashCode() { + return Objects.hash(this.value); + } + + @Override + public String toString() { + return "class MessagesWebSearchToolResultContent {" + Objects.toString(value) + "}"; + } + + public static class Builder { + private Object value; + public Builder() {} + public Builder value(Object value) { this.value = value; return this; } + public MessagesWebSearchToolResultContent build() { return new MessagesWebSearchToolResultContent(this.value); } + } + + public static MessagesWebSearchToolResultContent.Builder builder() { return new MessagesWebSearchToolResultContent.Builder(); } + + public MessagesWebSearchToolResultContent.Builder toBuilder() { + return new MessagesWebSearchToolResultContent.Builder().value(this.value); + } +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesWebSearchToolResultError.java b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesWebSearchToolResultError.java new file mode 100644 index 0000000..4cc0c02 --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/MessagesWebSearchToolResultError.java @@ -0,0 +1,225 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +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; + +/** + * MessagesWebSearchToolResultError + */ +@JsonPropertyOrder({ + MessagesWebSearchToolResultError.JSON_PROPERTY_TYPE, + MessagesWebSearchToolResultError.JSON_PROPERTY_ERROR_CODE +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class MessagesWebSearchToolResultError { + /** + * The type of the result. Always `web_search_tool_result_error`. + */ + public enum TypeEnum { + WEB_SEARCH_TOOL_RESULT_ERROR(String.valueOf("web_search_tool_result_error")); + + 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_ERROR_CODE = "error_code"; + @javax.annotation.Nonnull + private String errorCode; + + public MessagesWebSearchToolResultError() { + } + + public MessagesWebSearchToolResultError type(@javax.annotation.Nonnull TypeEnum type) { + + this.type = type; + return this; + } + + /** + * The type of the result. Always `web_search_tool_result_error`. + * @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 MessagesWebSearchToolResultError errorCode(@javax.annotation.Nonnull String errorCode) { + + this.errorCode = errorCode; + return this; + } + + /** + * Get errorCode + * @return errorCode + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ERROR_CODE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getErrorCode() { + return errorCode; + } + + + @JsonProperty(value = JSON_PROPERTY_ERROR_CODE, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setErrorCode(@javax.annotation.Nonnull String errorCode) { + this.errorCode = errorCode; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MessagesWebSearchToolResultError messagesWebSearchToolResultError = (MessagesWebSearchToolResultError) o; + return Objects.equals(this.type, messagesWebSearchToolResultError.type) && + Objects.equals(this.errorCode, messagesWebSearchToolResultError.errorCode); + } + + @Override + public int hashCode() { + return Objects.hash(type, errorCode); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MessagesWebSearchToolResultError {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).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 MessagesWebSearchToolResultError instance; + + public Builder() { + this(new MessagesWebSearchToolResultError()); + } + + protected Builder(MessagesWebSearchToolResultError instance) { + this.instance = instance; + } + + public MessagesWebSearchToolResultError.Builder type(TypeEnum type) { + this.instance.type = type; + return this; + } + public MessagesWebSearchToolResultError.Builder errorCode(String errorCode) { + this.instance.errorCode = errorCode; + return this; + } + + + /** + * returns a built MessagesWebSearchToolResultError instance. + * + * The builder is not reusable. + */ + public MessagesWebSearchToolResultError 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 MessagesWebSearchToolResultError.Builder builder() { + return new MessagesWebSearchToolResultError.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public MessagesWebSearchToolResultError.Builder toBuilder() { + return new MessagesWebSearchToolResultError.Builder() + .type(getType()) + .errorCode(getErrorCode()); + } + + +} diff --git a/src/main/java/com/volcengine/ark/runtime/models/messages/ModelFallbackStatus.java b/src/main/java/com/volcengine/ark/runtime/models/messages/ModelFallbackStatus.java new file mode 100644 index 0000000..24c2dab --- /dev/null +++ b/src/main/java/com/volcengine/ark/runtime/models/messages/ModelFallbackStatus.java @@ -0,0 +1,190 @@ +// Copyright (c) 2026 ByteDance Ltd. and/or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + +/* + * Ark Messages 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.messages; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; + +/** + * ModelFallbackStatus + */ +@JsonPropertyOrder({ + ModelFallbackStatus.JSON_PROPERTY_FALLBACK_TRIGGERED, + ModelFallbackStatus.JSON_PROPERTY_ORIGINAL_MODEL +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0") +public class ModelFallbackStatus { + public static final String JSON_PROPERTY_FALLBACK_TRIGGERED = "fallback_triggered"; + @javax.annotation.Nonnull + private Boolean fallbackTriggered; + + public static final String JSON_PROPERTY_ORIGINAL_MODEL = "original_model"; + @javax.annotation.Nonnull + private String originalModel; + + public ModelFallbackStatus() { + } + + public ModelFallbackStatus fallbackTriggered(@javax.annotation.Nonnull Boolean fallbackTriggered) { + + this.fallbackTriggered = fallbackTriggered; + return this; + } + + /** + * Whether a model fallback was triggered for this request. + * @return fallbackTriggered + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_FALLBACK_TRIGGERED, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public Boolean getFallbackTriggered() { + return fallbackTriggered; + } + + + @JsonProperty(value = JSON_PROPERTY_FALLBACK_TRIGGERED, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFallbackTriggered(@javax.annotation.Nonnull Boolean fallbackTriggered) { + this.fallbackTriggered = fallbackTriggered; + } + + public ModelFallbackStatus originalModel(@javax.annotation.Nonnull String originalModel) { + + this.originalModel = originalModel; + return this; + } + + /** + * The model originally requested before fallback. + * @return originalModel + */ + @javax.annotation.Nonnull + @JsonProperty(value = JSON_PROPERTY_ORIGINAL_MODEL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getOriginalModel() { + return originalModel; + } + + + @JsonProperty(value = JSON_PROPERTY_ORIGINAL_MODEL, required = true) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setOriginalModel(@javax.annotation.Nonnull String originalModel) { + this.originalModel = originalModel; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFallbackStatus modelFallbackStatus = (ModelFallbackStatus) o; + return Objects.equals(this.fallbackTriggered, modelFallbackStatus.fallbackTriggered) && + Objects.equals(this.originalModel, modelFallbackStatus.originalModel); + } + + @Override + public int hashCode() { + return Objects.hash(fallbackTriggered, originalModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFallbackStatus {\n"); + sb.append(" fallbackTriggered: ").append(toIndentedString(fallbackTriggered)).append("\n"); + sb.append(" originalModel: ").append(toIndentedString(originalModel)).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 ModelFallbackStatus instance; + + public Builder() { + this(new ModelFallbackStatus()); + } + + protected Builder(ModelFallbackStatus instance) { + this.instance = instance; + } + + public ModelFallbackStatus.Builder fallbackTriggered(Boolean fallbackTriggered) { + this.instance.fallbackTriggered = fallbackTriggered; + return this; + } + public ModelFallbackStatus.Builder originalModel(String originalModel) { + this.instance.originalModel = originalModel; + return this; + } + + + /** + * returns a built ModelFallbackStatus instance. + * + * The builder is not reusable. + */ + public ModelFallbackStatus 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 ModelFallbackStatus.Builder builder() { + return new ModelFallbackStatus.Builder(); + } + + /** + * Create a builder with a shallow copy of this instance. + */ + public ModelFallbackStatus.Builder toBuilder() { + return new ModelFallbackStatus.Builder() + .fallbackTriggered(getFallbackTriggered()) + .originalModel(getOriginalModel()); + } + + +}