Skip to content

Releases

v3.0.0

Choose a tag to compare

@github-actions github-actions released this 04 Dec 07:00
d67b9b1

v3.0.0

The first 3.0 release rebuilds the DashScope Java SDK around a typed, resource-style client. One DashScopeClient (or DashScopeAsyncClient) replaces the per-capability entry classes of the 2.x line, with typed request/response models, an unchecked exception family, a layered configuration chain, automatic retries, and text-like streaming. Legacy 2.x APIs remain available as frozen facades under com.alibaba.dashscope.legacy_2x so existing code can keep compiling with an import update.

This release also significantly expands AgentStudio: dynamic workflow management, typed agent permissions and fixed-version bindings, plus a new Sandbox API for managed agents (DeepSeek Harness / OpenClaw) with native Web UI preview.

Scope: 1,255 files changed (+72,758 / −9,295) since v2.23.8; 796 SDK tests pass on JDK 8.

⚠️ Breaking Changes

3.0 is an intentional FQCN, source, and binary compatibility break. See the Migration Guide for the full entry-point mapping table and before/after examples.

  • Legacy packages moved — 2.x APIs (other than AgentStudio and shared) now live under com.alibaba.dashscope.legacy_2x.*, carry type-level @Deprecated, and will be removed in 4.0. To keep existing code compiling, prefix your 2.x imports with legacy_2x; new code should use the 3.0 client.
  • Exceptions — checked ApiException / NoApiKeyException / InputRequiredException are replaced by the unchecked DashScopeException family (AuthenticationException, RateLimitException, ContentFilterException, ApiTimeoutException, …) carrying code, HTTP status and request_id. Build the client with raiseOnError(false) to restore 2.x-style result inspection (result.isError()).
  • Streaming — sync streamCall returning Flowable becomes createStreaming returning a typed ResponseStream<T> (Iterable + AutoCloseable, incremental deltas by default). The async client still exposes RxJava Flowable.
  • Client lifecycle — per-capability new Generation() objects become one DashScopeClient in try-with-resources, sharing a connection pool and configuration.
  • Configuration — per-param apiKey(...) and global constants become the config chain: builder > system property > environment variable > ~/.dashscope/config.toml > defaults, with per-request RequestOptions overrides. DashScopeClient.builder().build() works with just DASHSCOPE_API_KEY exported.
  • AgentStudio — same business package, new FQCN com.alibaba.dashscope.applications.agentstudio.*, also reachable via client.agentStudio(). The 3.0 baseUrl does not apply to AgentStudio; use DASHSCOPE_AGENTSTUDIO_URL to override its endpoint.
  • assistants.* / threads.* have no 3.0 equivalent yet — keep the legacy_2x imports.

Features

New 3.0 client / resource API (#300)

  • One DashScopeClient entry point with 16 typed resources (chat(), multimodal(), embeddings(), rerank(), images(), videos(), apps(), audio(), tingwu(), tokenization(), agentStudio(), …), Lombok-builder request params and typed responses.
  • Async client — supported unary calls return CompletableFuture<T>; streams use RxJava Flowable<T>.
  • Automatic retries for non-streaming HTTP based on request settings and failure type, with backoff and Retry-After / Retry-After-ms / X-Should-Retry support, overridable per request via RequestOptions.
  • Encrypted channel — opt-in RSA envelope encryption (RequestOptions.enableEncryption(true)) with automatic gateway public-key fetch and caching.
  • HTTP/SSE/WebSocket transport improvements and expanded model/audio/platform resources.
  • Local tokenizer — TokenizerFactory.qwen() counts offline when the vocabulary is available (downloading it if missing); remote counting via tokenization().count.
  • Frozen 2.x APIs migrated to legacy_2x, AgentStudio regrouped, and runnable examples/tests updated. Validation: 735 tests, 0 failures on JDK 8 at merge time.

AgentStudio: dynamic workflows and agent configuration (#304)

  • AgentStudioClient.dynamicWorkflows() adds seven resource operations, available synchronously and through CompletableFuture: create, retrieve, partial update, list, archive, list versions, and retrieve a fixed version.
  • Cursor pagination preserves filters; update parameters distinguish omitted fields from explicit nulls when clearing descriptions or input schemas.
  • Typed Workflow permissions and fixed-version bindings in Agent configuration.
  • Ships with the runnable AgentStudioDynamicWorkflows recipe (EN/ZH guides) and nine new MockWebServer tests; validated against production with 40 checks covering sync/async operations, version immutability, null handling, pagination and archive behavior.

AgentStudio: Sandbox and managed Agent APIs (#306)

  • New com.alibaba.dashscope.agentstudio.sandbox package: a unified client for official-image templates, template files, Sandbox lifecycle operations and typed resource handles.
  • Managed Agent support: launch, lookup, sessions, turns, SSE subscriptions, cancellation, attachments and release — enabling DeepSeek Harness / OpenClaw through the Java SDK.
  • Native Web UI preview — open DSH/OpenClaw Web UIs through a local preview, with template/Sandbox reuse, automatic OpenClaw device pairing by default (autoPairOpenClaw=false retains manual pairing) and cleanup of newly created resources. Requires Node.js when used.
  • Model credentials are configured independently of the platform API key; reused templates/Sandboxes must correspond to the requested Harness image.

Sandbox test coverage and examples (#307)

  • 11 offline tests covering image resolution, template/instance payloads, independent model credentials, turns/SSE, files, error metadata and release.
  • Three runnable examples: ordinary Sandbox lifecycle, managed Harness chat, and native Web UI preview — each releases owned resources and preserves reusable templates or borrowed resources.
  • Example dry-run harness extended (46 checks passed); production SDK code, dependencies and CI configuration unchanged.

Bug Fixes

  • WebSocket post-close send race (#301) — after a duplex stream was cancelled/disposed, an orphaned RxJava thread could still run the streamingData onComplete finish-task send and reconnect, throwing NoApiKeyException as an RxJava UndeliverableException when no global API key was set. OkHttpWebSocketClient now guards the onComplete send with isClosed + try/catch, returns quietly from the reconnect catch when closed, and downgrades the onNext catch log to debug when closed. Live-flow failures still surface via emitResponseError. Includes a deterministic regression test (TestOkHttpWebSocketClientCloseRace).

Documentation

  • Bilingual docs aligned with the Python SDK (#305) — shared documentation structure with capability recipes, an examples hub, a developer guide, and reference pages linked to generated Javadoc. Clarifies async audio, stream errors and retries, image task IDs, legacy imports, offline tokenization and dry-run coverage; fixes the native HTTP endpoint example, documents wire-log redaction limits, and makes the streaming/async Quickstart examples independently compilable (javac --release 8). Both locales build with mkdocs build --strict.

CI & Chore

  • GitHub Actions bumped to v5 (Node 24) (#301) — actions/checkout and actions/setup-java v4 → v5 across release.yml, build-and-test.yml and linter.yml, clearing the Node.js 20 / setup-java v4 deprecation annotations. linter.yml checkout stays SHA-pinned.
  • Reverted the web preview cleanup change from #306 (3ed47c1).
  • Version bumped to 3.0.0 (pom.xml, Version.java).

Installation

Maven:

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>dashscope-sdk-java</artifactId>
    <version>3.0.0</version>
</dependency>

Gradle:

implementation 'com.alibaba:dashscope-sdk-java:3.0.0'

Requires JDK 8+. If 3.0.0 is not yet resolvable, the Maven Central deployment is still being published/synced — please check back shortly.

Contributors

Thanks to everyone who contributed to this release:

New Contributors

Full Changelog: v2.23.8...v3.0.0

v2.23.8

Choose a tag to compare

@github-actions github-actions released this 26 Nov 10:11
40acf4c

Release Notes

🚀 Highlights

  • Stable, network-free tokenizer tests in CI: the Qwen tokenizer vocabulary (qwen.tiktoken) is now pre-downloaded into a SHA256-verified local cache before mvn test runs, eliminating flaky test failures caused by on-demand ModelScope downloads from overseas runners (#297).
  • Maintenance release: no runtime/API changes compared to 2.23.7 — upgrading is safe and requires no code changes.

🔧 CI & Chore

  • Pre-download Qwen tokenizer vocab before tests (#297):
    • Since 2.23.7 (#293), qwen.tiktoken is no longer bundled in the jars and is fetched from ModelScope on first use. That on-demand download proved flaky from overseas CI runners and could fail unit tests for reasons unrelated to the code under test.
    • Both the build-and-test and release workflows now download the vocab up front into ~/.cache/dashscope/tokenizers/qwen.tiktoken, verify it against its expected SHA256 checksum, and retry up to 3 attempts (with curl-level retries and timeouts) before failing the job with a clear error.
    • As a result, tokenizer tests never touch the network during mvn test: they resolve the vocab from the verified local cache, making per-PR CI and tag-triggered release runs deterministic.
  • Bump SDK version to 2.23.8 (#298): updates pom.xml and Version.java.

⚠️ Breaking Changes

  • None. This release only touches CI workflows and version metadata; the SDK's runtime behavior is identical to 2.23.7. The offline-vocab guidance from 2.23.7 still applies: in air-gapped environments, provide the vocab via the DASHSCOPE_QWEN_VOCAB environment variable or place qwen.tiktoken on the classpath.

📦 Installation

Maven:

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>dashscope-sdk-java</artifactId>
    <version>2.23.8</version>
</dependency>

Gradle:

implementation 'com.alibaba:dashscope-sdk-java:2.23.8'

👥 Contributors

Thanks to all the contributors who made this release possible:

📝 Full Changelog

v2.23.7...v2.23.8

v2.23.7

Choose a tag to compare

@luk384090-cloud luk384090-cloud released this 19 Nov 08:21
6f23dbe

v2.23.7 Release Notes

🚀 Highlights

  • Agent Studio usage analytics: new usage summary and trend APIs let you query consumption statistics directly from the SDK (#294).
  • Much smaller distribution jars: the Qwen tokenizer vocabulary (qwen.tiktoken) is no longer bundled in the jars. It is resolved at runtime from DASHSCOPE_QWEN_VOCAB, the classpath, or a SHA256-verified ModelScope download cached under ~/.cache/dashscope/tokenizers (#293).

✨ Features

  • agentstudio: add usage summary and trend APIs (#294)

♻️ Refactoring

  • tokenizers: stop shipping qwen.tiktoken in distribution jars; resolve the vocab at runtime via environment variable, classpath, or verified ModelScope download with local cache, mirroring dashscope-sdk-python#237 (#293)

🔧 CI & Chore

  • Add automated Maven Central release workflow triggered by v* tags, gated by the maven-central environment approval; upgrade maven-gpg-plugin to 3.2.7 with loopback pinentry for headless CI signing and add an autoPublish switch (default false) to the central publishing plugin (#295)
  • Bump SDK version to 2.23.7 (#293)

⚠️ Breaking Changes

  • No API breaks. Behavioral change for offline environments: since qwen.tiktoken is no longer bundled, QwenTokenizer needs network access on first use to download the vocab from ModelScope. In air-gapped/offline setups, provide the vocab via the DASHSCOPE_QWEN_VOCAB environment variable or place qwen.tiktoken on the classpath (#293).

📦 Installation

Maven:

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>dashscope-sdk-java</artifactId>
    <version>2.23.7</version>
</dependency>

Gradle:

implementation 'com.alibaba:dashscope-sdk-java:2.23.7'

👥 Contributors

Thanks to all the contributors who made this release possible:

📝 Full Changelog

v2.23.6...v2.23.7

v2.23.6

Choose a tag to compare

@luk384090-cloud luk384090-cloud released this 12 Nov 03:42
a16c115

What's New

🚀 Qwen Live SDK — Realtime WebSocket Conversation API (#290)

A brand-new SDK for building realtime voice conversations with Qwen over WebSocket. The entry point is QwenLiveConversation, which manages a single-connect WebSocket lifecycle with full session management.

Core classes (package com.alibaba.dashscope.audio.live):

  • QwenLiveConversation — WebSocket session with connect(), close(), cancel(), and awaitSessionClosed() semantics
  • QwenLiveConnectionParam — Connection configuration (API key, model, endpoint); reads DASHSCOPE_WEBSOCKET_QWEN_LIVE_BASE_URL env override
  • QwenLiveSessionConfig — Session-level configuration (turn detection, input/output modalities, etc.)
  • QwenLiveResponsesConfig — Model response configuration
  • QwenLiveCallback / QwenLiveCallbackDispatcher — Unified event callbacks with optional ordered async dispatch
  • QwenLiveContext / QwenLiveContextCompaction — Context and context compaction support
  • QwenLiveDelegation / QwenLiveDelegationType — Client and responses delegation

Key features:

  • Byte array (byte[]) audio input support
  • Unified onError callback with optional ordered async dispatch
  • Guaranteed single onClose callback — transport failures during close now deliver the requested close code correctly
  • Dedicated WebSocket endpoint (no longer shares the Omni base URL)

Samples: QwenLiveQuickStart.java, QwenLiveUsage.java


🔧 Voice Enrollment — Base64 Audio Support

VoiceEnrollmentService now supports base64-encoded audio input for voice cloning, in addition to existing audio formats.


🐛 Bug Fixes

  • close() now always completes with exactly one onClose callback; socket cancellation during close frame rejection no longer causes missed callbacks
  • Transport failures during a pending close now correctly deliver the requested close code instead of being silently dropped

Full Changelog

v2.23.5...v2.23.6

Contributors

v2.23.5

Choose a tag to compare

@luk384090-cloud luk384090-cloud released this 06 Nov 05:31
9eb4310

v2.23.5

🚀 New Features

AgentStudio Session Mount Support (#288)

  • Add PerToolConfig.params for tool-specific parameters (e.g. knowledge_application_id for search_knowledgebases RAG tool)
  • Add SessionResource to echo provider/entity_id/project_ids/profile_schema for Bailian memory mounts and region/bucket/oss_path for OSS mounts
  • Add typed Mount builder that extends LinkedHashMap, compatible with existing List<Map<String, Object>> resources parameter
  • Add wire-level tests to validate Mount field names

🐛 Bug Fixes

Multimodal SSE Event Handling (#285)

  • Fix misleading Result no output ERROR logs when gateway emits successful auxiliary SSE frames without model output
  • Backfill requestId from x-request-id response header variants when response body omits request_id
  • Propagate request IDs through HTTP/SSE, WebSocket, and audio logs for better failure correlation
  • Add regression coverage for header, body, task ID, and unknown fallbacks

👥 Contributors

@foleydang
@lzsweb

v2.23.4

Choose a tag to compare

@luk384090-cloud luk384090-cloud released this 26 Oct 07:05
f356d19

What's Changed

🚀 New Features

Agent Model Config: maxTokens/temperature Parameters (#284)

  • ModelConfig gains optional inference parameters: temperature, max_tokens, enable_thinking, thinking_budget
  • Added builder(), toBuilder() and of(id) factory methods
  • model(String) / model(ModelConfig) builder aliases; setModel(String) as alias of setModelConfig
  • AgentCreateParam now validates model.id client-side
  • Fixed streaming: tolerate non-object delta payload (typed as JsonElement instead of JsonObject)
  • Fixed stream iterator to fail fast on second pass instead of blocking

🔧 Improvements

Image Synthesis: Multimodal Model Check (#283)

  • Added MULTIMODAL_MODEL_PREFIXES constant for models that only run on multimodal generation endpoints
  • Implemented checkMultimodalModel to verify and throw exceptions for multimodal models
  • Invoked model check in asyncCall, syncCall, and call methods
  • Updated documentation to clarify multimodal models should use ImageGeneration class
  • Added unit tests for rejecting multimodal models in synchronous calls

📊 Statistics

  • 2 PRs merged
  • 456 lines added
  • 20 new test cases added

🙌 Contributors

@foleydang
@luk384090-cloud


Full Changelog: v2.23.3...v2.23.4

v2.23.3

Choose a tag to compare

@luk384090-cloud luk384090-cloud released this 20 Oct 01:30
b2a8acb

What's Changed

🚀 New Features

Decision Model API Support (#279)

Introduce comprehensive decision model API to support intelligent decision-making scenarios:

  • Core Classes:

    • DecisionModel - Main entry point for decision model invocation
    • DecisionModelParam - Input parameter configuration with validation
    • DecisionQuestion & DecisionAnswer - Data structures for Q&A interactions
    • DecisionModelResult - Server response parsing
    • DecisionModelUsage - Token usage statistics
  • Key Capabilities:

    • Workspace-scoped base URL resolution
    • Support for bare String and Array type state parameters
    • Optional true/false description parameters for noul questions
    • Comprehensive parameter validation (options count, levels count limits)
    • Enhanced error handling and null value checks
  • Documentation: Added usage examples and API documentation links in README

Agent Studio Memory Management (#282)

Complete memory resource family mirroring Claude Managed Agents API:

  • MemoryStores API:

    • CRUD operations + archive functionality
    • memoryStores().create(), list(), retrieve(), update(), delete(), archive()
  • Memories API:

    • Nested memory management with optimistic locking
    • memories().create(), list(), retrieve(), update(), delete()
  • MemoryVersions API:

    • Version history and redaction capabilities
    • memoryVersions().list(), retrieve(), redact()
  • Advanced Features:

    • Sync + CompletableFuture support for all operations
    • Cursor-based pagination with typed prefixes field
    • Client-side depth >= 2 derivation from flat listing
    • ApiException with memory 409 conflict codes
    • Dotted wire keys support (e.g., created_at.gte)
  • Testing: 13 MockWebServer tests covering request shapes, auto-pagination, depth emulation, nested error parsing

🔧 Improvements

Custom Base URL for Encryption (#280)

  • Support custom base URL configuration for encryption key fetching
  • Enhanced flexibility for different deployment environments

📊 Statistics

  • 3 PRs merged
  • 2,893 lines added
  • 10 new files created
  • 13 new test cases added

🙌 Contributors

@luk384090-cloud
@foleydang


Full Changelog: v2.23.2...v2.23.3

v2.23.2

Choose a tag to compare

@luk384090-cloud luk384090-cloud released this 08 Oct 08:30
b726f9e

What's Changed

Bug Fixes

SSE Streaming Error Handling (#278)
Fixed error handling and status parsing issues in SSE streaming responses. Enhanced OkHttpHttpClient to properly detect and propagate errors during streaming, improved HTTP status code parsing for edge cases, and added comprehensive test coverage for SSE error scenarios.

Features

AgentStudio Session Agent Override (#275)
Session create/update now support the agent override object form (type=agent_with_overrides with system/tools/mcp_servers/skills) in addition to the Agent ID string. Added top-level environment_variables and mcp_configs fields. SessionCreateParam agent field accepts String (backward compatible), override Map, or SessionAgent. SessionUpdateParam adds vaultIds/environmentVariables/agent(patch)/mcpConfigs with delete-override semantics for null sub-fields. New SessionAgent union helper class provides ofString/ofOverride builders.

Audio Model Usage Tokens (#276)
Added tokens field to audio model usage output. RecognitionUsage and SpeechSynthesisUsage now expose token consumption metrics in their usage responses.

Contributors

@luk384090-cloud
@foleydang
@songguocola

Full Changelog: v2.23.1...v2.23.2

v2.23.1

Choose a tag to compare

@luk384090-cloud luk384090-cloud released this 18 Sep 04:40
9db8553

What's Changed

Features

  • MultiModalEmbeddingParam Parameter Enhancements (#273)
    Aligned with Python SDK by adding multiple explicit builder fields: dimension (output vector dimension), outputType, fps (video frame sampling rate), instruct (custom task instruction), enableFusion (fuse multiple contents into single vector), resLevel (resolution level), maxVideoFrames (max video frames). Resolves user-reported issue where dimension could not be set when calling Multimodal-Embedding for image vectorization (expected 1152 dimensions, not 1024). Generic .parameter(k, v) channel remains available and takes precedence, ensuring full backward compatibility.

  • Omni Model Video Parameter Rename (#274)
    Renamed the representation_compact parameter for input video in the Omni model.

Contributors

Full Changelog: v2.23.0...v2.23.1

v2.23.0

Choose a tag to compare

@luk384090-cloud luk384090-cloud released this 11 Sep 08:51
fe9313e

🚀 Features

  • AgentStudio: Tool Approval, Event Deltas, Session Resources & Security (#270) by @coolsky99
    Added SessionThreads resource (188 lines), extended Sessions with new capabilities, and introduced protocol-level support for tool approval, event deltas, and security features. Includes comprehensive test coverage (172 lines). ~1,188 lines of new code across 19 files.

  • AgentStudio: Deployment Environment Variables (#271) by @coolsky99
    Added environment variable support to DeploymentCreateParam and DeploymentUpdateParam, enabling configuration of deployment environments.

  • Audio: Omni Video Compactness & ASR Runtime Context Updates (#269) by @songguocola
    Added video compactness support for Omni real-time config and ASR runtime input.context updates via continue-task. Enhanced Recognition class with improved flexibility.

🐛 Fixes

  • ASR Phrase Finetune & OSS Upload (#267) by @lzsweb
    Fixed ASR phrase finetune options and OSS upload issues. Added extensive test coverage for SDK client tracking headers (TestSdkClientTrackingHeader, 190 lines) and DashScope headers (TestDashScopeHeaders, 215 lines).

Contributors

@coolsky99, @lzsweb, @songguocola