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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ automatic retry logic.
<dependency>
<groupId>com.volcengine</groupId>
<artifactId>ark-runtime</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
</dependency>
```

### Gradle

```groovy
implementation 'com.volcengine:ark-runtime:0.3.0'
implementation 'com.volcengine:ark-runtime:0.4.0'
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.4.0
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.volcengine</groupId>
<artifactId>ark-runtime</artifactId>
<version>0.3.0</version>
<version>0.4.0</version>
<packaging>jar</packaging>

<name>ark-runtime</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,217 +13,107 @@
* 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 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;

/**
* What context to retain while applying a context-management edit.
* MessagesContextManagementKeep
*
* Naked-union holder generated by gen/java/postprocess.py from the openapi
* anyOf schema (variants: String, MessagesContextManagementKeepParameter).
*
* 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).
*/
@JsonPropertyOrder({
MessagesContextManagementKeep.JSON_PROPERTY_TYPE,
MessagesContextManagementKeep.JSON_PROPERTY_VALUE
})
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
@JsonDeserialize(using = MessagesContextManagementKeep.Deserializer.class)
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;
}
private final Object 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 + "'");
}
@JsonCreator
public MessagesContextManagementKeep(Object value) {
this.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() {
this.value = null;
}

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 static MessagesContextManagementKeep ofString(String value) {
return new MessagesContextManagementKeep(value);
}

public MessagesContextManagementKeep value(@javax.annotation.Nonnull Integer value) {

this.value = value;
return this;
public static MessagesContextManagementKeep ofMessagesContextManagementKeepParameter(MessagesContextManagementKeepParameter value) {
return new MessagesContextManagementKeep(value);
}

/**
* Get value
* @return value
*/
@javax.annotation.Nonnull
@JsonProperty(value = JSON_PROPERTY_VALUE, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public Integer getValue() {
return value;
@JsonValue
public Object getValue() {
return this.value;
}


@JsonProperty(value = JSON_PROPERTY_VALUE, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setValue(@javax.annotation.Nonnull Integer value) {
this.value = value;
public static class Deserializer extends JsonDeserializer<MessagesContextManagementKeep> {
@Override
public MessagesContextManagementKeep deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
ObjectMapper mapper = (ObjectMapper) p.getCodec();
JsonNode node = mapper.readTree(p);
if (node.isTextual()) {
return new MessagesContextManagementKeep(mapper.treeToValue(node, String.class));
}
if (node.isObject()) {
return new MessagesContextManagementKeep(mapper.treeToValue(node, MessagesContextManagementKeepParameter.class));
}
throw ctxt.weirdStringException(
node == null ? "null" : node.toString(),
MessagesContextManagementKeep.class,
"no MessagesContextManagementKeep variant matched JSON node shape");
}
}


@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);
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MessagesContextManagementKeep other = (MessagesContextManagementKeep) o;
return Objects.equals(this.value, other.value);
}

@Override
public int hashCode() {
return Objects.hash(type, value);
return Objects.hash(this.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 ");
return "class MessagesContextManagementKeep {" + Objects.toString(value) + "}";
}

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 + ")";
}
private Object value;
public Builder() {}
public Builder value(Object value) { this.value = value; return this; }
public MessagesContextManagementKeep build() { return new MessagesContextManagementKeep(this.value); }
}

/**
* Create a builder with no initialized field.
*/
public static MessagesContextManagementKeep.Builder builder() {
return new MessagesContextManagementKeep.Builder();
}
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());
return new MessagesContextManagementKeep.Builder().value(this.value);
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@

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;

/**
Expand All @@ -30,48 +28,15 @@
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 class MessagesContextManagementKeepAll implements MessagesContextManagementKeepParameter {
public static final String JSON_PROPERTY_TYPE = "type";
@javax.annotation.Nonnull
private TypeEnum type;
private MessagesContextManagementKeepParameterType type = MessagesContextManagementKeepParameterType.ALL;

public MessagesContextManagementKeepAll() {
}

public MessagesContextManagementKeepAll type(@javax.annotation.Nonnull TypeEnum type) {
public MessagesContextManagementKeepAll type(@javax.annotation.Nonnull MessagesContextManagementKeepParameterType type) {

this.type = type;
return this;
Expand All @@ -85,14 +50,14 @@ public MessagesContextManagementKeepAll type(@javax.annotation.Nonnull TypeEnum
@JsonProperty(value = JSON_PROPERTY_TYPE, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public TypeEnum getType() {
public MessagesContextManagementKeepParameterType getType() {
return type;
}


@JsonProperty(value = JSON_PROPERTY_TYPE, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setType(@javax.annotation.Nonnull TypeEnum type) {
public void setType(@javax.annotation.Nonnull MessagesContextManagementKeepParameterType type) {
this.type = type;
}

Expand Down Expand Up @@ -143,7 +108,7 @@ protected Builder(MessagesContextManagementKeepAll instance) {
this.instance = instance;
}

public MessagesContextManagementKeepAll.Builder type(TypeEnum type) {
public MessagesContextManagementKeepAll.Builder type(MessagesContextManagementKeepParameterType type) {
this.instance.type = type;
return this;
}
Expand Down
Loading
Loading