mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-21 05:14:45 +08:00
rename the symbol
This commit is contained in:
@@ -93,7 +93,7 @@ def get_llm_by_type(
|
|||||||
return llm
|
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.
|
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())
|
conf = load_yaml_config(_get_config_file_path())
|
||||||
llm_type_config_keys = _get_llm_type_config_keys()
|
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):
|
for llm_type in get_args(LLMType):
|
||||||
# Get configuration from YAML file
|
# Get configuration from YAML file
|
||||||
@@ -120,9 +120,9 @@ def get_configured_llms() -> dict[str, list[str]]:
|
|||||||
# Check if model is configured
|
# Check if model is configured
|
||||||
model_name = merged_conf.get("model")
|
model_name = merged_conf.get("model")
|
||||||
if model_name:
|
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:
|
except Exception as e:
|
||||||
# Log error and return empty dict to avoid breaking the application
|
# Log error and return empty dict to avoid breaking the application
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ from src.server.rag_request import (
|
|||||||
RAGResourcesResponse,
|
RAGResourcesResponse,
|
||||||
)
|
)
|
||||||
from src.server.config_request import ConfigResponse
|
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
|
from src.tools import VolcengineTTS
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@@ -413,6 +413,6 @@ async def rag_resources(request: Annotated[RAGResourceRequest, Query()]):
|
|||||||
async def config():
|
async def config():
|
||||||
"""Get the config of the server."""
|
"""Get the config of the server."""
|
||||||
return ConfigResponse(
|
return ConfigResponse(
|
||||||
rag_config=RAGConfigResponse(provider=SELECTED_RAG_PROVIDER),
|
rag=RAGConfigResponse(provider=SELECTED_RAG_PROVIDER),
|
||||||
configured_llms=get_configured_llms(),
|
models=get_configured_llm_models(),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -9,5 +9,5 @@ from src.server.rag_request import RAGConfigResponse
|
|||||||
class ConfigResponse(BaseModel):
|
class ConfigResponse(BaseModel):
|
||||||
"""Response model for server config."""
|
"""Response model for server config."""
|
||||||
|
|
||||||
rag_config: RAGConfigResponse = Field(..., description="The config of the RAG")
|
rag: RAGConfigResponse = Field(..., description="The config of the RAG")
|
||||||
configured_llms: dict[str, list[str]] = Field(..., description="The configured LLM")
|
models: dict[str, list[str]] = Field(..., description="The configured models")
|
||||||
|
|||||||
Reference in New Issue
Block a user