id
stringlengths
14
16
text
stringlengths
13
2.7k
source
stringlengths
57
178
0ae9a393e23b-9
property lc_attributes: Dict¶ List of attribute names that should be included in the serialized kwargs. These attributes must be accepted by the constructor. property lc_secrets: Dict[str, str]¶ A map of constructor argument names to secret ids. For example,{“openai_api_key”: “OPENAI_API_KEY”} property output_schema: T...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.retry.RetryOutputParser.html
eae8bb3e09b9-0
langchain.output_parsers.combining.CombiningOutputParser¶ class langchain.output_parsers.combining.CombiningOutputParser[source]¶ Bases: BaseOutputParser Combine multiple output parsers into one. param parsers: List[langchain.schema.output_parser.BaseOutputParser] [Required]¶ async abatch(inputs: List[Input], config: O...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
eae8bb3e09b9-1
to be different candidate outputs for a single model input. Returns Structured output. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support str...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
eae8bb3e09b9-2
Default implementation runs invoke in parallel using a thread pool executor. The default implementation of batch works well for IO bound runnables. Subclasses should override this method if they can batch more efficiently; e.g., if the underlying runnable uses an API which supports a batch mode. bind(**kwargs: Any) → R...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
eae8bb3e09b9-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...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
eae8bb3e09b9-4
methods will have a dynamic output schema that depends on which configuration the runnable is invoked with. This method allows to get an output schema for a specific configuration. Parameters config – A config to use when generating the schema. Returns A pydantic model that can be used to validate output. invoke(input:...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
eae8bb3e09b9-5
The unique identifier is a list of strings that describes the path to the object. map() → Runnable[List[Input], List[Output]]¶ Return a new Runnable that maps a list of inputs to a list of outputs, by calling invoke() with each input. parse(text: str) → Dict[str, Any][source]¶ Parse the output of an LLM call. classmeth...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
eae8bb3e09b9-6
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of stream, which calls invoke. Subclasses should override t...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
eae8bb3e09b9-7
fallback in order, upon failures. with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶ Bind lifecycle listeners to a Runnable, returning a new Runnable. on_start: Called before the runnable starts running, with the Run ...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
eae8bb3e09b9-8
The type of output this runnable produces specified as a type annotation. property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶ List configurable fields for this runnable. property input_schema: Type[pydantic.main.BaseModel]¶ The type of input this runnable accepts specified as a pydantic ...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.combining.CombiningOutputParser.html
ef490339c175-0
langchain.output_parsers.list.MarkdownListOutputParser¶ class langchain.output_parsers.list.MarkdownListOutputParser[source]¶ Bases: ListOutputParser Parse a markdown list. async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwarg...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.MarkdownListOutputParser.html
ef490339c175-1
to be different candidate outputs for a single model input. Returns Structured output. async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support str...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.MarkdownListOutputParser.html
ef490339c175-2
Default implementation runs invoke in parallel using a thread pool executor. The default implementation of batch works well for IO bound runnables. Subclasses should override this method if they can batch more efficiently; e.g., if the underlying runnable uses an API which supports a batch mode. bind(**kwargs: Any) → R...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.MarkdownListOutputParser.html
ef490339c175-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...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.MarkdownListOutputParser.html
ef490339c175-4
methods will have a dynamic output schema that depends on which configuration the runnable is invoked with. This method allows to get an output schema for a specific configuration. Parameters config – A config to use when generating the schema. Returns A pydantic model that can be used to validate output. invoke(input:...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.MarkdownListOutputParser.html
ef490339c175-5
The unique identifier is a list of strings that describes the path to the object. map() → Runnable[List[Input], List[Output]]¶ Return a new Runnable that maps a list of inputs to a list of outputs, by calling invoke() with each input. parse(text: str) → List[str][source]¶ Parse the output of an LLM call. classmethod pa...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.MarkdownListOutputParser.html
ef490339c175-6
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of stream, which calls invoke. Subclasses should override t...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.MarkdownListOutputParser.html
ef490339c175-7
fallback in order, upon failures. with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶ Bind lifecycle listeners to a Runnable, returning a new Runnable. on_start: Called before the runnable starts running, with the Run ...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.MarkdownListOutputParser.html
ef490339c175-8
The type of output this runnable produces specified as a type annotation. property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶ List configurable fields for this runnable. property input_schema: Type[pydantic.main.BaseModel]¶ The type of input this runnable accepts specified as a pydantic ...
lang/api.python.langchain.com/en/latest/output_parsers/langchain.output_parsers.list.MarkdownListOutputParser.html
bf2d19254abf-0
langchain.tools.render.render_text_description_and_args¶ langchain.tools.render.render_text_description_and_args(tools: List[BaseTool]) → str[source]¶ Render the tool name, description, and args in plain text. Output will be in the format of: search: This tool is used for search, args: {"query": {"type": "string"}} cal...
lang/api.python.langchain.com/en/latest/tools.render/langchain.tools.render.render_text_description_and_args.html
e37f4b7e52dc-0
langchain.tools.render.format_tool_to_openai_function¶ langchain.tools.render.format_tool_to_openai_function(tool: BaseTool) → FunctionDescription[source]¶ Format tool into the OpenAI function API. Examples using format_tool_to_openai_function¶ Tools as OpenAI Functions
lang/api.python.langchain.com/en/latest/tools.render/langchain.tools.render.format_tool_to_openai_function.html
af9c6206f148-0
langchain.tools.render.render_text_description¶ langchain.tools.render.render_text_description(tools: List[BaseTool]) → str[source]¶ Render the tool name and description in plain text. Output will be in the format of: search: This tool is used for search calculator: This tool is used for math
lang/api.python.langchain.com/en/latest/tools.render/langchain.tools.render.render_text_description.html
2b953d2106fd-0
langchain.tools.render.format_tool_to_openai_tool¶ langchain.tools.render.format_tool_to_openai_tool(tool: BaseTool) → ToolDescription[source]¶ Format tool into the OpenAI function API.
lang/api.python.langchain.com/en/latest/tools.render/langchain.tools.render.format_tool_to_openai_tool.html
bcdde03a7d91-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceEmbeddings.html
bcdde03a7d91-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceEmbeddings.html
bcdde03a7d91-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceEmbeddings.html
bcdde03a7d91-3
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
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceEmbeddings.html
fdbcffb2087c-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 ...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.embaas.EmbaasEmbeddingsPayload.html
fdbcffb2087c-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.embaas.EmbaasEmbeddingsPayload.html
a23c12ca08bb-0
langchain.embeddings.localai.async_embed_with_retry¶ async langchain.embeddings.localai.async_embed_with_retry(embeddings: LocalAIEmbeddings, **kwargs: Any) → Any[source]¶ Use tenacity to retry the embedding call.
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.localai.async_embed_with_retry.html
7220ad1098bb-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html
7220ad1098bb-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html
7220ad1098bb-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 ...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html
7220ad1098bb-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html
7220ad1098bb-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
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.aleph_alpha.AlephAlphaSymmetricSemanticEmbedding.html
a76afdcb88d0-0
langchain.embeddings.baidu_qianfan_endpoint.QianfanEmbeddingsEndpoint¶ class langchain.embeddings.baidu_qianfan_endpoint.QianfanEmbeddingsEndpoint[source]¶ Bases: BaseModel, Embeddings Baidu Qianfan Embeddings embedding models. Create a new model by parsing and validating input data from keyword arguments. Raises Valid...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.baidu_qianfan_endpoint.QianfanEmbeddingsEndpoint.html
a76afdcb88d0-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.baidu_qianfan_endpoint.QianfanEmbeddingsEndpoint.html
a76afdcb88d0-2
embed_query(text: str) → List[float][source]¶ 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, exclud...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.baidu_qianfan_endpoint.QianfanEmbeddingsEndpoint.html
9d396e409990-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.deepinfra.DeepInfraEmbeddings.html
9d396e409990-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.deepinfra.DeepInfraEmbeddings.html
9d396e409990-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 ...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.deepinfra.DeepInfraEmbeddings.html
9d396e409990-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
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.deepinfra.DeepInfraEmbeddings.html
8013c4d16a4c-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 ...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.GradientEmbeddings.html
8013c4d16a4c-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.GradientEmbeddings.html
8013c4d16a4c-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.GradientEmbeddings.html
8013c4d16a4c-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¶
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.gradient_ai.GradientEmbeddings.html
134ecb966fd4-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 ...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.elasticsearch.ElasticsearchEmbeddings.html
134ecb966fd4-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.elasticsearch.ElasticsearchEmbeddings.html
134ecb966fd4-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.elasticsearch.ElasticsearchEmbeddings.html
134ecb966fd4-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.elasticsearch.ElasticsearchEmbeddings.html
88c2af2b18f8-0
langchain.embeddings.mlflow_gateway.MlflowAIGatewayEmbeddings¶ class langchain.embeddings.mlflow_gateway.MlflowAIGatewayEmbeddings[source]¶ Bases: Embeddings, BaseModel Wrapper around embeddings LLMs in the MLflow AI Gateway. To use, you should have the mlflow[gateway] python package installed. For more information, se...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.mlflow_gateway.MlflowAIGatewayEmbeddings.html
88c2af2b18f8-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.mlflow_gateway.MlflowAIGatewayEmbeddings.html
88c2af2b18f8-2
Generate a JSON representation of the model, include and exclude arguments as per dict(). encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps(). classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.mlflow_gateway.MlflowAIGatewayEmbeddings.html
3efd7b8f1b42-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.javelin_ai_gateway.JavelinAIGatewayEmbeddings.html
3efd7b8f1b42-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.javelin_ai_gateway.JavelinAIGatewayEmbeddings.html
3efd7b8f1b42-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 ...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.javelin_ai_gateway.JavelinAIGatewayEmbeddings.html
7066459d9973-0
langchain.embeddings.localai.LocalAIEmbeddings¶ class langchain.embeddings.localai.LocalAIEmbeddings[source]¶ Bases: BaseModel, Embeddings LocalAI embedding models. Since LocalAI and OpenAI have 1:1 compatibility between APIs, this class uses the openai Python package’s openai.Embedding as its client. Thus, you should ...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.localai.LocalAIEmbeddings.html
7066459d9973-1
param openai_api_base: Optional[str] = None¶ param openai_api_key: Optional[str] = None¶ param openai_api_version: Optional[str] = None¶ param openai_organization: Optional[str] = None¶ param openai_proxy: Optional[str] = None¶ param request_timeout: Optional[Union[float, Tuple[float, float]]] = None¶ Timeout in second...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.localai.LocalAIEmbeddings.html
7066459d9973-2
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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.localai.LocalAIEmbeddings.html
7066459d9973-3
Embedding 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:...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.localai.LocalAIEmbeddings.html
9f51eae3c9f8-0
langchain.embeddings.cohere.CohereEmbeddings¶ class langchain.embeddings.cohere.CohereEmbeddings[source]¶ Bases: BaseModel, Embeddings Cohere embedding models. To use, you should have the cohere python package installed, and the environment variable COHERE_API_KEY set with your API key or pass it as a named parameter t...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.cohere.CohereEmbeddings.html
9f51eae3c9f8-1
async aembed_query(text: str) → List[float][source]¶ Async call out to Cohere’s embedding endpoint. 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 trust...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.cohere.CohereEmbeddings.html
9f51eae3c9f8-2
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. embed_documents(texts: List[str]) → List[List[float]][source]¶ Call out to Cohere’s embedding endpoint. Parameters texts – The list of texts to embed. Returns List of embeddings, one for each text. embed_query(t...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.cohere.CohereEmbeddings.html
9f51eae3c9f8-3
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ 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 usi...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.cohere.CohereEmbeddings.html
f7d84ad969b8-0
langchain.embeddings.voyageai.embed_with_retry¶ langchain.embeddings.voyageai.embed_with_retry(embeddings: VoyageEmbeddings, **kwargs: Any) → Any[source]¶ Use tenacity to retry the embedding call.
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.voyageai.embed_with_retry.html
abf094fc7e71-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.awa.AwaEmbeddings.html
abf094fc7e71-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.awa.AwaEmbeddings.html
abf094fc7e71-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.awa.AwaEmbeddings.html
84e87e8b1703-0
langchain.embeddings.clarifai.ClarifaiEmbeddings¶ class langchain.embeddings.clarifai.ClarifaiEmbeddings[source]¶ Bases: BaseModel, Embeddings Clarifai embedding models. To use, you should have the clarifai python package installed, and the environment variable CLARIFAI_PAT set with your personal access token or pass i...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.clarifai.ClarifaiEmbeddings.html
84e87e8b1703-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.clarifai.ClarifaiEmbeddings.html
84e87e8b1703-2
Call out to Clarifai’s embedding models. 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 = Fals...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.clarifai.ClarifaiEmbeddings.html
84e87e8b1703-3
classmethod validate(value: Any) → Model¶ Examples using ClarifaiEmbeddings¶ Clarifai
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.clarifai.ClarifaiEmbeddings.html
56ddad8e92bd-0
langchain.embeddings.jina.JinaEmbeddings¶ class langchain.embeddings.jina.JinaEmbeddings[source]¶ Bases: BaseModel, Embeddings Jina 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 valid model. param jin...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.jina.JinaEmbeddings.html
56ddad8e92bd-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.jina.JinaEmbeddings.html
56ddad8e92bd-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.jina.JinaEmbeddings.html
f89b83fc1d56-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.
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.localai.embed_with_retry.html
ec2a2345e25b-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings.html
ec2a2345e25b-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings.html
ec2a2345e25b-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings.html
ec2a2345e25b-3
classmethod validate(value: Any) → Model¶ Examples using HuggingFaceInstructEmbeddings¶ InstructEmbeddings Vector SQL Retriever with MyScale
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.huggingface.HuggingFaceInstructEmbeddings.html
f8cdbb95d51c-0
langchain.embeddings.voyageai.VoyageEmbeddings¶ class langchain.embeddings.voyageai.VoyageEmbeddings[source]¶ Bases: BaseModel, Embeddings Voyage embedding models. To use, you should have the environment variable VOYAGE_API_KEY set with your API key or pass it as a named parameter to the constructor. Example from langc...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.voyageai.VoyageEmbeddings.html
f8cdbb95d51c-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.voyageai.VoyageEmbeddings.html
f8cdbb95d51c-2
Call out to Voyage 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]] = None,...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.voyageai.VoyageEmbeddings.html
c880b77cd637-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html
c880b77cd637-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 default_headers...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html
c880b77cd637-2
param openai_organization: Optional[str] = None (alias 'organization')¶ Automatically inferred from env var OPENAI_ORG_ID if not provided. param openai_proxy: Optional[str] = None¶ param request_timeout: Optional[Union[float, Tuple[float, float], Any]] = None (alias 'timeout')¶ Timeout for requests to OpenAI completion...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html
c880b77cd637-3
specified by the class. Returns List of embeddings, one for each text. async aembed_query(text: str) → List[float][source]¶ Call out to OpenAI’s embedding endpoint async for embedding query text. Parameters text – The text to embed. Returns Embedding for the text. classmethod construct(_fields_set: Optional[SetStr] = N...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html
c880b77cd637-4
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. embed_documents(texts: List[str], chunk_size: Optional[int] = 0) → List[List[float]][source]¶ Call out to OpenAI’s embedding endpoint for embedding search docs. Parameters texts – The list of texts to embed. chu...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html
c880b77cd637-5
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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html
c880b77cd637-6
Hologres MongoDB Atlas Meilisearch Loading documents from a YouTube url Psychic Docugami LLM Caching integrations Set env var OPENAI_API_KEY or load from a .env file: Set env var OPENAI_API_KEY or load from a .env file Question Answering Perform context-aware text splitting Conversational Retrieval Agent Retrieve from ...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.openai.OpenAIEmbeddings.html
351cc964302b-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.edenai.EdenAiEmbeddings.html
351cc964302b-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...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.edenai.EdenAiEmbeddings.html
351cc964302b-2
static get_user_agent() → str[source]¶ 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 = False, exclude_no...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.edenai.EdenAiEmbeddings.html
fc9d3bd8bdf8-0
langchain.embeddings.dashscope.embed_with_retry¶ langchain.embeddings.dashscope.embed_with_retry(embeddings: DashScopeEmbeddings, **kwargs: Any) → Any[source]¶ Use tenacity to retry the embedding call.
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.dashscope.embed_with_retry.html
f5913242cbee-0
langchain.embeddings.fastembed.FastEmbedEmbeddings¶ class langchain.embeddings.fastembed.FastEmbedEmbeddings[source]¶ Bases: BaseModel, Embeddings Qdrant FastEmbedding models. FastEmbed is a lightweight, fast, Python library built for embedding generation. See more documentation at: * https://github.com/qdrant/fastembe...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fastembed.FastEmbedEmbeddings.html
f5913242cbee-1
async aembed_documents(texts: List[str]) → List[List[float]]¶ 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 trust...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fastembed.FastEmbedEmbeddings.html
f5913242cbee-2
embed_documents(texts: List[str]) → List[List[float]][source]¶ Generate embeddings for documents using FastEmbed. Parameters texts – The list of texts to embed. Returns List of embeddings, one for each text. embed_query(text: str) → List[float][source]¶ Generate query embeddings using FastEmbed. Parameters text – The t...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fastembed.FastEmbedEmbeddings.html
f5913242cbee-3
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ 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¶
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.fastembed.FastEmbedEmbeddings.html
625b1403ed05-0
langchain.embeddings.google_palm.embed_with_retry¶ langchain.embeddings.google_palm.embed_with_retry(embeddings: GooglePalmEmbeddings, *args: Any, **kwargs: Any) → Any[source]¶ Use tenacity to retry the completion call.
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.google_palm.embed_with_retry.html
1c9484528b0a-0
langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings¶ class langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings[source]¶ Bases: SelfHostedEmbeddings HuggingFace embedding models on self-hosted remote hardware. Supported hardware includes auto-launched instances on AWS,...
lang/api.python.langchain.com/en/latest/embeddings/langchain.embeddings.self_hosted_hugging_face.SelfHostedHuggingFaceEmbeddings.html