From 8ea8817e7d3632aa90bb7045c4b93ed9824751ed Mon Sep 17 00:00:00 2001 From: you-n-g Date: Wed, 19 Mar 2025 12:27:45 +0800 Subject: [PATCH] fix: default emb model (#702) * fix: Remove incorrect prefix from default embedding model name * refactor: Consolidate model settings in LLMSettings class --- rdagent/oai/backend/litellm.py | 2 +- rdagent/oai/llm_conf.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/rdagent/oai/backend/litellm.py b/rdagent/oai/backend/litellm.py index 0f069e66..1689ed73 100644 --- a/rdagent/oai/backend/litellm.py +++ b/rdagent/oai/backend/litellm.py @@ -45,7 +45,7 @@ class LiteLLMAPIBackend(APIBackend): """ response_list = [] for input_content_iter in input_content_list: - model_name = LITELLM_SETTINGS.embedding_model or "azure/text-embedding-3-small" + model_name = LITELLM_SETTINGS.embedding_model logger.info(f"{LogColors.GREEN}Using emb model{LogColors.END} {model_name}", tag="debug_litellm_emb") logger.info(f"Creating embedding for: {input_content_iter}", tag="debug_litellm_emb") if not isinstance(input_content_iter, str): diff --git a/rdagent/oai/llm_conf.py b/rdagent/oai/llm_conf.py index 34c564e9..bbb13665 100644 --- a/rdagent/oai/llm_conf.py +++ b/rdagent/oai/llm_conf.py @@ -11,6 +11,9 @@ class LLMSettings(ExtendedBaseSettings): # backend backend: str = "rdagent.oai.backend.DeprecBackend" + chat_model: str = "gpt-4-turbo" + embedding_model: str = "text-embedding-3-small" + # TODO: most of the settings are only used on deprec.DeprecBackend. # So they should move the settings to that folder. @@ -48,7 +51,6 @@ class LLMSettings(ExtendedBaseSettings): chat_openai_base_url: str | None = None # chat_azure_api_base: str = "" chat_azure_api_version: str = "" - chat_model: str = "gpt-4-turbo" chat_max_tokens: int = 3000 chat_temperature: float = 0.5 chat_stream: bool = True @@ -68,7 +70,6 @@ class LLMSettings(ExtendedBaseSettings): embedding_openai_base_url: str = "" embedding_azure_api_base: str = "" embedding_azure_api_version: str = "" - embedding_model: str = "" embedding_max_str_num: int = 50 # offline llama2 related config