oktofeesh
8468227a1a
fix(go-models): harden 302.AI driver requests ( #15289 )
...
## Summary
- Harden the 302.AI model driver request validation and response parsing
paths.
- Add focused tests for chat request mode, model listing, malformed
provider responses, and input validation.
## What changed
- Validate API keys, model names, rerank queries, ASR file paths, OCR
inputs, parse URLs, task IDs, and model-list IDs before use.
- Keep chat and streaming methods from accepting conflicting `stream`
values in request payloads.
- Send `ListModels` as a bodyless GET and parse the response with typed
JSON structs instead of unchecked assertions.
- Remove raw SSE event logging from stream handling.
## Why
The driver could panic or send inconsistent requests when optional
config fields were nil, empty, malformed, or contradicted the method
path. This keeps provider-driver behavior explicit while preserving the
existing supported 302.AI flows.
Closes #14736
2026-05-28 13:33:01 +08:00
..
2026-05-28 13:33:01 +08:00
2026-05-28 13:33:01 +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-26 10:51:05 +08:00
2026-05-26 17:10:06 +08:00
2026-05-26 17:10:06 +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-26 10:52:09 +08:00
2026-05-26 10:52:09 +08:00
2026-05-15 18:41:43 +08:00
2026-05-15 18:41:43 +08:00
2026-05-27 13:19:39 +08:00
2026-05-22 11:52:18 +08:00
2026-05-26 10:51:29 +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-26 17:13:15 +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-26 19:58:53 +08:00
2026-05-26 19:58:53 +08:00
2026-05-27 14:08:35 +08:00
2026-05-27 14:08:35 +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-26 18:18:46 +08:00
2026-05-26 18:18:46 +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-26 18:20:33 +08:00
2026-05-27 14:08:35 +08:00
2026-05-27 14:08:35 +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-27 13:19:39 +08:00
2026-05-22 11:52:18 +08:00
2026-05-27 14:07:00 +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-27 14:39:41 +08:00
2026-05-27 14:39:41 +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-27 13:14:56 +08:00
2026-05-27 13:14:56 +08:00
2026-05-14 09:46:54 +08:00
2026-05-15 18:41:43 +08:00
2026-05-26 19:58:20 +08:00
2026-05-27 14:08:35 +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