RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge RAG with Agent capabilities to create a superior context layer for LLMs
fix(go-models): validate TokenHub chat requests (#15283)
## Summary - centralize TokenHub chat request validation for chat and streaming calls - reject blank TokenHub model names before sending provider requests - send TokenHub model listing requests as bodyless GET requests ## What changed - Added shared TokenHub chat request validation for API key, model name, and messages. - Updated `ListModels` to call `GET /models` without a request body. - Added focused tests for blank model names and accidental GET request bodies. - Replaced an httptest handler callback `t.Fatalf` with `t.Errorf` plus an HTTP error and return. ## Why TokenHub chat requests should fail locally for invalid model names instead of sending avoidable malformed requests upstream. Model listing should also match normal GET semantics and avoid sending an empty JSON body. Closes #14736 Co-authored-by: Jin Hai <haijin.chn@gmail.com>
O
oktofeesh committed
7fb9a26623b0ed67b20c34d00b037579d71d2cb4
Parent: ae88578
Committed by GitHub <noreply@github.com>
on 5/27/2026, 6:39:41 AM