| Name | Type | Description |
|---|---|---|
examples* | list[dict[str, str]] | List of examples to use in the prompt. |
embeddings* | Embeddings | An initialized embedding API interface, e.g. OpenAIEmbeddings(). |
vectorstore_cls* | type[VectorStore] | |
k | int | Default: 4 |
fetch_k | int | Default: 20 |
input_keys | list[str] | None | Default: None |
example_keys | list[str] | None | Default: None |
vectorstore_kwargs | dict[str, Any] | None | Default: None |
vectorstore_cls_kwargs | Any | Default: {} |
Create k-shot example selector using example list and embeddings.
Reshuffles examples dynamically based on Max Marginal Relevance.
A vector store DB interface class, e.g. FAISS.
Number of examples to select.
Number of Document objects to fetch to pass to MMR algorithm.
If provided, the search is based on the input variables instead of all variables.
If provided, keys to filter examples to.
Extra arguments passed to similarity_search function
of the VectorStore.
optional kwargs containing url for vector store