Files
ragflow/conf/models/baichuan.json
Haruko386 ebab3513c4 Go: implement provider: Baichuan (#14832)
### What problem does this PR solve?

This PR completes the Baichuan provider

**The following functionalities are now supported:**

**Baichuan:**
- [x] Chat / Stream Chat
- [x] Embedding
- [ ] ~~Rerank~~
- [ ] ~~Model listing~~
- [ ] ~~Provider connection checking~~
- [ ] ~~Balance~~

**Verified examples from the CLI:**

```plaintext
# Baichuan

RAGFlow(user)> embed text 'walkerwhat' 'jumperwho' with 'Baichuan-Text-Embedding@test@baichuan' dimension 16;
+-----------+-------+
| dimension | index |
+-----------+-------+
| 1024      | 0     |
| 1024      | 1     |
+-----------+-------+

AGFlow(user)> chat with 'Baichuan-M2@test@baichuan' message 'who r u'
Answer: I'm BaiChuan, a helpful AI assistant created by Baichuan-AI. I'm designed to be a knowledgeable, friendly, and reliable assistant for various tasks like answering questions, explaining concepts, writing content, and more. Feel free to ask me anything! 😊
Time: 1.637975

RAGFlow(user)> stream chat with 'Baichuan-M2@test@baichuan' message 'who r u'
Answer: I'm BaiChuan-m2, an AI assistant developed by Baichuan-AI. My purpose is to help you with a wide range of tasks by providing information, answering questions, solving problems, and assisting with creative projects. Think of me as a helpful digital companion! If you have any questions or need assistance, just let me know.😊
Time: 1.692321
```

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
- [x] Refactoring
2026-05-12 16:10:32 +08:00

90 lines
1.5 KiB
JSON

{
"name": "Baichuan",
"url": {
"default": "https://api.baichuan-ai.com/v1"
},
"url_suffix": {
"chat": "chat/completions",
"embedding": "embeddings"
},
"class": "baichuan",
"models": [
{
"name": "Baichuan4",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "Baichuan4-Air",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "Baichuan4-Turbo",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "Baichuan-M3",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "Baichuan-M3-plus",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "Baichuan-M2-plus",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "Baichuan-M2",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "Baichuan3-Turbo",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "Baichuan3-Turbo-128k",
"max_tokens": 131072,
"model_types": [
"chat"
]
},
{
"name": "Baichuan2-Turbo",
"max_tokens": 32768,
"model_types": [
"chat"
]
},
{
"name": "Baichuan-Text-Embedding",
"max_tokens": 8192,
"model_types": [
"embedding"
]
}
]
}