wenjin272 opened a new pull request, #1201: URL: https://github.com/apache/flink-agents/pull/1201
Linked issue: Closes #1196 ### Purpose of change Callers now use `DashScope*` classes, `dashscope_*` modules, `DASHSCOPE_*` resource constants, and the YAML alias `dashscope` for the chat and embedding integrations. This aligns the public integration names with the API/SDK they use. #### Runtime flow Python resource declarations and YAML resolve to the renamed Python connection/setup classes. Java's `ResourceName.*.Python` constants and Python-resource YAML aliases reference those same paths through the existing cross-language wrappers. Connections still call DashScope `Generation.call` or `TextEmbedding.call`; request and response handling are unchanged. #### Key decisions This is an intentional breaking rename, with no deprecated aliases or automatic migration. User-facing documentation identifies the product as **Alibaba Cloud Model Studio (DashScope)** and explains its relationship to Bailian and the DashScope SDK. Existing tests and examples are updated to the new names. ### Behavioral Semantics #### Interaction decisions | Entry point | DashScope names | Old Tongyi names | | --- | --- | --- | | Python declarations/imports | Resolve to renamed Python classes | No compatibility symbols or modules | | Java declarations / YAML for Python resources | Reference the same renamed Python classes | Removed constants / unresolved old alias | | Serialized descriptors or plans | New paths load through the existing resource loader | Old paths require migration before loading | There is still no native Java DashScope implementation; Java agents use the Python integration. #### Behavioral contracts - The canonical resource constants and Python-resource YAML aliases consistently identify the renamed chat and embedding classes. - Old Tongyi names are not redirected or retained as compatibility entry points. - Provider requests, model defaults, response conversion, token usage, and structured-output behavior remain unchanged. #### Failure behavior Old imports or stored class paths fail when the resource loader attempts to import them. The removed `tongyi` YAML alias follows existing unknown-name handling and cannot resolve to a built-in provider. There is no automatic rewrite or fallback to the new class names. Existing provider errors and validation are unchanged, including missing-key `ValueError`, unsuccessful API-response `RuntimeError`, and structured-output conflict/render errors. No new retry or response-recovery behavior is introduced. ### Tests | Contract | Verification | | --- | --- | | Canonical names resolve consistently | Existing `test_resource_name.py` imports all Python resource constants; existing Python YAML suite and Java `AliasesTest`, `YamlLoaderBuildersTest`, `YamlPythonFixtureParityTest` passed. Alias entries and Java Python-class references were inspected; no new provider-specific alias test was added. | | No Tongyi compatibility entries | Repository-wide reference inspection; no dedicated old-path rejection test added. | | Provider behavior is unchanged | Existing renamed chat, native structured-output, embedding, and output-schema parameter tests, including mocked SDK requests. | - Python focused suite: **189 passed, 4 skipped** (live DashScope tests; API key unset). - Java focused suite: **27 passed**, with API sources/test sources recompiled and Spotless checked. - Ruff checks for changed Python files and `git diff --check` passed. Not verified: live DashScope calls, remote Flink cross-language execution, checkpoint/savepoint restoration containing old paths, and the full repository test suite. Migration of persisted artifacts is not implemented or tested. ### API **Breaking change:** replace `Tongyi` with `DashScope` in public class names, `tongyi_chat_model` / `tongyi_embedding_model` with `dashscope_chat_model` / `dashscope_embedding_model` in module paths, `TONGYI_*` with `DASHSCOPE_*` in Python and Java resource constants, and YAML `clazz: tongyi` with `clazz: dashscope`. Class-name configuration prefixes must also use the new names. Regenerate stored descriptors/plans or migrate their module/class references, including Java wrapper `pythonClazz` arguments, before loading them. Existing state that embeds old paths is not automatically migrated; this PR does not establish checkpoint/savepoint compatibility. Migration guidance will be included in the release notes. The test/example model-selection environment variables are renamed to `DASHSCOPE_CHAT_MODEL` and `DASHSCOPE_EMBEDDING_MODEL`. `DASHSCOPE_API_KEY`, model identifiers, provider parameters, and API behavior are unchanged. ### Documentation - [ ] `doc-needed` - [ ] `doc-not-needed` - [x] `doc-included` ### Was this patch authored or co-authored using generative AI tooling? - [x] Yes - [ ] No Generated-by: Codex 0.153.4 (GPT-6) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
