langchain_experimental.rl_chain.base
.embed¶
- langchain_experimental.rl_chain.base.embed(to_embed: Union[str, _Embed, Dict, List[Union[str, _Embed]], List[Dict]], model: Any, namespace: Optional[str] = None) List[Dict[str, Union[str, List[str]]]] [source]¶
Embed the actions or context using the SentenceTransformer model (or a model that has an encode function).
- langchain_experimental.rl_chain.base.to_embed¶
(Union[Union(str, _Embed(str)), Dict, List[Union(str, _Embed(str))], List[Dict]], required) The text to be embedded, either a string, a list of strings or a dictionary or a list of dictionaries.
- langchain_experimental.rl_chain.base.namespace¶
(str, optional) The default namespace to use when dictionary or list of dictionaries not provided.
- langchain_experimental.rl_chain.base.model¶
(Any, required) The model to use for embedding
- Returns
A list of dictionaries where each dictionary has the namespace as the key and the embedded string as the value
- Return type
List[Dict[str, str]]
- Parameters
to_embed (Union[str, _Embed, Dict, List[Union[str, _Embed]], List[Dict]]) –
model (Any) –
namespace (Optional[str]) –