hengyuss opened a new pull request, #7531:
URL: https://github.com/apache/shenyu/pull/7531
Closes #7381.
Parent issue: #7351.
## Summary
This PR establishes the initial AI Proxy Protocol–Provider–Transport
contracts
through a minimal runnable OpenAI Chat vertical slice.
- Add ShenYu-owned request and raw upstream request/response models.
- Add explicit Protocol and Provider registries with duplicate and
unsupported
implementation validation.
- Add an OpenAI Chat request decoder that retains the raw JSON payload.
- Add an OpenAI Provider adapter for endpoint, authentication, headers,
model,
token limit, and streaming request adaptation.
- Add a WebClient-based reactive Transport that preserves upstream status,
headers, streaming chunks, and error bodies.
- Add `AiProxyEngine` to coordinate request decoding, provider adaptation,
and
transport execution.
- Expose the initial implementations as Spring beans.
## Compatibility
This PR intentionally does not connect `AiProxyEngine` to `AiProxyPlugin`.
The existing streaming and non-streaming plugin execution paths, retry,
fallback, proxy-key validation, and response writing remain unchanged.
Response protocol conversion, additional providers, production transport
configuration, retry/fallback orchestration, and the final plugin migration
remain follow-up work under #7351 and its layer-specific sub-issues.
## Verification
```text
./mvnw -pl shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-proxy -am \
-Dtest='AiProxyEngineTest,OpenAiChatTest,AiProxyProtocolFactoryTest,AiProxyProviderFactoryTest,OpenAiTest,WebClientAiProxyTransportTest'
\
-Dsurefire.failIfNoSpecifiedTests=false \
-Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true test
```
- 16 focused tests passed.
- Checkstyle reported zero violations for all modules in the reactor build.
- The AI Proxy starter and its dependencies compile successfully.
--
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]