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
44 changes: 9 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Java Release

# Publishes com.volcengine:ark-runtime and the optional ark-runtime-mcp adapter
# to Maven Central. Tags are created
# 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:
Expand Down Expand Up @@ -59,7 +58,7 @@ jobs:
with:
ref: ${{ steps.tag.outputs.name }}

- name: Verify artifact versions match tag
- name: Verify pom version matches tag
env:
RELEASE_TAG: ${{ steps.tag.outputs.name }}
run: |
Expand All @@ -73,41 +72,27 @@ jobs:
echo "::error::pom.xml ark-runtime version ${actual} does not match tag ${RELEASE_TAG}"
exit 1
fi
mcp_actual=$(python3 -c "
import re
text = open('mcp/pom.xml').read()
artifact = re.search(r'<artifactId>ark-runtime-mcp</artifactId>\s*<version>([^<]+)</version>', text)
dependency = re.search(r'<ark-runtime.version>([^<]+)</ark-runtime.version>', text)
print((artifact.group(1) if artifact else 'missing') + ' ' + (dependency.group(1) if dependency else 'missing'))
")
if [ "${mcp_actual}" != "${version} ${version}" ]; then
echo "::error::mcp artifact/core versions ${mcp_actual} do not match tag ${RELEASE_TAG}"
exit 1
fi

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: "17"
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 versions
- name: Check Maven Central version
id: maven_check
env:
RELEASE_TAG: ${{ steps.tag.outputs.name }}
run: |
version="${RELEASE_TAG#v}"
core_url="https://repo.maven.apache.org/maven2/com/volcengine/ark-runtime/${version}/ark-runtime-${version}.pom"
mcp_url="https://repo.maven.apache.org/maven2/com/volcengine/ark-runtime-mcp/${version}/ark-runtime-mcp-${version}.pom"
core_code=$(curl -sS -o /dev/null -w '%{http_code}' "${core_url}")
mcp_code=$(curl -sS -o /dev/null -w '%{http_code}' "${mcp_url}")
echo "core_publish_needed=$([ "${core_code}" = "200" ] && echo false || echo true)" >> "$GITHUB_OUTPUT"
echo "mcp_publish_needed=$([ "${mcp_code}" = "200" ] && echo false || echo true)" >> "$GITHUB_OUTPUT"
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:
Expand All @@ -126,8 +111,8 @@ jobs:
exit 1
fi

- name: Publish core to Maven Central
if: steps.maven_check.outputs.core_publish_needed == 'true'
- name: Publish to Maven Central
if: steps.maven_check.outputs.publish_needed == 'true'
run: |
mvn clean deploy -B -Ppublic -DskipTests \
-Dmaven.javadoc.failOnError=false \
Expand All @@ -136,14 +121,3 @@ jobs:
MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Publish MCP adapter to Maven Central
if: steps.maven_check.outputs.mcp_publish_needed == 'true'
run: |
mvn clean deploy -B -f mcp/pom.xml -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 }}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ The official Java library for accessing ModelArk on Volcengine and BytePlus. It
<dependency>
<groupId>com.volcengine</groupId>
<artifactId>ark-runtime</artifactId>
<version>0.7.0</version>
<version>0.8.0</version>
</dependency>
```

### Gradle

```groovy
implementation 'com.volcengine:ark-runtime:0.7.0'
implementation 'com.volcengine:ark-runtime:0.8.0'
```

## Choose Volcengine or BytePlus
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.8.0
10 changes: 10 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ The paired multimodal and sparse embedding examples default to `doubao-embedding
MCP is available in both clouds and its calls explicitly send `ark-beta-mcp: true`. Other built-in tools are CN-only: Knowledge Search sends `ark-beta-knowledge-search: true`, and Doubao App sends `ark-beta-doubao-app: true`.

[`self_hosted_mcp_worker/`](./self_hosted_mcp_worker) demonstrates how to discover tools from a local stdio MCP server, convert them into Agent custom tool declarations, and execute them through the self-hosted worker.

To compile both cloud example modules without making API calls, run from the repository root:

```bash
mvn -q -DskipTests install
mvn -q -f examples/volc/pom.xml clean compile
mvn -q -f examples/byteplus/pom.xml clean compile
```

The cloud example POMs default to SDK 0.8.0. To check another locally installed SDK version, pass `-Dark-runtime.version=<version>` to each example Maven command.
2 changes: 1 addition & 1 deletion examples/byteplus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>0.1.0</version>

<properties>
<ark-runtime.version>0.4.0</ark-runtime.version>
<ark-runtime.version>0.8.0</ark-runtime.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPart;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartImage;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartImageImageUrl;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartImageImageUrl2;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartText;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartType;
import com.volcengine.ark.runtime.models.chat.ChatCompletionMessageContent;
Expand Down Expand Up @@ -42,9 +43,10 @@ public static void main(String[] args) {
.build());
multiParts.add(ChatCompletionContentPartImage.builder()
.type(ChatCompletionContentPartType.IMAGE_URL)
.imageUrl(ChatCompletionContentPartImageImageUrl.builder()
.url("https://ark-project.tos-cn-beijing.volces.com/images/view.jpeg")
.build())
.imageUrl(ChatCompletionContentPartImageImageUrl2.ofChatCompletionContentPartImageImageUrl(
ChatCompletionContentPartImageImageUrl.builder()
.url("https://ark-project.tos-cn-beijing.volces.com/images/view.jpeg")
.build()))
.build());
messages.add(ChatCompletionRequestUserMessage.builder()
.role(ChatCompletionRequestMessageType.USER)
Expand Down
3 changes: 2 additions & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<description>Runnable examples for the ark-runtime Java SDK.</description>

<properties>
<ark-runtime.version>0.8.0</ark-runtime.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -22,7 +23,7 @@
<dependency>
<groupId>com.volcengine</groupId>
<artifactId>ark-runtime</artifactId>
<version>0.1.0</version>
<version>${ark-runtime.version}</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion examples/volc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>0.1.0</version>

<properties>
<ark-runtime.version>0.4.0</ark-runtime.version>
<ark-runtime.version>0.8.0</ark-runtime.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPart;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartImage;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartImageImageUrl;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartImageImageUrl2;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartText;
import com.volcengine.ark.runtime.models.chat.ChatCompletionContentPartType;
import com.volcengine.ark.runtime.models.chat.ChatCompletionMessageContent;
Expand Down Expand Up @@ -42,9 +43,10 @@ public static void main(String[] args) {
.build());
multiParts.add(ChatCompletionContentPartImage.builder()
.type(ChatCompletionContentPartType.IMAGE_URL)
.imageUrl(ChatCompletionContentPartImageImageUrl.builder()
.url("https://ark-project.tos-cn-beijing.volces.com/images/view.jpeg")
.build())
.imageUrl(ChatCompletionContentPartImageImageUrl2.ofChatCompletionContentPartImageImageUrl(
ChatCompletionContentPartImageImageUrl.builder()
.url("https://ark-project.tos-cn-beijing.volces.com/images/view.jpeg")
.build()))
.build());
messages.add(ChatCompletionRequestUserMessage.builder()
.role(ChatCompletionRequestMessageType.USER)
Expand Down
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.7.0</version>
<version>0.8.0</version>
<packaging>jar</packaging>

<name>ark-runtime</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public Agent id(@javax.annotation.Nonnull String id) {
}

/**
* Agent ID,格式 &#x60;agent_&lt;opaque&gt;&#x60;。对外暴露给 session 引用。
* Agent ID,形如 &#x60;agent-...&#x60;。对外暴露给 session 引用。
* @return id
*/
@javax.annotation.Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public AgentSkillRef skillId(@javax.annotation.Nullable String skillId) {
}

/**
* Skill ID,形如 &#x60;skill_01XJ5...&#x60;。
* Skill ID,形如 &#x60;skill-...&#x60;。
* @return skillId
*/
@javax.annotation.Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public ModelConfig id(@javax.annotation.Nonnull String id) {
}

/**
* 模型 ID,例如 &#x60;claude-opus-4-7&#x60; / &#x60;claude-sonnet-4-6&#x60; / &#x60;claude-haiku-4-5&#x60;。
* 模型 ID,例如 &#x60;doubao-seed-2-1&#x60;。
* @return id
*/
@javax.annotation.Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
*/
public enum SkillRefType {

ANTHROPIC("anthropic"),

CUSTOM("custom"),

SKILL_HUB("skill_hub");
SKILL_HUB("skill_hub"),

ARK("ark");

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class ChatCompletionContentPartImage implements ChatCompletionContentPart

public static final String JSON_PROPERTY_IMAGE_URL = "image_url";
@javax.annotation.Nonnull
private ChatCompletionContentPartImageImageUrl imageUrl;
private ChatCompletionContentPartImageImageUrl2 imageUrl;

public ChatCompletionContentPartImage() {
}
Expand Down Expand Up @@ -66,7 +66,7 @@ public void setType(@javax.annotation.Nonnull ChatCompletionContentPartType type
this.type = type;
}

public ChatCompletionContentPartImage imageUrl(@javax.annotation.Nonnull ChatCompletionContentPartImageImageUrl imageUrl) {
public ChatCompletionContentPartImage imageUrl(@javax.annotation.Nonnull ChatCompletionContentPartImageImageUrl2 imageUrl) {

this.imageUrl = imageUrl;
return this;
Expand All @@ -80,14 +80,14 @@ public ChatCompletionContentPartImage imageUrl(@javax.annotation.Nonnull ChatCom
@JsonProperty(value = JSON_PROPERTY_IMAGE_URL, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)

public ChatCompletionContentPartImageImageUrl getImageUrl() {
public ChatCompletionContentPartImageImageUrl2 getImageUrl() {
return imageUrl;
}


@JsonProperty(value = JSON_PROPERTY_IMAGE_URL, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setImageUrl(@javax.annotation.Nonnull ChatCompletionContentPartImageImageUrl imageUrl) {
public void setImageUrl(@javax.annotation.Nonnull ChatCompletionContentPartImageImageUrl2 imageUrl) {
this.imageUrl = imageUrl;
}

Expand Down Expand Up @@ -144,7 +144,7 @@ public ChatCompletionContentPartImage.Builder type(ChatCompletionContentPartType
this.instance.type = type;
return this;
}
public ChatCompletionContentPartImage.Builder imageUrl(ChatCompletionContentPartImageImageUrl imageUrl) {
public ChatCompletionContentPartImage.Builder imageUrl(ChatCompletionContentPartImageImageUrl2 imageUrl) {
this.instance.imageUrl = imageUrl;
return this;
}
Expand Down
Loading
Loading