rename the symbol

This commit is contained in:
hetao
2025-06-11 14:10:18 +08:00
parent 8e68c13951
commit 6693d844a7
3 changed files with 9 additions and 9 deletions

View File

@@ -93,7 +93,7 @@ def get_llm_by_type(
return llm
def get_configured_llms() -> dict[str, list[str]]:
def get_configured_llm_models() -> dict[str, list[str]]:
"""
Get all configured LLM models grouped by type.
@@ -104,7 +104,7 @@ def get_configured_llms() -> dict[str, list[str]]:
conf = load_yaml_config(_get_config_file_path())
llm_type_config_keys = _get_llm_type_config_keys()
configured_llms: dict[str, list[str]] = {}
configured_models: dict[str, list[str]] = {}
for llm_type in get_args(LLMType):
# Get configuration from YAML file
@@ -120,9 +120,9 @@ def get_configured_llms() -> dict[str, list[str]]:
# Check if model is configured
model_name = merged_conf.get("model")
if model_name:
configured_llms.setdefault(llm_type, []).append(model_name)
configured_models.setdefault(llm_type, []).append(model_name)
return configured_llms
return configured_models
except Exception as e:
# Log error and return empty dict to avoid breaking the application

View File

@@ -39,7 +39,7 @@ from src.server.rag_request import (
RAGResourcesResponse,
)
from src.server.config_request import ConfigResponse
from src.llms.llm import get_configured_llms
from src.llms.llm import get_configured_llm_models
from src.tools import VolcengineTTS
logger = logging.getLogger(__name__)
@@ -413,6 +413,6 @@ async def rag_resources(request: Annotated[RAGResourceRequest, Query()]):
async def config():
"""Get the config of the server."""
return ConfigResponse(
rag_config=RAGConfigResponse(provider=SELECTED_RAG_PROVIDER),
configured_llms=get_configured_llms(),
rag=RAGConfigResponse(provider=SELECTED_RAG_PROVIDER),
models=get_configured_llm_models(),
)

View File

@@ -9,5 +9,5 @@ from src.server.rag_request import RAGConfigResponse
class ConfigResponse(BaseModel):
"""Response model for server config."""
rag_config: RAGConfigResponse = Field(..., description="The config of the RAG")
configured_llms: dict[str, list[str]] = Field(..., description="The configured LLM")
rag: RAGConfigResponse = Field(..., description="The config of the RAG")
models: dict[str, list[str]] = Field(..., description="The configured models")