aws-genai-llm-chatbot icon indicating copy to clipboard operation
aws-genai-llm-chatbot copied to clipboard

Vector scores are getting incorrectly sorted in descending order when metric is "L2" during Aurora Semantic Query.

Open gbone-restore opened this issue 8 months ago • 1 comments

To handle the case where the metric is "L2" and ensure that scores are sorted in ascending order, we can add a new condition into the this if clause below to handle this use case. This code only gets invoked when retrieved documents is less than specified limit.

https://github.com/aws-samples/aws-genai-llm-chatbot/blob/372710ae19ec7f8331f3190590185db711094b73/lib/shared/layers/python-sdk/python/genai_core/aurora/query.py#L226

gbone-restore avatar Jun 05 '24 18:06 gbone-restore