MCPcopy Index your code
hub / github.com/agent0ai/agent-zero / embed_query

Method embed_query

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

Source from the content-addressed store, hash-verified

815 ]
816
817 def embed_query(self, text: str) -> List[float]:
818 configure_litellm()
819 # Apply rate limiting if configured
820 apply_rate_limiter_sync(self.a0_model_conf, text)
821
822 resp = embedding(
823 model=self.model_name,
824 input=[text],
825 **_merge_litellm_call_kwargs(self.kwargs),
826 )
827 item = resp.data[0] # type: ignore
828 return item.get("embedding") if isinstance(item, dict) else item.embedding # type: ignore
829
830
831class LocalSentenceTransformerWrapper(Embeddings):

Callers 2

__init__Method · 0.45
initializeMethod · 0.45

Calls 4

configure_litellmFunction · 0.85
apply_rate_limiter_syncFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected