langchain/docs/modules/prompts
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
..
example_selectors/examples Fix wrong class instantiation in docs MMR example (#5501) 2023-05-31 17:30:59 -07:00
output_parsers Harrison/datetime parser (#4693) 2023-05-29 07:52:30 -07:00
prompt_templates Clarification of the reference to the "get_text_legth" function in ge… (#5154) 2023-05-23 20:43:38 -07:00
chat_prompt_template.ipynb Improve chat prompt template docs (#3719) 2023-04-28 20:16:22 -07:00
example_selectors.rst
getting_started.ipynb Harrison/prompt constructor methods (#4616) 2023-05-13 09:23:51 -07:00
output_parsers.rst
prompt_templates.rst