chore(model): Modify siliconflow name (#2194)

This commit is contained in:
Fangyin Cheng
2024-12-12 16:47:14 +08:00
committed by GitHub
parent 4da1809b31
commit dab55493f5
10 changed files with 48 additions and 28 deletions

View File

@@ -175,10 +175,10 @@ class SiliconFlowRerankEmbeddings(OpenAPIRerankEmbeddings):
"""Initialize the SiliconFlowRerankEmbeddings."""
# If the API key is not provided, try to get it from the environment
if "api_key" not in kwargs:
kwargs["api_key"] = os.getenv("SILICON_FLOW_API_KEY")
kwargs["api_key"] = os.getenv("SILICONFLOW_API_KEY")
if "api_url" not in kwargs:
env_api_url = os.getenv("SILICON_FLOW_API_BASE")
env_api_url = os.getenv("SILICONFLOW_API_BASE")
if env_api_url:
env_api_url = env_api_url.rstrip("/")
kwargs["api_url"] = env_api_url + "/rerank"