VectorStoreIndexWrapper#

class langchain.indexes.vectorstore.VectorStoreIndexWrapper[source]#

Bases: BaseModel

Wrapper around a vectorstore for easy access.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param vectorstore: VectorStore [Required]#
async aquery(question: str, llm: BaseLanguageModel | None = None, retriever_kwargs: Dict[str, Any] | None = None, **kwargs: Any) str[source]#

Query the vectorstore.

Parameters:
  • question (str)

  • llm (BaseLanguageModel | None)

  • retriever_kwargs (Dict[str, Any] | None)

  • kwargs (Any)

Return type:

str

async aquery_with_sources(question: str, llm: BaseLanguageModel | None = None, retriever_kwargs: Dict[str, Any] | None = None, **kwargs: Any) dict[source]#

Query the vectorstore and get back sources.

Parameters:
  • question (str)

  • llm (BaseLanguageModel | None)

  • retriever_kwargs (Dict[str, Any] | None)

  • kwargs (Any)

Return type:

dict

query(question: str, llm: BaseLanguageModel | None = None, retriever_kwargs: Dict[str, Any] | None = None, **kwargs: Any) str[source]#

Query the vectorstore.

Parameters:
  • question (str)

  • llm (BaseLanguageModel | None)

  • retriever_kwargs (Dict[str, Any] | None)

  • kwargs (Any)

Return type:

str

query_with_sources(question: str, llm: BaseLanguageModel | None = None, retriever_kwargs: Dict[str, Any] | None = None, **kwargs: Any) dict[source]#

Query the vectorstore and get back sources.

Parameters:
  • question (str)

  • llm (BaseLanguageModel | None)

  • retriever_kwargs (Dict[str, Any] | None)

  • kwargs (Any)

Return type:

dict