### 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): |
||
|---|---|---|
| .. | ||
| auth | ||
| sdk | ||
| __init__.py | ||
| api_app.py | ||
| canvas_app.py | ||
| chunk_app.py | ||
| conversation_app.py | ||
| dialog_app.py | ||
| document_app.py | ||
| file2document_app.py | ||
| file_app.py | ||
| kb_app.py | ||
| langfuse_app.py | ||
| llm_app.py | ||
| plugin_app.py | ||
| system_app.py | ||
| tenant_app.py | ||
| user_app.py | ||