Repository navigation
feat: introduce DashScope Java SDK 3.0 (single commit) - #300
Merged
Merged
Conversation
Consolidate the v3 implementation into one commit. Exclude the md directory and preserve the existing release workflow and NOTICE.
…eployments examples - Add ChatCompletionsCreateAsync with CompletableFuture and Flowable support - Implement ChatCompletionsCreateEncrypted example with request-level encryption - Introduce TokenizationLocalCount for offline BPE tokenization without network calls - Add DeploymentsManage example demonstrating listing, getting, and lifecycle management - Update examples dry-run test to include new examples and inject synthetic tokenizer vocab - Enhance README files with updated resource tree, migration notes, and API doc links fix(legacy_2x): catch and log NoApiKeyException and InputRequiredException in generation calls - Wrap legacy generation.call with try-catch for ApiException, NoApiKeyException, InputRequiredException - Add error message output to standard error on exceptions test(ci): pre-download Qwen tokenizer vocab to stabilize tokenization tests - Add GitHub Actions step to download and verify qwen.tiktoken with retries before test run - Cache tokenizer vocab to avoid flaky ModelScope runtime fetch failures fix(ws): enhance websocket client logging with requestId context - Append requestId to debug, info, warn, and error log statements in OkHttpWebSocketClient - Include requestId where missing in cancellation, retry, and error handling logs fix(finetunes): improve polling timeout logic to handle budget-bounded timeouts accurately - Calculate remaining timeout budget correctly, compare with configured timeout - Classify timeout as waitTimeout when budget is exhausted based on applied timeout duration test(dry-run): add encryption support and deployment mocks to DryRunDispatcher - Implement J7 encryption channel mock with RSA keypair and AES wrapping/unwrapping - Add deployments list and get endpoints with canned responses - Support encrypted chat responses with AES encrypt/decrypt roundtrip validation style(examples): update legacy examples count and README formatting - Change legacy_2x sample count from 64 to 66 in README and comments - Improve formatting and clarify example code boundaries and usage instructions test(dry-run): inject synthetic Qwen tokenizer vocab to support offline tokenization test - Provide a minimal base64-encoded token vocab covering required token ids - Inject vocab file as DASHSCOPE_QWEN_VOCAB environment variable for local tokenization example
- Remove unnecessary line breaks in RSA decryption call - Reformat Maven project path comment to a single line - Wrap long comment lines within 100 characters - Simplify string builder append chain in syntheticVocab method - Wrap JavaDoc comment lines in FineTunesService for better readability
Keep semantic Chinese prompts and fixtures unchanged, and add the English examples guide alongside the existing Chinese documentation.
Keep the English guide in README.md and move the Chinese guide to README_zh.md with cross-language links.
…ansport Copy the pruned Gson/OkHttp base classes and GeneralApi transport into AgentStudio-owned packages (api/base/common/exception/protocol/utils) so the frozen legacy_2x subtree can be removed independently in 4.0. Repoint all 80 production files and 9 test files, remove the mutable legacy Constants.apiKey coupling, and apply the agentstudio3 SDK header policy to ordinary HTTP, file upload/download, and authenticated session SSE. Add the reverse dependency-boundary gate: no non-legacy production source may reference legacy_2x. The public error surface stays on the 3.0 errors family via AgentStudioErrors; copied 2.x exceptions remain internal plumbing.
- Snapshot and reuse streaming HTTP headers for all frames/chunks to preserve request IDs and tracing info - Replace previous empty map usage with actual headers in envelope filling methods - Modify SseStream to prefer raw network headers, preserving Content-Encoding and Content-Length - Adjust HttpTransport to merge network headers with application headers for accurate response header representation - Update ResponseStream to use streamHeadersMap directly for error and data frames - Remove redundant header copying helpers, centralizing header map extraction - Add tests verifying streaming frames and chunks carry original response headers including Content-Encoding on gzip - Fix gzip responses to retain Content-Encoding header in synchronous and asynchronous clients
…ation guide - Add badges for Maven Central, build status, and license - Provide detailed introduction and quick start for DashScope Java SDK 3.0 generation - Document synchronous, streaming (SSE), and asynchronous client usage with code examples - Explain configuration options with environment variable and builder method mappings - Enumerate available API capabilities with links to minimal runnable examples - Describe new error handling model with unchecked exceptions and legacy error style option - Include comprehensive migration guide from 2.x to 3.0 with class mappings and behavior changes - Retain deprecated 2.x API documentation as expandable appendix section - Add instructions for building from source and running examples with Maven - Clarify client lifecycle, API key resolution, telemetry opt-out, and HTTP logging settings
- Add `AgentStudioMemoryStores` example demonstrating full memory-store lifecycle - Show create store, seed memory, list memories with content, and update memory with optimistic lock - Implement list memory versions, redact a version, list stores, and delete store operations - Include example usage instructions and environment variable requirements - Update dry run dispatcher to support AgentStudio memory stores API mocks - Add example registration to offline dry-run test suite - Update documentation to mention AgentStudio memory stores example and features - Fix HTTP status code documentation in README to reflect correct 500 code for InternalServerException
- Prevent error emissions to global RxJava handler when client is closed - Skip finish-task send and reconnect attempts after cancellation - Add checks to avoid logging errors for canceled send operations - Ensure late errors only reported to local emitter if not closed - Add tests to cover finish-task send behavior during close races - Upgrade GitHub Action workflows for checkout and setup-java actions to v5 - Add package-info files for new audio-related packages under com.alibaba.dashscope.audio
* chore(docs): establish MkDocs-based bilingual documentation site - Add comprehensive mkdocs.yml configuration with Material theme and i18n support - Introduce docs/hooks.py to inject SDK version from pom.xml into site config - Add docs/main.py macros module for dynamically rendering SDK version and release notes - Create detailed docs/README.md guide on documentation maintenance and build process - Add docs/serve.sh script for local preview with Javadoc and MkDocs serve integration - Include logo.svg asset for site branding consistency - Update .gitignore to exclude site build output and docs/api Javadoc bundle - Add requirements-doc.txt for Python dependencies required by MkDocs and plugins - Configure Maven pom.xml for enhanced Javadoc generation with delombok and JDK 17 support - Add GitHub Actions workflow .github/workflows/docs.yml to build, validate and deploy docs - Update README.md and README_zh.md with links to the new bilingual documentation website * fix(docs): pin Javadoc output to target/apidocs and harden docs CI maven-javadoc-plugin 3.11.2 writes javadoc:javadoc output to target/reports/apidocs, breaking the stylesheet-bridge and /api/ attach steps in docs.yml and serve.sh; pin outputDirectory so the bundle lands in target/apidocs. Drop failOnError=false so Javadoc errors fail the build instead of shipping a partial API reference. Also: trigger docs builds on examples/** (snippets embed example sources), skip the Pages artifact upload on PR builds, align the Material pin with the 9.7.7 overrides, fall back to "unknown" when the pom version cannot be parsed, and drop exclude globs for directories that do not exist in this repo. --------- Co-authored-by: luk384090-cloud <lu384090@gmail.com> Co-authored-by: zhansheng.lzs <zhansheng.lzs@alibaba-inc.com>
…rnings - Add "(under development; interfaces may change)" note for client.audio() in features documentation (English and Chinese) - Insert warning blocks in audio guide (English and Chinese) to notify users about ongoing development - Clarify that API may change in future releases consistent with Javadoc in com.alibaba.dashscope.audio package - Specify that client.tingwu() is not affected by these changes - Advise users to watch for API changes when upgrading the SDK
- Refactor contentTypeOf method to separate probe result resolution into resolveContentType - Treat generic application/octet-stream probe result as unknown and fallback to extension mapping - Ensure .wav files upload with audio/wav instead of application/octet-stream to avoid service rejection - Add unit tests for resolveContentType covering various probe results and extensions - Add integration test verifying .wav files upload with correct content-type in multimodal embeddings API
- Prioritize canonical media extension types over OS MIME probes for consistency - Replace generic binary types for known media extensions with standard ones - Ensure multimodal services receive wire-compatible content types on all platforms - Add fallback to probe result only for unknown extensions - Add tests verifying normalization of host-dependent probe variants to canonical types - Confirm specific non-generic probe results pass through untouched for unknown extensions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
legacy_2x, regroup AgentStudio, and update runnable examples and tests.Scope
82c33dfffcee790d21ef43fc0bbeb83170819a77into one new commit, based directly on currentmain.md/directory. No source-branch commit or merge history is imported.mainrelease workflow and NOTICE; main-added APIs/examples/tests are retained in their v3 migration locations.Compatibility
legacy_2x; callers must update imports as described in README.Validation
mvn -o -B test— 735 tests, 0 failures, 0 errors, 3 skipped.git diff --checkpassed; no merge-conflict markers or obvious credential-format matches.md/paths from the submitted tree.