Files
ragflow/conf/models/gitee.json
Alexander Laurent ae5f48f233 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 `<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>
2026-05-27 14:06:34 +08:00

88 lines
1.5 KiB
JSON

{
"name": "Gitee",
"url": {
"default": "https://api.moark.ai/v1",
"china": "https://api.moark.com/v1",
"deprecated": "https://ai.gitee.com/v1"
},
"url_suffix": {
"chat": "chat/completions",
"models": "models",
"status": "",
"balance": "tokens/packages/balance",
"embedding": "embeddings",
"rerank": "rerank",
"ocr": "images/ocr",
"doc_parse": "async/documents/parse",
"tasks": "tasks",
"task": "task"
},
"models": [
{
"name": "qwen3-8b",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "qwen3-0.6b",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "glm-4.7-flash",
"max_tokens": 204800,
"model_types": [
"chat"
]
},
{
"name": "BAAI/bge-reranker-v2-m3",
"max_tokens": 8192,
"model_types": [
"rerank"
]
},
{
"name": "BAAI/bge-m3",
"max_tokens": 8192,
"model_types": [
"embedding"
]
},
{
"name": "GOT-OCR2_0",
"model_types": [
"ocr"
]
},
{
"name": "DeepSeek-OCR-2",
"model_types": [
"ocr"
]
},
{
"name": "PaddleOCR-VL-1.5",
"model_types": [
"ocr"
]
},
{
"name": "HunyuanOCR",
"model_types": [
"ocr"
]
},
{
"name": "MinerU2.5",
"model_types": [
"doc_parse"
]
}
]
}