mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-10-07 14:06:44 +00:00

### What problem does this PR solve? **Issue Description:** When using the `/api/retrieval` endpoint with a POST request and setting the `keyword` parameter to `true`, the system invokes the `model_instance` method from `TenantLLMService` to create a `chat_mdl` instance. Subsequently, it calls the `keyword_extraction` method to extract keywords. However, within the `keyword_extraction` method, the `chat` function of the LLM attempts to access the `chat_mdl.max_length` attribute to validate input length. This results in the following error: ``` AttributeError: 'SILICONFLOWChat' object has no attribute 'max_length' ``` **Proposed Solution:** Upon reviewing other parts of the codebase where `chat_mdl` instances are created, it appears that utilizing `LLMBundle` for instantiation is more appropriate. `LLMBundle` includes the `max_length` attribute, which should resolve the encountered error. ### 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):