瀏覽代碼

fix: drop useless and wrong code for zhipu embedding (#11069)

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
tags/0.12.1
yihong 11 月之前
父節點
當前提交
2e00829b1e
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 0 行新增11 行删除
  1. 0
    11
      api/core/model_runtime/model_providers/zhipuai/text_embedding/text_embedding.py

+ 0
- 11
api/core/model_runtime/model_providers/zhipuai/text_embedding/text_embedding.py 查看文件



return [list(map(float, e)) for e in embeddings], embedding_used_tokens return [list(map(float, e)) for e in embeddings], embedding_used_tokens


def embed_query(self, text: str) -> list[float]:
"""Call out to ZhipuAI's embedding endpoint.

Args:
text: The text to embed.

Returns:
Embeddings for the text.
"""
return self.embed_documents([text])[0]

def _calc_response_usage(self, model: str, credentials: dict, tokens: int) -> EmbeddingUsage: def _calc_response_usage(self, model: str, credentials: dict, tokens: int) -> EmbeddingUsage:
""" """
Calculate response usage Calculate response usage

Loading…
取消
儲存