feat(llm): introduce LlmProvider abstraction, rename impl to HttpChatCompletionLlmProvider#2
Draft
Copilot wants to merge 4 commits intocopilot/add-unified-ai-provider-abstractionfrom
Conversation
…lmProvider Agent-Logs-Url: https://github.com/VM8gkAs/WISE-API/sessions/09ef9a40-a0b4-4956-8207-b86ad5bda50b Co-authored-by: VM8gkAs <61822684+VM8gkAs@users.noreply.github.com>
…nt resource leaks Agent-Logs-Url: https://github.com/VM8gkAs/WISE-API/sessions/09ef9a40-a0b4-4956-8207-b86ad5bda50b Co-authored-by: VM8gkAs <61822684+VM8gkAs@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Revise implementation of provider abstraction for better alignment
feat(llm): introduce LlmProvider abstraction, rename impl to HttpChatCompletionLlmProvider
Apr 30, 2026
Owner
|
@copilot resolve the merge conflicts in this pull request |
…straction base branch Co-authored-by: VM8gkAs <61822684+VM8gkAs@users.noreply.github.com>
Author
Resolved in commit |
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.
Draft PR #1 introduced a
LlmProviderabstraction but usedOpenAiCompatibleLlmProvideras the implementation name—misleading when backing a Bedrock bean—and overstated multi-provider readiness in comments and docs.Changes
OpenAiCompatibleLlmProvider→HttpChatCompletionLlmProvider; describes the HTTP Bearer-token adapter pattern, not a vendorAWSBedrockControllerandChatGptControllerdrop ~90 lines of duplicated inline HTTP code; delegate via@Qualifier-injectedLlmProvider;produces = APPLICATION_JSON_VALUEadded to bothLlmProviderConfig— Spring@Configurationwires two named beans from existing properties with no renames:LlmProvider,LlmProviderConfig, andapplication_sample.properties; wording now reflects this is the first abstraction step onlyOutputStreamWriterandBufferedReaderinHttpChatCompletionLlmProvidernow use try-with-resourcesHttpChatCompletionLlmProviderTest(6 misconfiguration error-path tests) + newLlmProviderConfigTest(5 tests verifying bean factory methods produce correctly named/typed providers, including empty-endpoint edge case)Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
test.org/usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java -javaagent:/home/REDACTED/.m2/repository/org/jacoco/org.jacoco.agent/0.8.12/org.jacoco.agent-0.8.12-runtime.jar=destfile=/home/REDACTED/work/WISE-API/WISE-API/target/jacoco.exec -jar /home/REDACTED/work/WISE-API/WISE-API/target/surefire/surefirebooter-20260430170412250_3.jar /home/REDACTED/work/WISE-API/WISE-API/target/surefire 2026-04-30T17-04-12_174-jvmRun1 surefire-20260430170412250_1tmp surefire_0-20260430170412250_2tmp(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Follow up on the existing draft pull request #1 and revise the implementation so it better matches the intended scope of PR #1 (Provider Abstraction Core) for WISE-API.
Repository:
VM8gkAs/WISE-APIBase branch:
developContext:
PR #1 currently introduces a unified
LlmProviderabstraction for AI chat backends, but the current draft needs correction before it should be merged.Please update the existing work (or create a replacement PR if needed) with these required fixes:
Required fixes
Rename the provider implementation class to a more neutral name
OpenAiCompatibleLlmProvideris too specific and makes the Bedrock-backed bean conceptually confusing.HttpChatCompletionLlmProvider(choose the best repo-consistent name).Keep PR feat(llm): introduce unified LlmProvider abstraction for AI chat backends #1 intentionally small and foundational
Reduce overstatement in comments/docs
LlmProvider, configuration classes, and sample properties comments.Clean up the pull request presentation
Improve tests meaningfully
Non-goals
Success criteria
Please update the branch/PR so it is ready for local testing and eventual merge once reviewed.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: 1. forked,接下來如何架設,該如何測試? 自己的倉庫 Copilot 修改後如何在 Local 測試?
2. 我打算架設後使用 免費額度的Model 測試功能
forked:
https://github.com/VM8gkAs/WISE-Docker-Dev
https://github.com/VM8gkAs/WISE-Client
https://github.com/VM8gkAs/WISE-API
Assistant: 先做法:先把 Docker 開發環境跑起來,再把
WISE-Client/WISE-APIfork 接到 Docker 環境,最後只用便宜或免費額度 provider 測功能。你現在已經 fork 好 repo 了,下一步是可執行環境。
我先回答你的兩題,再給你一條最穩的實作路線。
1. fork 後接下來如何架設、如何測試、Copilot 改完如何本地測?
結論
最穩的方式是:
VM8gkAs/WISE-Docker-Dev架本地開發環境VM8gkAs/WISE-ClientVM8gkAs/WISE-API也就是說:
本地環境是你測試場;Copilot 負責改你 fork 的 repo;你在 local 驗證結果。
你可以怎麼理解整個流程
A. 建議整體架設順序
我建議這個順序,不要一開始三個 repo 一起亂接。
Step 1:先把
WISE-Docker-Dev跑起來目標:
你要先驗證:
Step 2:把 Docker Dev 指向你的 forks
目標:
通常這種 Docker dev repo 會:
WISE-ClientWISE-API你要把它改成:
VM8gkAs/WISE-ClientVM8gkAs/WISE-APIStep 3:先測「原樣 fork」能跑
非常重要。
在 Copilot 幫你改任何東西之前,你要先確認:
這樣之後出錯時,才知道問題是新改動造成,不是環境問題。
Step 4:再讓 Copilot 修改 fork
當環境穩定後,你再叫我做:
VM8gkAs/WISE-APIVM8gkAs/WISE-ClientCopilot 會改的是你 fork 的 repo,不是 upstream。
Step 5:在 local 拉 Copilot 的 branch/PR 測試
Copilot 開 PR 後,你本地可以:
這是最標準流程。
B. Copilot 修改後如何在 Local 測試?
這部分其實是重點。
方式 1:PR branch 測試
如果 Copilot 幫你在 fork repo 開 PR,通常你可以:
在本地 repo
然後重新啟動對應服務。
如果是 API 改動
通常需要:
如果是 Client 改動
通常需要:
方式 2:直接 pull Copilot 推的 branch
若 Copilot 沒開 PR、只推 ...
This pull request was created from Copilot chat.