mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-13 08:28:22 +08:00
## Summary - add the xAI `models` URL suffix used by the existing Go `ListModels` implementation - return a clear error when the xAI models suffix is missing - add focused xAI model-listing and connection-check regression tests ## What changed - Added `url_suffix.models` to `conf/models/xai.json`. - Normalized the configured models suffix before building the request URL. - Covered config loading, successful model listing, upstream errors, API-key validation, missing suffix handling, and `CheckConnection` delegation. ## Why `XAIModel.ListModels` already builds requests from `URLSuffix.Models`, and `CheckConnection` delegates to that method. The bundled xAI config did not define that suffix, which left the model-listing path unable to call the provider `/models` endpoint from the existing provider config. ## Validation - `go test ./internal/entity/models -run TestXAI -count=1` - `go test ./internal/entity -count=1` - `git diff HEAD~1..HEAD --check` ## Notes - `go test ./internal/entity/models -count=1` currently fails in unchanged Astraflow coverage: `TestAstraflowEmbedReturnsNoSuchMethod` panics before reaching any xAI assertions. --------- Co-authored-by: Jin Hai <haijin.chn@gmail.com>