langchain/docs/modules/prompts/example_selectors/examples
Tobias van der Werff 8d07ba0d51
Fix wrong class instantiation in docs MMR example (#5501)
# Fix wrong class instantiation in docs MMR example

<!--
Thank you for contributing to LangChain! Your PR will appear in our
release under the title you set. Please make sure it highlights your
valuable contribution.

Replace this with a description of the change, the issue it fixes (if
applicable), and relevant context. List any dependencies required for
this change.

After you're done, someone will review your PR. They may suggest
improvements. If no one reviews your PR within a few days, feel free to
@-mention the same people again, as notifications can get lost.

Finally, we'd love to show appreciation for your contribution - if you'd
like us to shout you out on Twitter, please also include your handle!
-->

When looking at the Maximal Marginal Relevance ExampleSelector example
at
https://python.langchain.com/en/latest/modules/prompts/example_selectors/examples/mmr.html,
I noticed that there seems to be an error. Initially, the
`MaxMarginalRelevanceExampleSelector` class is used as an
`example_selector` argument to the `FewShotPromptTemplate` class. Then,
according to the text, a comparison is made to regular similarity
search. However, the `FewShotPromptTemplate` still uses the
`MaxMarginalRelevanceExampleSelector` class, so the output is the same.

To fix it, I added an instantiation of the
`SemanticSimilarityExampleSelector` class, because this seems to be what
is intended.


## Who can review?

@hwchase17
2023-05-31 17:30:59 -07:00
..
custom_example_selector.md big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
length_based.ipynb big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
mmr.ipynb Fix wrong class instantiation in docs MMR example (#5501) 2023-05-31 17:30:59 -07:00
ngram_overlap.ipynb big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
similarity.ipynb big docs refactor (#1978) 2023-03-26 19:49:46 -07:00