digitalfabrik / integreat-chat

Interface to self-hosted large language models and vector databases to provide improved Integreat Chat functionality
https://integreat-app.de
MIT License
1 stars 0 forks source link

Distance between query and result documents #43

Closed svenseeberg closed 2 months ago

svenseeberg commented 2 months ago

We should return the distance between our query and returned documents to get an idea how well the documents match the query. If the distance is too low, we should omit the documents from the result.

https://python.langchain.com/docs/how_to/add_scores_retriever/

svenseeberg commented 2 months ago

We should also address a deprecation warning at the same time:

answer_service.py:55: LangChainDeprecationWarning: The method `BaseRetriever.get_relevant_documents` was deprecated in langchain-core 0.1.46 and will be removed in 1.0. Use invoke instead.