hulincup opened a new pull request, #962:
URL: https://github.com/apache/flink-agents/pull/962

   ## What & why
   
   The YAML loader resolves short `clazz:` aliases through three 
hand-maintained copies of the same alias table (Java `Aliases.java`, Python 
`aliases.py`, docs `yaml.md`). Six resource implementations already have a 
`ResourceName` constant but **no alias entry** in any of the three tables, so 
users must reach them by fully-qualified class path. Per item 1 of #958, this 
adds the missing entries across all three tables, mirroring the shape of 
existing entries (e.g. the Bedrock aliases added in #812).
   
   | Alias | Resource type | Language | Implementation |
   | --- | --- | --- | --- |
   | `gemini` | chat model connection + setup | java | Gemini |
   | `azure_openai` | chat model connection + setup | java | Azure OpenAI |
   | `opensearch` | vector store | java | OpenSearch |
   | `s3_vectors` | vector store | java | S3 Vectors |
   | `milvus` | vector store | java | Milvus |
   | `mem0` | vector store | python | Mem0 |
   
   All additions are **purely additive**. Java/Python/API-YAML alignment is 
preserved (the same six entries land in the Java table, the Python table, and 
the docs table).
   
   ## Scope: item 1 only
   
   This addresses **item 1** of #958 only. **Item 2** — the `azure` alias 
resolving to the Azure AI Inference connection (`AzureAIChatModelConnection`) 
while `yaml.md` documents it as "Azure OpenAI (Java)" — is a behavior change 
for users who already have `clazz: azure` in their YAML and is intentionally 
left for a separate PR, as the issue suggests. The existing `azure` alias and 
its docs row are untouched here. Adding `azure_openai` as a *new* Java alias is 
independent of that decision and gives the Azure OpenAI Java connection a 
reachable short name either way.
   
   Open question from the issue: *should any of these six be deliberately 
unaliased?* I defaulted to aliasing all six, since an alias is an optional 
short name (fully-qualified `clazz:` still works) and adding one is reversible. 
Happy to drop any a maintainer feels should stay first-class-only.
   
   ## Tests
   
   - `python/flink_agents/api/yaml/tests/test_aliases.py`: added two cases 
asserting the six new aliases resolve to the expected FQNs. Full file passes 
locally: `13 passed`.
   - `api/src/test/java/org/apache/flink/agents/api/yaml/AliasesTest.java`: 
added two parallel cases mirroring the existing `clazzAliasJavaBucket` style.
   - `ruff check` clean on both changed Python files.
   
   Java build was not run locally (sparse checkout of a large repo; host JDK is 
8 vs the project Java 11 target). The change is mechanical — each new entry 
mirrors the immediately adjacent existing `put`/dict lines — and the referenced 
`ResourceName` constants all exist at `main`. CI will confirm.
   
   ## Compatibility
   
   No behavior change. Aliases are optional; fully-qualified `clazz:` values 
keep passing through unchanged. No public API signature changes.
   
   Closes #958 (item 1).
   
   Generated-by: Claude Code (Anthropic) — used to author this patch and PR 
description; reviewed and submitted by a human contributor.
   


-- 
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]

Reply via email to