mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
### Description Currently, when setting tenant default models (e.g., chat, embedding, rerank), the API only accepts the composite name (`model_name@model_instance@model_provider`). However, some integrations and front-end features prefer using the database `model_id` (UUID) directly. This PR adds support for `model_id` in default model configuration: 1. **Request Binding**: Added `model_id` (optional field) to the request body schema in the handler. 2. **Database Lookup**: If `model_id` is supplied, the service queries the database to resolve the respective provider, instance, and model names. 3. **Security Validation**: Verified that the provider associated with the resolved `model_id` belongs to the requesting tenant. 4. **Unit Tests**: Added `TestSetTenantDefaultModels_WithModelID` to verify DB ID resolution and tenant mapping.