|
|
|
|
|
|
|
|
|
|
|
|
|
|
model_config = cls.get_api_key(tenant_id, mdlnm) |
|
|
model_config = cls.get_api_key(tenant_id, mdlnm) |
|
|
mdlnm, fid = TenantLLMService.split_model_name_and_factory(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: |
|
|
if model_config: |
|
|
model_config = model_config.to_dict() |
|
|
model_config = model_config.to_dict() |
|
|
llm = LLMService.query(llm_name=mdlnm) if not fid else LLMService.query(llm_name=mdlnm, fid=fid) |
|
|
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: |
|
|
if llm: |
|
|
model_config["is_tools"] = llm[0].is_tools |
|
|
model_config["is_tools"] = llm[0].is_tools |
|
|
if not model_config: |
|
|
if not model_config: |