mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-11 22:25:41 +08:00
### 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 `<think>` 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 <haijin.chn@gmail.com>
1.5 KiB
1.5 KiB