fromExamples<
C extends typeof VectorStore
>(
examples: Record<string, string>[],
| Name | Type | Description |
|---|---|---|
examples* | Record<string, string>[] | The list of examples to be used. |
embeddings* | Embeddings | The instance of Embeddings to be used. |
vectorStoreCls* | C | The VectorStore class to be used. |
options | __type & Parameters<C["fromTexts"]>[3] | Default: {} |
Static method that creates a new instance of SemanticSimilarityExampleSelector. It takes a list of examples, an instance of Embeddings, a VectorStore class, and an options object as parameters. It converts the examples to strings, creates a VectorStore from the strings and the embeddings, and returns a new SemanticSimilarityExampleSelector with the created VectorStore and the options provided.
The options object for the SemanticSimilarityExampleSelector.