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
..
2026-05-20 14:10:15 +08:00
2026-05-15 18:41:43 +08:00
2026-05-18 12:03:33 +08:00
2026-05-18 12:03:33 +08:00
2026-05-21 15:32:56 +08:00
2026-05-22 18:02:01 +08:00
2026-05-21 15:32:49 +08:00
2026-05-21 15:32:49 +08:00
2026-05-21 11:52:56 +08:00
2026-05-15 18:41:43 +08:00
2026-05-22 11:52:18 +08:00
2026-05-22 11:52:18 +08:00
2026-05-18 14:31:16 +08:00
2026-05-20 14:10:15 +08:00
2026-04-27 14:53:33 +08:00
2026-05-18 16:57:42 +08:00
2026-05-15 18:41:43 +08:00
2026-05-15 18:41:43 +08:00
2026-05-25 12:12:57 +08:00
2026-05-22 11:52:18 +08:00
2026-05-19 10:49:33 +08:00
2026-05-11 11:25:17 +08:00
2026-05-15 18:41:43 +08:00
2026-05-21 11:49:18 +08:00
2026-05-21 11:49:18 +08:00
2026-05-22 15:24:52 +08:00
2026-05-22 18:02:30 +08:00
2026-05-15 18:41:43 +08:00
2026-05-25 11:04:39 +08:00
2026-05-25 16:04:17 +08:00
2026-05-20 14:10:15 +08:00
2026-05-18 12:03:12 +08:00
2026-05-18 12:03:12 +08:00
2026-05-15 18:41:43 +08:00
2026-05-13 19:35:19 +08:00
2026-05-15 18:41:43 +08:00
2026-05-14 09:46:54 +08:00
2026-05-15 18:41:43 +08:00
2026-05-20 19:21:57 +08:00
2026-05-19 10:49:33 +08:00
2026-05-18 16:57:42 +08:00
2026-05-21 15:33:14 +08:00
2026-05-22 11:52:18 +08:00
2026-05-21 18:28:06 +08:00
2026-05-21 10:13:15 +08:00
2026-05-21 10:19:17 +08:00
2026-05-21 18:28:06 +08:00
2026-05-11 17:21:16 +08:00
2026-05-15 18:41:43 +08:00
2026-05-25 18:55:03 +08:00
2026-05-25 10:25:53 +08:00
2026-05-25 10:25:53 +08:00
2026-05-22 15:19:38 +08:00
2026-05-22 15:19:38 +08:00
2026-05-25 12:12:57 +08:00
2026-05-22 11:52:18 +08:00
2026-05-21 15:33:02 +08:00
2026-05-21 15:33:02 +08:00
2026-05-22 11:52:18 +08:00
2026-05-22 11:52:18 +08:00
2026-05-22 11:52:18 +08:00
2026-05-21 15:32:41 +08:00
2026-05-18 16:57:42 +08:00
2026-05-15 18:41:43 +08:00
2026-05-22 11:52:18 +08:00
2026-05-21 20:57:04 +08:00
2026-05-25 16:02:50 +08:00
2026-05-22 15:21:45 +08:00
2026-05-22 15:21:45 +08:00
2026-05-19 10:49:33 +08:00
2026-05-21 15:33:21 +08:00
2026-05-21 15:33:21 +08:00
2026-05-15 13:27:22 +08:00
2026-05-15 18:41:43 +08:00
2026-05-15 18:41:43 +08:00
2026-05-14 09:46:54 +08:00
2026-05-15 18:41:43 +08:00
2026-05-15 18:41:43 +08:00
2026-05-22 11:52:18 +08:00
2026-05-21 18:28:06 +08:00
2026-05-22 11:52:18 +08:00
2026-05-22 11:53:18 +08:00
2026-05-26 10:50:06 +08:00
2026-05-26 10:50:06 +08:00