id
stringlengths
14
15
text
stringlengths
44
2.47k
source
stringlengths
61
181
9b6f65715ed0-5
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(**kw...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.minimax.MiniMaxChat.html
9b6f65715ed0-6
first occurrence of any of these substrings. callbacks – Callbacks to pass through. Used for executing additional functionality, such as logging or streaming, throughout generation. **kwargs – Arbitrary additional keyword arguments. These are usually passed to the model provider API call. Returns An LLMResult, which co...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.minimax.MiniMaxChat.html
9b6f65715ed0-7
classmethod is_lc_serializable() → bool¶ Is this class serializable? 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_defa...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.minimax.MiniMaxChat.html
9b6f65715ed0-8
Pass a single string input to the model and return a string prediction. Use this method when passing in raw text. If you want to pass in specifictypes of chat messages, use predict_messages. Parameters text – String input to pass to the model. stop – Stop words to use when generating. Model output is cut off at the fir...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.minimax.MiniMaxChat.html
9b6f65715ed0-9
Subclasses should override this method if they support streaming output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Defau...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.minimax.MiniMaxChat.html
9b6f65715ed0-10
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: Type[pydantic.main.BaseModel]¶
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.minimax.MiniMaxChat.html
da1fcdda4829-0
langchain.chat_models.openai.ChatOpenAI¶ class langchain.chat_models.openai.ChatOpenAI[source]¶ Bases: BaseChatModel OpenAI Chat large language models API. To use, you should have the openai python package installed, and the environment variable OPENAI_API_KEY set with your API key. Any parameters that are valid to be ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-1
Base URL path for API requests, leave blank if not using a proxy or service emulator. param openai_organization: Optional[str] = None¶ param openai_proxy: Optional[str] = None¶ param request_timeout: Optional[Union[float, Tuple[float, float]]] = None¶ Timeout for requests to OpenAI completion API. Default is 600 second...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-2
Call self as a function. async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶ Default implementation of abatch, which calls ainvoke N times. Subclasses should override this method if they can ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-3
callbacks – Callbacks to pass through. Used for executing additional functionality, such as logging or streaming, throughout generation. **kwargs – Arbitrary additional keyword arguments. These are usually passed to the model provider API call. Returns An LLMResult, which contains a list of candidate Generations for ea...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-4
first occurrence of any of these substrings. **kwargs – Arbitrary additional keyword arguments. These are usually passed 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[...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-5
input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶ Default implementation of batch, which calls invoke N times. Subclasses should override this method if they can ba...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-6
deep – set to True to make a deep copy of the model Returns new model instance dict(**kwargs: Any) → Dict¶ Return a dictionary of the LLM. classmethod from_orm(obj: Any) → Model¶ generate(messages: List[List[BaseMessage]], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallba...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-7
to the model provider API call. Returns An LLMResult, which contains a list of candidate Generations for each inputprompt and additional model provider-specific output. classmethod get_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langchain.llms.openai.OpenAI, then ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-8
Return whether this model can be serialized by Langchain. 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/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-9
Pass a single string input to the model and return a string prediction. Use this method when passing in raw text. If you want to pass in specifictypes of chat messages, use predict_messages. Parameters text – String input to pass to the model. stop – Stop words to use when generating. Model output is cut off at the fir...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-10
Subclasses should override this method if they support streaming output. to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶ to_json_not_implemented() → SerializedNotImplemented¶ transform(input: Iterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Defau...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-11
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: Type[pydantic.main.BaseModel]¶ ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
da1fcdda4829-12
Structure answers with OpenAI functions QA using Activeloop’s DeepLake Neptune Open Cypher QA Chain NebulaGraphQAChain Memgraph QA chain KuzuQAChain HugeGraph QA Chain GraphSparqlQAChain Diffbot Graph Transformer ArangoDB QA chain Neo4j DB QA chain FalkorDBQAChain Agents AutoGPT !pip install bs4 Wikibase Agent SalesGPT...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html
8284294a02fd-0
langchain.chat_models.google_palm.ChatGooglePalmError¶ class langchain.chat_models.google_palm.ChatGooglePalmError[source]¶ Error with the Google PaLM API.
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.google_palm.ChatGooglePalmError.html
4a054991c90a-0
langchain.chat_models.mlflow_ai_gateway.ChatParams¶ class langchain.chat_models.mlflow_ai_gateway.ChatParams[source]¶ Bases: BaseModel Parameters for the MLflow AI Gateway LLM. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to fo...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatParams.html
4a054991c90a-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/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatParams.html
4a054991c90a-2
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ 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...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.mlflow_ai_gateway.ChatParams.html
c9ddddd24f8b-0
langchain.chat_models.anyscale.ChatAnyscale¶ class langchain.chat_models.anyscale.ChatAnyscale[source]¶ Bases: ChatOpenAI Anyscale Chat large language models. To use, you should have the openai python package installed, and the environment variable ANYSCALE_API_KEY set with your API key. Alternatively, you can use the ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-1
param metadata: Optional[Dict[str, Any]] = None¶ Metadata to add to the run trace. param model_kwargs: Dict[str, Any] [Optional]¶ Holds any model parameters valid for create call not explicitly specified. param model_name: str = 'meta-llama/Llama-2-7b-chat-hf' (alias 'model')¶ Model name to use. param n: int = 1¶ Numbe...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-2
when using one of the many model providers that expose an OpenAI-like API but with different models. In those cases, in order to avoid erroring when tiktoken is called, you can specify a model name to use here. param verbose: bool [Optional]¶ Whether to print out response text. __call__(messages: List[BaseMessage], sto...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-3
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 PromptValue is an object that can be converted to match the format of any languag...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-4
to the model provider API call. Returns Top model prediction as a string. async apredict_messages(messages: List[BaseMessage], *, stop: Optional[Sequence[str]] = None, **kwargs: Any) → BaseMessage¶ Asynchronously pass messages to the model and return a message prediction. Use this method when calling chat models and on...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-5
jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run. The jsonpatch ops can be applied in order to construct state. async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶ Default im...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-6
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/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-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/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-8
Calculate num tokens with tiktoken package. Official documentation: https://github.com/openai/openai-cookbook/blob/ main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb get_token_ids(text: str) → List[int]¶ Get the tokens present in the text with tiktoken package. invoke(input: Union[PromptValue, str, List[BaseMe...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-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/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-10
to the model provider API call. Returns Top model prediction as a message. classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ stream(in...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
c9ddddd24f8b-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/chat_models/langchain.chat_models.anyscale.ChatAnyscale.html
b68d3b5dbbed-0
langchain.chat_models.human.HumanInputChatModel¶ class langchain.chat_models.human.HumanInputChatModel[source]¶ Bases: BaseChatModel ChatModel which returns user input as the response. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be pars...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.human.HumanInputChatModel.html
b68d3b5dbbed-1
Subclasses should override this method if they can batch more efficiently. async agenerate(messages: List[List[BaseMessage]], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = Non...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.human.HumanInputChatModel.html
b68d3b5dbbed-2
async ainvoke(input: Union[PromptValue, str, List[BaseMessage]], config: Optional[RunnableConfig] = None, *, stop: Optional[List[str]] = None, **kwargs: Any) → BaseMessageChunk¶ Default implementation of ainvoke, which calls invoke in a thread pool. Subclasses should override this method if they can run asynchronously....
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.human.HumanInputChatModel.html
b68d3b5dbbed-3
Default implementation of astream, which calls ainvoke. Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.human.HumanInputChatModel.html
b68d3b5dbbed-4
Bind arguments to a Runnable, returning a new Runnable. call_as_llm(message: str, stop: Optional[List[str]] = None, **kwargs: Any) → str¶ 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. Defaul...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.human.HumanInputChatModel.html
b68d3b5dbbed-5
Top Level call generate_prompt(prompts: List[PromptValue], stop: Optional[List[str]] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → LLMResult¶ Pass a sequence of prompts to the model and return model generations. This method should make use of batched calls f...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.human.HumanInputChatModel.html
b68d3b5dbbed-6
Parameters text – The string input to tokenize. Returns The integer number of tokens in the text. get_num_tokens_from_messages(messages: List[BaseMessage]) → int¶ Get the number of tokens in the messages. Useful for checking if an input will fit in a model’s context window. Parameters messages – The message inputs to t...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.human.HumanInputChatModel.html
b68d3b5dbbed-7
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. classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encod...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.human.HumanInputChatModel.html
b68d3b5dbbed-8
stop – Stop words to use when generating. Model output is cut off at the first occurrence of any of these substrings. **kwargs – Arbitrary additional keyword arguments. These are usually passed to the model provider API call. Returns Top model prediction as a message. classmethod schema(by_alias: bool = True, ref_templ...
https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.human.HumanInputChatModel.html
b68d3b5dbbed-9
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/chat_models/langchain.chat_models.human.HumanInputChatModel.html
2819661d7b3c-0
langchain.vectorstores.redis.filters.RedisText¶ class langchain.vectorstores.redis.filters.RedisText(field: str)[source]¶ A RedisText is a RedisFilterField representing a text field in a Redis index. Attributes OPERATORS OPERATOR_MAP escaper Methods __init__(field) equals(other) __init__(field: str)¶ equals(other: Redi...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.filters.RedisText.html
57051c2c6793-0
langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings¶ class langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings(endpoint: str, instance_id: str, username: str, password: str, datasource_name: str, embedding_index_name: str, field_name_mapping: Dict[str, str])[source]¶ ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings.html
57051c2c6793-1
Methods __init__(endpoint, instance_id, username, ...) __init__(endpoint: str, instance_id: str, username: str, password: str, datasource_name: str, embedding_index_name: str, field_name_mapping: Dict[str, str]) → None[source]¶ Examples using AlibabaCloudOpenSearchSettings¶ Alibaba Cloud OpenSearch
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings.html
3a980d96fe69-0
langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch¶ class langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch(opensearch_url: str, index_name: str, embedding_function: Embeddings, **kwargs: Any)[source]¶ Amazon OpenSearch Vector Engine vector store. Example from langchain.vectorst...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-1
Return docs selected using the maximal marginal relevance. as_retriever(**kwargs) Return VectorStoreRetriever initialized from this VectorStore. asearch(query, search_type, **kwargs) Return docs most similar to query using specified search type. asimilarity_search(query[, k]) Return docs most similar to query. asimilar...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-2
Initialize with necessary components. async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and add to the vectorstore. Parameters (List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added texts. Return type List[s...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-3
to “text”. add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, bulk_size: int = 500, **kwargs: Any) → List[str][source]¶ Run more texts through the embeddings and add to the vectorstore. Parameters texts – Iterable of strings to add to the vectorstore. metadatas – Op...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-4
Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStoreRetriever¶ Return VectorStoreRetriever initialized from this VectorStore. Parameters search_type (Optional[str]) – Defines the type of search that the Retriever should perform. Can be “similarity” (default), “mmr”, or “s...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-5
) # Only get the single most similar document from the dataset docsearch.as_retriever(search_kwargs={'k': 1}) # Use a filter to only retrieve documents from a specific paper docsearch.as_retriever( search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}} ) async asearch(query: str, search_type: str, **kwa...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-6
Return VectorStore initialized from documents and embeddings. classmethod from_embeddings(embeddings: List[List[float]], texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, bulk_size: int = 500, ids: Optional[List[str]] = None, **kwargs: Any) → OpenSearchVectorSearch[source]¶ Construct Open...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-7
Higher values lead to more accurate graph but slower indexing speed; default: 512 m: Number of bidirectional links created for each new element. Large impact on memory consumption. Between 2 and 100; default: 16 Keyword Args for Script Scoring or Painless Scripting:is_appx_search: False classmethod from_texts(texts: Li...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-8
lead to more accurate but slower searches; default: 512 ef_construction: Size of the dynamic list used during k-NN graph creation. Higher values lead to more accurate graph but slower indexing speed; default: 512 m: Number of bidirectional links created for each new element. Large impact on memory consumption. Between ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-9
k – Number of Documents to return. Defaults to 4. fetch_k – Number of Documents to fetch to pass to MMR algorithm. lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documen...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-10
k-NN search with pre-filtering or an approximate search with modified post-filtering. (deprecated, use efficient_filter) efficient_filter: the Lucene Engine or Faiss Engine decides whether to perform an exact k-NN search with pre-filtering or an approximate search with modified post-filtering. Optional Args for Script ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
3a980d96fe69-11
query – input text k – Number of Documents to return. Defaults to 4. **kwargs – kwargs to be passed to similarity search. Should include: score_threshold: Optional, a floating point value between 0 to 1 to filter the resulting set of retrieved docs Returns List of Tuples of (doc, similarity_score) similarity_search_wit...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
7bd9c0fae5f6-0
langchain.vectorstores.neo4j_vector.SearchType¶ class langchain.vectorstores.neo4j_vector.SearchType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶ Enumerator of the Distance strategies. VECTOR = 'vector'¶ HYBRID = 'hybrid'¶
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.SearchType.html
7f0547e3c5bc-0
langchain.vectorstores.redis.schema.read_schema¶ langchain.vectorstores.redis.schema.read_schema(index_schema: Optional[Union[Dict[str, str], str, PathLike]]) → Dict[str, Any][source]¶
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.redis.schema.read_schema.html
4fb7688e5c72-0
langchain.vectorstores.azuresearch.AzureSearch¶ class langchain.vectorstores.azuresearch.AzureSearch(azure_search_endpoint: str, azure_search_key: str, index_name: str, embedding_function: Callable, search_type: str = 'hybrid', semantic_configuration_name: Optional[str] = None, semantic_query_language: str = 'en-us', f...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
4fb7688e5c72-1
asearch(query, search_type, **kwargs) Return docs most similar to query using specified search type. asimilarity_search(query[, k]) Return docs most similar to query. asimilarity_search_by_vector(embedding[, k]) Return docs most similar to embedding vector. asimilarity_search_with_relevance_scores(query) Return docs mo...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
4fb7688e5c72-2
similarity_search_with_score(*args, **kwargs) Run similarity search with distance. vector_search(query[, k]) Returns the most similar indexed documents to the query text. vector_search_with_score(query[, k, filters]) Return docs most similar to query. __init__(azure_search_endpoint: str, azure_search_key: str, index_na...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
4fb7688e5c72-3
Returns List of IDs of the added texts. Return type List[str] add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][source]¶ Add texts data to an existing index. async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶ Return ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
4fb7688e5c72-4
score_threshold: Minimum relevance threshold for similarity_score_threshold fetch_k: Amount of documents to pass to MMR algorithm (Default: 20) lambda_mult: Diversity of results returned by MMR; 1 for minimum diversity and 0 for maximum. (Default: 0.5) filter: Filter by document metadata Returns Retriever class for Vec...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
4fb7688e5c72-5
Return docs most similar to query. async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶ Return docs most similar to embedding vector. async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶ Return docs most ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
4fb7688e5c72-6
Return type List[Document] hybrid_search_with_score(query: str, k: int = 4, filters: Optional[str] = None) → List[Tuple[Document, float]][source]¶ Return docs most similar to query with an hybrid query. Parameters query – Text to look up documents similar to. k – Number of Documents to return. Defaults to 4. Returns Li...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
4fb7688e5c72-7
fetch_k – Number of Documents to fetch to pass to MMR algorithm. lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. search(...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
4fb7688e5c72-8
Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. Returns List of Documents most similar to the query vector. similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶ Return docs and relevance...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
4fb7688e5c72-9
Returns List of Documents most similar to the query and score for each Examples using AzureSearch¶ Azure Cognitive Search
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.azuresearch.AzureSearch.html
ae4e0ac44948-0
langchain.vectorstores.neo4j_vector.check_if_not_null¶ langchain.vectorstores.neo4j_vector.check_if_not_null(props: List[str], values: List[Any]) → None[source]¶
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.neo4j_vector.check_if_not_null.html
bd1aba7ca8bc-0
langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch¶ class langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch(embedding: Embeddings, config: AlibabaCloudOpenSearchSettings, **kwargs: Any)[source]¶ Alibaba Cloud OpenSearch vector store. Attributes embeddings Access the query embeddin...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
bd1aba7ca8bc-1
Return docs most similar to query. create_results(json_result) create_results_with_score(json_result) delete([ids]) Delete by vector ID or other criteria. from_documents(documents, embedding[, ids, ...]) Return VectorStore initialized from documents and embeddings. from_texts(texts, embedding[, metadatas, config]) Retu...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
bd1aba7ca8bc-2
Run more texts through the embeddings and add to the vectorstore. add_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and add to the vectorstore. Parameters (List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added text...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
bd1aba7ca8bc-3
Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStoreRetriever¶ Return VectorStoreRetriever initialized from this VectorStore. Parameters search_type (Optional[str]) – Defines the type of search that the Retriever should perform. Can be “similarity” (default), “mmr”, or “s...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
bd1aba7ca8bc-4
) # Only get the single most similar document from the dataset docsearch.as_retriever(search_kwargs={'k': 1}) # Use a filter to only retrieve documents from a specific paper docsearch.as_retriever( search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}} ) async asearch(query: str, search_type: str, **kwa...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
bd1aba7ca8bc-5
False otherwise, None if not implemented. Return type Optional[bool] classmethod from_documents(documents: List[Document], embedding: Embeddings, ids: Optional[List[str]] = None, config: Optional[AlibabaCloudOpenSearchSettings] = None, **kwargs: Any) → AlibabaCloudOpenSearch[source]¶ Return VectorStore initialized from...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
bd1aba7ca8bc-6
Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. Maximal marginal relevan...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
bd1aba7ca8bc-7
Returns List of Documents most similar to the query vector. similarity_search_with_relevance_scores(query: str, k: int = 4, search_filter: Optional[dict] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶ Return docs and relevance scores in the range [0, 1]. 0 is dissimilar, 1 is most similar. Parameters qu...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch.html
44c4aac9afd4-0
langchain.vectorstores.elastic_vector_search.ElasticKnnSearch¶ class langchain.vectorstores.elastic_vector_search.ElasticKnnSearch(index_name: str, embedding: Embeddings, es_connection: Optional['Elasticsearch'] = None, es_cloud_id: Optional[str] = None, es_user: Optional[str] = None, es_password: Optional[str] = None,...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-1
that contains the original text data. Type str, optional Usage:>>> from embeddings import Embeddings >>> embedding = Embeddings.load('glove') >>> es_search = ElasticKnnSearch('my_index', embedding) >>> es_search.add_texts(['Hello world!', 'Another text']) >>> results = es_search.knn_search('Hello') [(Document(page_cont...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-2
Type str, optional Usage:>>> from embeddings import Embeddings >>> embedding = Embeddings.load('glove') >>> es_search = ElasticKnnSearch('my_index', embedding) >>> es_search.add_texts(['Hello world!', 'Another text']) >>> results = es_search.knn_search('Hello') [(Document(page_content='Hello world!', metadata={}), 0.9)...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-3
asimilarity_search(query[, k]) Return docs most similar to query. asimilarity_search_by_vector(embedding[, k]) Return docs most similar to embedding vector. asimilarity_search_with_relevance_scores(query) Return docs most similar to query. create_knn_index(mapping) Create a new k-NN index in Elasticsearch. delete([ids]...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-4
similarity_search_with_score(query[, k]) Pass through to knn_search including score __init__(index_name: str, embedding: Embeddings, es_connection: Optional['Elasticsearch'] = None, es_cloud_id: Optional[str] = None, es_user: Optional[str] = None, es_password: Optional[str] = None, vector_query_field: Optional[str] = '...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-5
to associate with the texts. model_id (str, optional) – The ID of the model to use for transforming the texts into vectors. refresh_indices (bool, optional) – Whether to refresh the Elasticsearch indices after adding the texts. **kwargs – Arbitrary keyword arguments. Returns A list of IDs for the added texts. async cla...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-6
k: Amount of documents to return (Default: 4) score_threshold: Minimum relevance threshold for similarity_score_threshold fetch_k: Amount of documents to pass to MMR algorithm (Default: 20) lambda_mult: Diversity of results returned by MMR; 1 for minimum diversity and 0 for maximum. (Default: 0.5) filter: Filter by doc...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-7
Return docs most similar to query. async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶ Return docs most similar to embedding vector. async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶ Return docs most ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-8
to associate with the texts. **kwargs – Arbitrary keyword arguments. Returns A new ElasticKnnSearch instance. knn_hybrid_search(query: Optional[str] = None, k: Optional[int] = 10, query_vector: Optional[List[float]] = None, model_id: Optional[str] = None, size: Optional[int] = 10, source: Optional[bool] = True, knn_boo...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-9
Returns A list of tuples, where each tuple contains a Document object and a score. knn_search(query: Optional[str] = None, k: Optional[int] = 10, query_vector: Optional[List[float]] = None, model_id: Optional[str] = None, size: Optional[int] = 10, source: Optional[bool] = True, fields: Optional[Union[List[Mapping[str, ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-10
among selected documents. Parameters query – Text to look up documents similar to. k – Number of Documents to return. Defaults to 4. fetch_k – Number of Documents to fetch to pass to MMR algorithm. lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to max...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
44c4aac9afd4-11
Return docs most similar to embedding vector. Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. Returns List of Documents most similar to the query vector. similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Docume...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.elastic_vector_search.ElasticKnnSearch.html
ee0e31c7667f-0
langchain.vectorstores.timescalevector.TimescaleVector¶ class langchain.vectorstores.timescalevector.TimescaleVector(service_url: str, embedding: Embeddings, collection_name: str = 'langchain_store', num_dimensions: int = 1536, distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, pre_delete_collection: bool =...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html
ee0e31c7667f-1
Attributes DEFAULT_INDEX_TYPE embeddings Access the query embedding object if available. Methods __init__(service_url, embedding[, ...]) aadd_documents(documents, **kwargs) Run more documents through the embeddings and add to the vectorstore. aadd_embeddings(texts, embeddings[, ...]) Add embeddings to the vectorstore. ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html
ee0e31c7667f-2
asimilarity_search_by_vector(embedding[, k, ...]) Return docs most similar to embedding vector. asimilarity_search_with_relevance_scores(query) Return docs most similar to query. asimilarity_search_with_score(query[, k, ...]) Return docs most similar to query. asimilarity_search_with_score_by_vector(...) create_index([...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html
ee0e31c7667f-3
Return docs most similar to embedding vector. similarity_search_with_relevance_scores(query) Return docs and relevance scores in the range [0, 1]. similarity_search_with_score(query[, k, ...]) Return docs most similar to query. similarity_search_with_score_by_vector(embedding) __init__(service_url: str, embedding: Embe...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html
ee0e31c7667f-4
Run more texts through the embeddings and add to the vectorstore. Parameters texts – Iterable of strings to add to the vectorstore. metadatas – Optional list of metadatas associated with the texts. kwargs – vectorstore specific parameters Returns List of ids from adding the texts into the vectorstore. add_documents(doc...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html
ee0e31c7667f-5
Return VectorStore initialized from documents and embeddings. async classmethod afrom_embeddings(text_embeddings: List[Tuple[str, List[float]]], embedding: Embeddings, metadatas: Optional[List[dict]] = None, collection_name: str = 'langchain_store', distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, ids: Op...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html
ee0e31c7667f-6
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStore...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.timescalevector.TimescaleVector.html