mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-03 14:22:13 +08:00
rename the symbol
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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(),
|
||||
)
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user