mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: Can't add more models (#11076)
### What problem does this PR solve? Currently we cannot add any models, since factory is a string, and the return type of get_allowed_llm_factories() is List[object] https://github.com/infiniflow/ragflow/pull/11003 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -128,7 +128,7 @@ def add_llm():
|
|||||||
api_key = req.get("api_key", "x")
|
api_key = req.get("api_key", "x")
|
||||||
llm_name = req.get("llm_name")
|
llm_name = req.get("llm_name")
|
||||||
|
|
||||||
if factory not in get_allowed_llm_factories():
|
if factory not in [f.name for f in get_allowed_llm_factories()]:
|
||||||
return get_data_error_result(message=f"LLM factory {factory} is not allowed")
|
return get_data_error_result(message=f"LLM factory {factory} is not allowed")
|
||||||
|
|
||||||
def apikey_json(keys):
|
def apikey_json(keys):
|
||||||
|
|||||||
Reference in New Issue
Block a user