CdC-SI / eak-copilot

The official repository of the EAK-Copilot project as part of the Innovation Fellowship 2024.
https://cdc-si.github.io/eak-copilot/
GNU General Public License v3.0
4 stars 0 forks source link

create autocomplete API facade #171

Closed K-Schubert closed 1 month ago

K-Schubert commented 1 month ago

Description

The /autocomplete facade calls the /exact_match, /fuzzy_match and /semantic_similarity_match endpoints to return a list of suggested questions for autocomplete based on the search bar input.

If combined results of get_exact_match() and get_fuzzy_match() return less than 5 results, the get_semantic_similarity_match() method is called after every new "space" character in the question (user query) is added as well as when a "?" character is added at the end of the question. This makes a POST request to the /embed endpoint (and thus currently consumes OpenAI tokens for embedding).