MCPcopy Create free account
hub / github.com/agent0ai/agent-zero / embed_query

Method embed_query

models.py:870–878  ·  view source on GitHub ↗
(self, text: str)

Source from the content-addressed store, hash-verified

868 return embeddings.tolist() if hasattr(embeddings, "tolist") else embeddings # type: ignore
869
870 def embed_query(self, text: str) -> List[float]:
871 # Apply rate limiting if configured
872 apply_rate_limiter_sync(self.a0_model_conf, text)
873
874 embedding = self.model.encode([text], convert_to_tensor=False) # type: ignore
875 result = (
876 embedding[0].tolist() if hasattr(embedding[0], "tolist") else embedding[0]
877 )
878 return result # type: ignore
879
880
881def _get_litellm_chat(

Callers

nothing calls this directly

Calls 3

apply_rate_limiter_syncFunction · 0.85
tolistMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected