mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-03 18:17:45 +00:00
feat(model): Support tongyi embedding (#1552)
Co-authored-by: 无剑 <zhuzhenchao@changeme.com> Co-authored-by: csunny <cfqsunny@163.com> Co-authored-by: aries_ckt <916701291@qq.com>
This commit is contained in:
@@ -50,6 +50,14 @@ class EmbeddingLoader:
|
||||
if proxy_param.proxy_backend:
|
||||
openapi_param["model_name"] = proxy_param.proxy_backend
|
||||
return OpenAPIEmbeddings(**openapi_param)
|
||||
elif model_name in ["proxy_tongyi"]:
|
||||
from dbgpt.rag.embedding import TongYiEmbeddings
|
||||
|
||||
proxy_param = cast(ProxyEmbeddingParameters, param)
|
||||
tongyi_param = {"api_key": proxy_param.proxy_api_key}
|
||||
if proxy_param.proxy_backend:
|
||||
tongyi_param["model_name"] = proxy_param.proxy_backend
|
||||
return TongYiEmbeddings(**tongyi_param)
|
||||
elif model_name in ["proxy_ollama"]:
|
||||
from dbgpt.rag.embedding import OllamaEmbeddings
|
||||
|
||||
|
@@ -665,8 +665,7 @@ class ProxyEmbeddingParameters(BaseEmbeddingModelParameters):
|
||||
|
||||
|
||||
_EMBEDDING_PARAMETER_CLASS_TO_NAME_CONFIG = {
|
||||
ProxyEmbeddingParameters: "proxy_openai,proxy_azure,proxy_http_openapi,"
|
||||
"proxy_ollama,rerank_proxy_http_openapi",
|
||||
ProxyEmbeddingParameters: "proxy_openai,proxy_azure,proxy_http_openapi,proxy_ollama,proxy_tongyi,rerank_proxy_http_openapi",
|
||||
}
|
||||
|
||||
EMBEDDING_NAME_TO_PARAMETER_CLASS_CONFIG = {}
|
||||
|
Reference in New Issue
Block a user