浏览代码

Fix: Tried to fix the fid mis match under some cases (#7426)

### What problem does this PR solve?

https://github.com/infiniflow/ragflow/issues/7407

Based on this context, I think there should be some reasons that let
some LLMs have a mismatch (add the wrong "@xxx"),
So I think when use fid can not fetch llm then tried to just use name
should can fetch it.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.19.0
Stephen Hu 6 个月前
父节点
当前提交
2dbcc0a1bf
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4
    0
      api/db/services/llm_service.py

+ 4
- 0
api/db/services/llm_service.py 查看文件

@@ -100,9 +100,13 @@ class TenantLLMService(CommonService):

model_config = cls.get_api_key(tenant_id, mdlnm)
mdlnm, fid = TenantLLMService.split_model_name_and_factory(mdlnm)
if not model_config: # for some cases seems fid mismatch
model_config = cls.get_api_key(tenant_id, mdlnm)
if model_config:
model_config = model_config.to_dict()
llm = LLMService.query(llm_name=mdlnm) if not fid else LLMService.query(llm_name=mdlnm, fid=fid)
if not llm and fid: # for some cases seems fid mismatch
llm = LLMService.query(llm_name=mdlnm)
if llm:
model_config["is_tools"] = llm[0].is_tools
if not model_config:

正在加载...
取消
保存