From ae5f48f233ac9106f235eb788c503666022e2bdc Mon Sep 17 00:00:00 2001 From: Alexander Laurent <57456290+Helios531@users.noreply.github.com> Date: Tue, 26 May 2026 20:06:34 -1000 Subject: [PATCH] feat: add GiteeAI provider support to Go API server (#15131) ### What problem does this PR solve? Closes #15090. Adds GiteeAI support to the Go model-provider layer so GiteeAI chat models can be routed through the Go API server using the same OpenAI-compatible chat, streaming, model listing, and connection-check flow used by other SaaS providers. GiteeAI is implemented as a separate provider from the existing `gitee` provider. ### Type of change - [x] New Feature (non-breaking change which adds functionality) ## Summary - Added a GiteeAI Go model driver. - Added the GiteeAI provider catalog with default base URL `https://ai.gitee.com/v1`. - Registered `giteeai` in the model factory separately from `gitee`. - Added focused provider tests for sync chat, streaming chat, model listing, connection checks, base URL override, SSE parsing, `[DONE]` handling, and unsupported methods. ## What changed - Implemented `ChatWithMessages` for `POST /chat/completions`. - Implemented `ChatStreamlyWithSender` with SSE parsing, `delta` extraction, `finish_reason`, `[DONE]`, and `` tag handling. - Implemented `ListModels` for `GET /models`. - Implemented `CheckConnection` by delegating to `ListModels`. - Returned standard `no such method` errors for unsupported embedding, rerank, image-to-text, ASR, and TTS paths. ## Tests ```bash go test -vet=off ./internal/entity/models -run 'TestGiteeAI' -count=1 go test -vet=off ./internal/entity -run 'Test.*Provider|Test.*Model' -count=1 ``` --------- Co-authored-by: Jin Hai --- conf/models/gitee.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/models/gitee.json b/conf/models/gitee.json index 9b9a16f804..f2989f0244 100644 --- a/conf/models/gitee.json +++ b/conf/models/gitee.json @@ -1,7 +1,9 @@ { "name": "Gitee", "url": { - "default": "https://api.moark.com/v1" + "default": "https://api.moark.ai/v1", + "china": "https://api.moark.com/v1", + "deprecated": "https://ai.gitee.com/v1" }, "url_suffix": { "chat": "chat/completions", @@ -82,4 +84,4 @@ ] } ] -} \ No newline at end of file +}