mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
layout refine (#115)
This commit is contained in:
@ -82,8 +82,19 @@ def set_api_key():
|
||||
@login_required
|
||||
def my_llms():
|
||||
try:
|
||||
objs = TenantLLMService.get_my_llms(current_user.id)
|
||||
return get_json_result(data=objs)
|
||||
res = {}
|
||||
for o in TenantLLMService.get_my_llms(current_user.id):
|
||||
if o["llm_factory"] not in res:
|
||||
res[o["llm_factory"]] = {
|
||||
"tags": o["tags"],
|
||||
"llm": []
|
||||
}
|
||||
res[o["llm_factory"]]["llm"].append({
|
||||
"type": o["model_type"],
|
||||
"name": o["model_name"],
|
||||
"used_token": o["used_tokens"]
|
||||
})
|
||||
return get_json_result(data=res)
|
||||
except Exception as e:
|
||||
return server_error_response(e)
|
||||
|
||||
|
||||
@ -49,7 +49,9 @@ class TenantLLMService(CommonService):
|
||||
LLMFactories.logo,
|
||||
LLMFactories.tags,
|
||||
cls.model.model_type,
|
||||
cls.model.llm_name]
|
||||
cls.model.llm_name,
|
||||
cls.model.used_tokens
|
||||
]
|
||||
objs = cls.model.select(*fields).join(LLMFactories, on=(cls.model.llm_factory == LLMFactories.name)).where(
|
||||
cls.model.tenant_id == tenant_id).dicts()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user