Files
ragflow/conf/models/zhipu-ai.json
Jake Armstrong b961810e79 Go: implement OCR in ZhipuAI driver (#15143)
### What problem does this PR solve?

Closes #15142.

ZhipuAI lists `glm-ocr` as an OCR model, but the Go driver still
returned `no such method` from `OCRFile`. This wires the advertised
model to Z.AI's documented `layout_parsing` endpoint and returns the
`md_results` Markdown output through the existing `OCRFileResponse.Text`
field.

This PR also adds focused tests for URL input, raw file-content base64
input, and validation errors.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [ ] New Feature (non-breaking change which adds functionality)
- [ ] Documentation Update
- [ ] Refactoring
- [ ] Performance Improvement
- [ ] Other (please describe):

### Test

- [x] `go test -vet=off ./internal/entity/models -run
'TestZhipuAIOCRFile'`
2026-05-26 10:50:06 +08:00

275 lines
4.8 KiB
JSON

{
"name": "ZHIPU-AI",
"url": {
"default": "https://open.bigmodel.cn/api/paas/v4"
},
"url_suffix": {
"chat": "chat/completions",
"async_chat": "async/chat/completions",
"async_result": "async-result",
"embedding": "embeddings",
"rerank": "rerank",
"ocr": "layout_parsing",
"asr": "audio/transcriptions",
"tts": "audio/speech",
"files": "files",
"models": "models"
},
"class": "glm",
"models": [
{
"name": "glm-5",
"max_tokens": 204800,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-5-turbo",
"max_tokens": 204800,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-5v-turbo",
"max_tokens": 204800,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.7",
"max_tokens": 204800,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.7-flashx",
"max_tokens": 204800,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.6",
"max_tokens": 204800,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.6v-Flash",
"max_tokens": 131072,
"model_types": [
"chat",
"vision"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.5",
"max_tokens": 131072,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.5-x",
"max_tokens": 131072,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.5-air",
"max_tokens": 131072,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.5-airx",
"max_tokens": 131072,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.5-flash",
"max_tokens": 131072,
"model_types": [
"chat"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4.5v",
"max_tokens": 64000,
"model_types": [
"vision"
],
"thinking": {
"default_value": true,
"clear_thinking": true
}
},
{
"name": "glm-4-plus",
"max_tokens": 131072,
"model_types": [
"chat"
]
},
{
"name": "glm-4-0520",
"max_tokens": 131072,
"model_types": [
"chat"
]
},
{
"name": "glm-4",
"max_tokens": 131072,
"model_types": [
"chat"
]
},
{
"name": "glm-4-airx",
"max_tokens": 8000,
"model_types": [
"chat"
]
},
{
"name": "glm-4-air",
"max_tokens": 131072,
"model_types": [
"chat"
]
},
{
"name": "glm-4-flash",
"max_tokens": 131072,
"model_types": [
"chat"
]
},
{
"name": "glm-4-flashx",
"max_tokens": 131072,
"model_types": [
"chat"
]
},
{
"name": "glm-4-long",
"max_tokens": 1000000,
"model_types": [
"chat"
]
},
{
"name": "glm-4v",
"max_tokens": 2000,
"model_types": [
"vision"
]
},
{
"name": "glm-4-9b",
"max_tokens": 8192,
"model_types": [
"chat"
]
},
{
"name": "embedding-2",
"max_tokens": 512,
"model_types": [
"embedding"
]
},
{
"name": "embedding-3",
"max_tokens": 512,
"model_types": [
"embedding"
]
},
{
"name": "glm-asr-2512",
"max_tokens": 4096,
"model_types": [
"asr"
]
},
{
"name": "glm-tts",
"model_types": [
"tts"
]
},
{
"name": "glm-ocr",
"model_types": [
"ocr"
]
},
{
"name": "rerank",
"model_types": [
"rerank"
]
}
]
}