id stringlengths 14 15 | text stringlengths 44 2.47k | source stringlengths 61 181 |
|---|---|---|
4995e2b1589e-4 | to the model provider API call.
Returns
Top model prediction as a message.
async astream(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → AsyncIterator[str]¶
Default implementation of astream, which calls ainvoke.
Subclasse... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html |
4995e2b1589e-5 | input is still being generated.
batch(inputs: List[Union[PromptValue, str, List[BaseMessage]]], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Any) → List[str]¶
Default implementation of batch, which calls invoke N times.
Subclasses should override th... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html |
4995e2b1589e-6 | Compute doc embeddings using a HuggingFace transformer model.
Parameters
texts – The list of texts to embed.s
Returns
List of embeddings, one for each text.
embed_query(text: str) → List[float]¶
Compute query embeddings using a HuggingFace transformer model.
Parameters
text – The text to embed.
Returns
Embeddings for t... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html |
4995e2b1589e-7 | API.
Use this method when you want to:
take advantage of batched calls,
need more output from the model than just the top generated value,
are building chains that are agnostic to the underlying language modeltype (e.g., pure text completion models vs chat models).
Parameters
prompts – List of PromptValues. A PromptVal... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html |
4995e2b1589e-8 | Returns
The sum of the number of tokens across the messages.
get_token_ids(text: str) → List[int]¶
Return the ordered ids of the tokens in a text.
Parameters
text – The string input to tokenize.
Returns
A list of ids corresponding to the tokens in the text, in order they occurin the text.
invoke(input: Union[PromptValu... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html |
4995e2b1589e-9 | by calling invoke() with each input.
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = No... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html |
4995e2b1589e-10 | save(file_path: Union[Path, str]) → None¶
Save the LLM.
Parameters
file_path – Path to file to save the LLM to.
Example:
.. code-block:: python
llm.save(file_path=”path/llm.yaml”)
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmethod schema_json(*, by_alias... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html |
4995e2b1589e-11 | Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.base.Runnable[~langchain.schema.runnable.utils.Input, ~langchain.schema.runnable.utils.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,)) →... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html |
78dc822cc66f-0 | langchain.embeddings.elasticsearch.ElasticsearchEmbeddings¶
class langchain.embeddings.elasticsearch.ElasticsearchEmbeddings(client: MlClient, model_id: str, *, input_field: str = 'text_field')[source]¶
Elasticsearch embedding models.
This class provides an interface to generate embeddings using a model deployed
in an ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.elasticsearch.ElasticsearchEmbeddings.html |
78dc822cc66f-1 | Initialize the ElasticsearchEmbeddings instance.
Parameters
client (MlClient) – An Elasticsearch ML client object.
model_id (str) – The model_id of the model deployed in the Elasticsearch
cluster.
input_field (str) – The name of the key for the input text field in the
document. Defaults to ‘text_field’.
async aembed_do... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.elasticsearch.ElasticsearchEmbeddings.html |
78dc822cc66f-2 | es_user – (str, optional): Elasticsearch username.
es_password – (str, optional): Elasticsearch password.
Example
from langchain.embeddings import ElasticsearchEmbeddings
# Define the model ID and input field name (if different from default)
model_id = "your_model_id"
# Optional, only if different from 'text_field'
inp... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.elasticsearch.ElasticsearchEmbeddings.html |
78dc822cc66f-3 | Example
from elasticsearch import Elasticsearch
from langchain.embeddings import ElasticsearchEmbeddings
# Define the model ID and input field name (if different from default)
model_id = "your_model_id"
# Optional, only if different from 'text_field'
input_field = "your_input_field"
# Create Elasticsearch connection
es... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.elasticsearch.ElasticsearchEmbeddings.html |
5f64b52f5f07-0 | langchain.embeddings.xinference.XinferenceEmbeddings¶
class langchain.embeddings.xinference.XinferenceEmbeddings(server_url: Optional[str] = None, model_uid: Optional[str] = None)[source]¶
Wrapper around xinference embedding models.
To use, you should have the xinference library installed:
pip install xinference
Check ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.xinference.XinferenceEmbeddings.html |
5f64b52f5f07-1 | embed_query(text)
Embed a query of documents using Xinference.
__init__(server_url: Optional[str] = None, model_uid: Optional[str] = None)[source]¶
async aembed_documents(texts: List[str]) → List[List[float]]¶
Asynchronous Embed search docs.
async aembed_query(text: str) → List[float]¶
Asynchronous Embed query text.
em... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.xinference.XinferenceEmbeddings.html |
84067d4357eb-0 | langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding¶
class langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding[source]¶
Bases: AlephAlphaAsymmetricSemanticEmbedding
The symmetric version of the Aleph Alpha’s semantic embeddings.
The main difference is that here, both the documents an... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
84067d4357eb-1 | Determines in which datacenters the request may be processed.
You can either set the parameter to “aleph-alpha” or omit it (defaulting to None).
Not setting this value, or setting it to None, gives us maximal flexibility
in processing your request in our
own datacenters and on servers hosted with other providers.
Choos... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
84067d4357eb-2 | Asynchronous Embed query text.
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
84067d4357eb-3 | Returns
List of embeddings, one for each text.
embed_query(text: str) → List[float][source]¶
Call out to Aleph Alpha’s asymmetric, query embedding endpoint
:param text: The text to embed.
Returns
Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingI... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
84067d4357eb-4 | classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
classmethod validate(value: Any) → Model¶
Examples using AlephAlphaSymmetricSemanticEmbedding¶
Aleph Alpha | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html |
9f0dc2e0d219-0 | langchain.embeddings.embaas.EmbaasEmbeddingsPayload¶
class langchain.embeddings.embaas.EmbaasEmbeddingsPayload[source]¶
Payload for the Embaas embeddings API.
Attributes
model
texts
instruction
Methods
__init__(*args, **kwargs)
clear()
copy()
fromkeys([value])
Create a new dictionary with keys from iterable and values ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.embaas.EmbaasEmbeddingsPayload.html |
9f0dc2e0d219-1 | keys() → a set-like object providing a view on D's keys¶
pop(k[, d]) → v, remove specified key and return the corresponding value.¶
If the key is not found, return the default if given; otherwise,
raise a KeyError.
popitem()¶
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.embaas.EmbaasEmbeddingsPayload.html |
89b2fac68429-0 | langchain.embeddings.awa.AwaEmbeddings¶
class langchain.embeddings.awa.AwaEmbeddings[source]¶
Bases: BaseModel, Embeddings
Embedding documents and queries with Awa DB.
client¶
The AwaEmbedding client.
model¶
The name of the model used for embedding.
Default is “all-mpnet-base-v2”.
Create a new model by parsing and vali... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.awa.AwaEmbeddings.html |
89b2fac68429-1 | the new model: you should trust this data
deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[boo... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.awa.AwaEmbeddings.html |
89b2fac68429-2 | classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.awa.AwaEmbeddings.html |
2f2c7876ec56-0 | langchain.embeddings.gpt4all.GPT4AllEmbeddings¶
class langchain.embeddings.gpt4all.GPT4AllEmbeddings[source]¶
Bases: BaseModel, Embeddings
GPT4All embedding models.
To use, you should have the gpt4all python package installed
Example
from langchain.embeddings import GPT4AllEmbeddings
embeddings = GPT4AllEmbeddings()
Cr... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gpt4all.GPT4AllEmbeddings.html |
2f2c7876ec56-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gpt4all.GPT4AllEmbeddings.html |
2f2c7876ec56-2 | classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gpt4all.GPT4AllEmbeddings.html |
2b1e6332ddc2-0 | langchain.embeddings.gradient_ai.TinyAsyncGradientEmbeddingClient¶
class langchain.embeddings.gradient_ai.TinyAsyncGradientEmbeddingClient(access_token: Optional[str] = None, workspace_id: Optional[str] = None, host: str = 'https://api.gradient.ai/api', aiosession: Optional[ClientSession] = None)[source]¶
A helper tool... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.TinyAsyncGradientEmbeddingClient.html |
2b1e6332ddc2-1 | texts (List[str]) – List of sentences to embed.
Returns
List of vectors for each sentence
Return type
List[List[float]]
embed(model: str, texts: List[str]) → List[List[float]][source]¶
call the embedding of model
Parameters
model (str) – to embedding model
texts (List[str]) – List of sentences to embed.
Returns
List of... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.TinyAsyncGradientEmbeddingClient.html |
ffcd5d250fc2-0 | langchain.embeddings.llm_rails.LLMRailsEmbeddings¶
class langchain.embeddings.llm_rails.LLMRailsEmbeddings[source]¶
Bases: BaseModel, Embeddings
LLMRails embedding models.
To use, you should have the environment
variable LLM_RAILS_API_KEY set with your API key or pass it
as a named parameter to the constructor.
Model ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.llm_rails.LLMRailsEmbeddings.html |
ffcd5d250fc2-1 | Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creat... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.llm_rails.LLMRailsEmbeddings.html |
ffcd5d250fc2-2 | Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.llm_rails.LLMRailsEmbeddings.html |
fffe2a704c4a-0 | langchain.embeddings.self_hosted_hugging_face.load_embedding_model¶
langchain.embeddings.self_hosted_hugging_face.load_embedding_model(model_id: str, instruct: bool = False, device: int = 0) → Any[source]¶
Load the embedding model. | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.load_embedding_model.html |
58306b51abdc-0 | langchain.embeddings.fake.DeterministicFakeEmbedding¶
class langchain.embeddings.fake.DeterministicFakeEmbedding[source]¶
Bases: Embeddings, BaseModel
Fake embedding model that always returns
the same embedding vector for the same text.
Create a new model by parsing and validating input data from keyword arguments.
Rai... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.DeterministicFakeEmbedding.html |
58306b51abdc-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.DeterministicFakeEmbedding.html |
58306b51abdc-2 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.DeterministicFakeEmbedding.html |
c99b4d909432-0 | langchain.embeddings.minimax.MiniMaxEmbeddings¶
class langchain.embeddings.minimax.MiniMaxEmbeddings[source]¶
Bases: BaseModel, Embeddings
MiniMax’s embedding service.
To use, you should have the environment variable MINIMAX_GROUP_ID and
MINIMAX_API_KEY set with your API token, or pass it as a named parameter to
the co... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.minimax.MiniMaxEmbeddings.html |
c99b4d909432-1 | Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.minimax.MiniMaxEmbeddings.html |
c99b4d909432-2 | Parameters
text – The text to embed.
Returns
Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.minimax.MiniMaxEmbeddings.html |
e9d0b894747d-0 | langchain.embeddings.openai.OpenAIEmbeddings¶
class langchain.embeddings.openai.OpenAIEmbeddings[source]¶
Bases: BaseModel, Embeddings
OpenAI embedding models.
To use, you should have the openai python package installed, and the
environment variable OPENAI_API_KEY set with your API key or pass it
as a named parameter t... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html |
e9d0b894747d-1 | Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param allowed_special: Union[Literal['all'], Set[str]] = {}¶
param chunk_size: int = 1000¶
Maximum number of texts to embed in each batch
param deployment: str... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html |
e9d0b894747d-2 | Tiktoken is used to count the number of tokens in documents to constrain
them to be under a certain limit. By default, when set to None, this will
be the same as the embedding model name. However, there are some cases
where you may want to use this Embedding class with a model name not
supported by tiktoken. This can i... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html |
e9d0b894747d-3 | Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html |
e9d0b894747d-4 | Call out to OpenAI’s embedding endpoint for embedding query text.
Parameters
text – The text to embed.
Returns
Embedding for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = Non... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html |
e9d0b894747d-5 | classmethod validate(value: Any) → Model¶
Examples using OpenAIEmbeddings¶
OpenAI
AzureOpenAI
RePhraseQueryRetriever
Cohere Reranker
kNN
DocArray Retriever
SVM
Pinecone Hybrid Search
LOTR (Merger Retriever)
Xata chat memory
Confident
Azure OpenAI
Document Comparison
Vectorstore
LanceDB
Weaviate
Xata
Redis
PGVector
Rock... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html |
e9d0b894747d-6 | Agents
AutoGPT
BabyAGI User Guide
BabyAGI with Tools
!pip install bs4
Plug-and-Plai
SalesGPT - Your Context-Aware AI Sales Assistant With Knowledge Base
Custom Agent with PlugIn Retrieval
Generative Agents in LangChain
SQL
Indexing
Caching
MultiVector Retriever
MultiQueryRetriever
Parent Document Retriever
WebResearchR... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html |
348895ac858f-0 | langchain.embeddings.mosaicml.MosaicMLInstructorEmbeddings¶
class langchain.embeddings.mosaicml.MosaicMLInstructorEmbeddings[source]¶
Bases: BaseModel, Embeddings
MosaicML embedding service.
To use, you should have the
environment variable MOSAICML_API_TOKEN set with your API token, or pass
it as a named parameter to t... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.mosaicml.MosaicMLInstructorEmbeddings.html |
348895ac858f-1 | Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclu... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.mosaicml.MosaicMLInstructorEmbeddings.html |
348895ac858f-2 | Embed a query using a MosaicML deployed instructor embedding model.
Parameters
text – The text to embed.
Returns
Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.mosaicml.MosaicMLInstructorEmbeddings.html |
348895ac858f-3 | classmethod validate(value: Any) → Model¶
Examples using MosaicMLInstructorEmbeddings¶
MosaicML | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.mosaicml.MosaicMLInstructorEmbeddings.html |
34057f9bd487-0 | langchain.embeddings.huggingface.HuggingFaceInferenceAPIEmbeddings¶
class langchain.embeddings.huggingface.HuggingFaceInferenceAPIEmbeddings[source]¶
Bases: BaseModel, Embeddings
Embed texts using the HuggingFace API.
Requires a HuggingFace Inference API key and a model name.
Create a new model by parsing and validatin... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInferenceAPIEmbeddings.html |
34057f9bd487-1 | exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creating
the new model: you should trust this data
deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, i... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInferenceAPIEmbeddings.html |
34057f9bd487-2 | Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInferenceAPIEmbeddings.html |
4f13b353d16c-0 | langchain.embeddings.google_palm.GooglePalmEmbeddings¶
class langchain.embeddings.google_palm.GooglePalmEmbeddings[source]¶
Bases: BaseModel, Embeddings
Google’s PaLM Embeddings APIs.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parse... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.google_palm.GooglePalmEmbeddings.html |
4f13b353d16c-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.google_palm.GooglePalmEmbeddings.html |
4f13b353d16c-2 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.google_palm.GooglePalmEmbeddings.html |
e939d27658c6-0 | langchain.embeddings.localai.embed_with_retry¶
langchain.embeddings.localai.embed_with_retry(embeddings: LocalAIEmbeddings, **kwargs: Any) → Any[source]¶
Use tenacity to retry the embedding call. | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.localai.embed_with_retry.html |
30f7a1bc626b-0 | langchain.embeddings.fake.FakeEmbeddings¶
class langchain.embeddings.fake.FakeEmbeddings[source]¶
Bases: Embeddings, BaseModel
Fake embedding model.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param size... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.FakeEmbeddings.html |
30f7a1bc626b-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.FakeEmbeddings.html |
30f7a1bc626b-2 | classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmet... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fake.FakeEmbeddings.html |
e165387b68a9-0 | langchain.embeddings.huggingface.HuggingFaceEmbeddings¶
class langchain.embeddings.huggingface.HuggingFaceEmbeddings[source]¶
Bases: BaseModel, Embeddings
HuggingFace sentence_transformers embedding models.
To use, you should have the sentence_transformers python package installed.
Example
from langchain.embeddings imp... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceEmbeddings.html |
e165387b68a9-1 | Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceEmbeddings.html |
e165387b68a9-2 | Parameters
text – The text to embed.
Returns
Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceEmbeddings.html |
e165387b68a9-3 | Examples using HuggingFaceEmbeddings¶
Hugging Face
Sentence Transformers
LOTR (Merger Retriever)
ScaNN
Annoy
your local model path
Pairwise Embedding Distance
Embedding Distance
Lost in the middle: The problem with long contexts | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceEmbeddings.html |
cfbbd69be6fc-0 | langchain.embeddings.openai.async_embed_with_retry¶
async langchain.embeddings.openai.async_embed_with_retry(embeddings: OpenAIEmbeddings, **kwargs: Any) → Any[source]¶
Use tenacity to retry the embedding call. | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.async_embed_with_retry.html |
4d4a4e586eba-0 | langchain.embeddings.llamacpp.LlamaCppEmbeddings¶
class langchain.embeddings.llamacpp.LlamaCppEmbeddings[source]¶
Bases: BaseModel, Embeddings
llama.cpp embedding models.
To use, you should have the llama-cpp-python library installed, and provide the
path to the Llama model as a named parameter to the constructor.
Chec... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.llamacpp.LlamaCppEmbeddings.html |
4d4a4e586eba-1 | Force system to keep model in RAM.
param verbose: bool = True¶
Print verbose output to stderr.
param vocab_only: bool = False¶
Only load the vocabulary, no weights.
async aembed_documents(texts: List[str]) → List[List[float]]¶
Asynchronous Embed search docs.
async aembed_query(text: str) → List[float]¶
Asynchronous Emb... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.llamacpp.LlamaCppEmbeddings.html |
4d4a4e586eba-2 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.llamacpp.LlamaCppEmbeddings.html |
4d4a4e586eba-3 | classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.llamacpp.LlamaCppEmbeddings.html |
87e382cef5d5-0 | langchain.embeddings.deepinfra.DeepInfraEmbeddings¶
class langchain.embeddings.deepinfra.DeepInfraEmbeddings[source]¶
Bases: BaseModel, Embeddings
Deep Infra’s embedding inference service.
To use, you should have the
environment variable DEEPINFRA_API_TOKEN set with your API token, or pass
it as a named parameter to th... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.deepinfra.DeepInfraEmbeddings.html |
87e382cef5d5-1 | Asynchronous Embed search docs.
async aembed_query(text: str) → List[float]¶
Asynchronous Embed query text.
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.deepinfra.DeepInfraEmbeddings.html |
87e382cef5d5-2 | Embed documents using a Deep Infra deployed embedding model.
Parameters
texts – The list of texts to embed.
Returns
List of embeddings, one for each text.
embed_query(text: str) → List[float][source]¶
Embed a query using a Deep Infra deployed embedding model.
Parameters
text – The text to embed.
Returns
Embeddings for ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.deepinfra.DeepInfraEmbeddings.html |
87e382cef5d5-3 | classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
classmethod validate(value: Any) → Model¶
Examples using DeepInfraEmbeddings¶
DeepInfra | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.deepinfra.DeepInfraEmbeddings.html |
74bed98a95f0-0 | langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings¶
class langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings[source]¶
Bases: BaseModel, Embeddings
HuggingFaceHub embedding models.
To use, you should have the huggingface_hub python package installed, and the
environment variable HUGGINGFACEHUB_API_... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings.html |
74bed98a95f0-1 | Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings.html |
74bed98a95f0-2 | Parameters
text – The text to embed.
Returns
Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface_hub.HuggingFaceHubEmbeddings.html |
7d7f2bdb759a-0 | langchain.embeddings.javelin_ai_gateway.JavelinAIGatewayEmbeddings¶
class langchain.embeddings.javelin_ai_gateway.JavelinAIGatewayEmbeddings[source]¶
Bases: Embeddings, BaseModel
Wrapper around embeddings LLMs in the Javelin AI Gateway.
To use, you should have the javelin_sdk python package installed.
For more informat... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.javelin_ai_gateway.JavelinAIGatewayEmbeddings.html |
7d7f2bdb759a-1 | Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶
Duplicate a model, optionally... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.javelin_ai_gateway.JavelinAIGatewayEmbeddings.html |
7d7f2bdb759a-2 | Embed query text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool ... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.javelin_ai_gateway.JavelinAIGatewayEmbeddings.html |
91f76d6c9ec0-0 | langchain.embeddings.ollama.OllamaEmbeddings¶
class langchain.embeddings.ollama.OllamaEmbeddings[source]¶
Bases: BaseModel, Embeddings
Ollama locally runs large language models.
To use, follow the instructions at https://ollama.ai/.
Example
from langchain.embeddings import OllamaEmbeddings
ollama_emb = OllamaEmbeddings... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.ollama.OllamaEmbeddings.html |
91f76d6c9ec0-1 | of the output. A lower value will result in more focused and
coherent text. (Default: 5.0)
param model: str = 'llama2'¶
Model name to use.
param model_kwargs: Optional[dict] = None¶
Other model keyword args
param num_ctx: Optional[int] = None¶
Sets the size of the context window used to generate the
next token. (Defaul... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.ollama.OllamaEmbeddings.html |
91f76d6c9ec0-2 | param tfs_z: Optional[float] = None¶
Tail free sampling is used to reduce the impact of less probable
tokens from the output. A higher value (e.g., 2.0) will reduce the
impact more, while a value of 1.0 disables this setting. (default: 1)
param top_k: Optional[int] = None¶
Reduces the probability of generating nonsense... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.ollama.OllamaEmbeddings.html |
91f76d6c9ec0-3 | Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creat... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.ollama.OllamaEmbeddings.html |
91f76d6c9ec0-4 | Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.ollama.OllamaEmbeddings.html |
79ff0c64bb6a-0 | langchain.embeddings.cache.CacheBackedEmbeddings¶
class langchain.embeddings.cache.CacheBackedEmbeddings(underlying_embeddings: Embeddings, document_embedding_store: BaseStore[str, List[float]])[source]¶
Interface for caching results from embedding models.
The interface allows works with any store that implements
the a... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.cache.CacheBackedEmbeddings.html |
79ff0c64bb6a-1 | Embed a list of texts.
The method first checks the cache for the embeddings.
If the embeddings are not found, the method uses the underlying embedder
to embed the documents and stores the results in the cache.
Parameters
texts – A list of texts to embed.
Returns
A list of embeddings for the given texts.
embed_query(tex... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.cache.CacheBackedEmbeddings.html |
51b0da2d7865-0 | langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings¶
class langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings[source]¶
Bases: BaseModel, Embeddings
Wrapper around sentence_transformers embedding models.
To use, you should have the sentence_transformers
and InstructorEmbedding python packages inst... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings.html |
51b0da2d7865-1 | Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values
copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclu... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings.html |
51b0da2d7865-2 | Compute query embeddings using a HuggingFace instruct model.
Parameters
text – The text to embed.
Returns
Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, b... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings.html |
51b0da2d7865-3 | classmethod validate(value: Any) → Model¶
Examples using HuggingFaceInstructEmbeddings¶
InstructEmbeddings
Vector SQL Retriever with MyScale | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings.html |
5f1ae2e6600a-0 | langchain.embeddings.gradient_ai.GradientEmbeddings¶
class langchain.embeddings.gradient_ai.GradientEmbeddings[source]¶
Bases: BaseModel, Embeddings
Gradient.ai Embedding models.
GradientLLM is a class to interact with Embedding Models on gradient.ai
To use, set the environment variable GRADIENT_ACCESS_TOKEN with your
... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.GradientEmbeddings.html |
5f1ae2e6600a-1 | Parameters
text – The text to embed.
Returns
Embeddings for the text.
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other validation is performed.
Behave... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.GradientEmbeddings.html |
5f1ae2e6600a-2 | Parameters
texts – The list of texts to embed.
Returns
List of embeddings, one for each text.
embed_query(text: str) → List[float][source]¶
Call out to Gradient’s embedding endpoint.
Parameters
text – The text to embed.
Returns
Embeddings for the text.
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[U... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.GradientEmbeddings.html |
5f1ae2e6600a-3 | classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
classmethod validate(value: Any) → Model¶ | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.GradientEmbeddings.html |
451d39d7f0bb-0 | langchain.embeddings.ernie.ErnieEmbeddings¶
class langchain.embeddings.ernie.ErnieEmbeddings[source]¶
Bases: BaseModel, Embeddings
Ernie Embeddings V1 embedding models.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a val... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.ernie.ErnieEmbeddings.html |
451d39d7f0bb-1 | Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creat... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.ernie.ErnieEmbeddings.html |
451d39d7f0bb-2 | Return type
List[float]
classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults:... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.ernie.ErnieEmbeddings.html |
b70ce8806b1b-0 | langchain.embeddings.openai.embed_with_retry¶
langchain.embeddings.openai.embed_with_retry(embeddings: OpenAIEmbeddings, **kwargs: Any) → Any[source]¶
Use tenacity to retry the embedding call. | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.embed_with_retry.html |
a12ed1aaed73-0 | langchain.embeddings.edenai.EdenAiEmbeddings¶
class langchain.embeddings.edenai.EdenAiEmbeddings[source]¶
Bases: BaseModel, Embeddings
EdenAI embedding.
environment variable EDENAI_API_KEY set with your API key, or pass
it as a named parameter.
Create a new model by parsing and validating input data from keyword argume... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.edenai.EdenAiEmbeddings.html |
a12ed1aaed73-1 | Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creat... | https://api.python.langchain.com/en/latest/embeddings/langchain.embeddings.edenai.EdenAiEmbeddings.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.