Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,6 @@ def embed_documents(self, model: str, client: ZhipuAI, texts: list[str]) -> tupl

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:
"""
Calculate response usage
Expand Down