File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 55
66from dialog .models import CompanyContent
77from dialog .models .db import session
8- from dialog .settings import OPENAI_API_KEY , CONSINE_SIMILARITY_THRESHOLD
8+ from dialog .settings import OPENAI_API_KEY , COSINE_SIMILARITY_THRESHOLD
99
1010EMBEDDINGS_LLM = OpenAIEmbeddings (openai_api_key = OPENAI_API_KEY )
1111
@@ -26,7 +26,7 @@ def generate_embedding(document: str):
2626def get_most_relevant_contents_from_message (message , top = 5 , dataset = None ):
2727 message_embedding = generate_embedding (message )
2828 filters = [
29- CompanyContent .embedding .cosine_distance (message_embedding ) < CONSINE_SIMILARITY_THRESHOLD ,
29+ CompanyContent .embedding .cosine_distance (message_embedding ) < COSINE_SIMILARITY_THRESHOLD ,
3030 ]
3131
3232 if dataset is not None :
Original file line number Diff line number Diff line change 2121LLM_RELEVANT_CONTENTS = config ("LLM_RELEVANT_CONTENTS" , default = 1 , cast = int )
2222LLM_MEMORY_SIZE = config ("LLM_MEMORY_SIZE" , default = 5 , cast = int )
2323STATIC_FILE_LOCATION = config ("STATIC_FILE_LOCATION" , "/app/static" )
24- CONSINE_SIMILARITY_THRESHOLD = config ("CONSINE_SIMILARITY_THRESHOLD" , default = 0.2 , cast = float )
24+ COSINE_SIMILARITY_THRESHOLD = config ("CONSINE_SIMILARITY_THRESHOLD" , default = 0.2 , cast = float )
2525
2626# Cors
2727CORS_ALLOW_ORIGINS = config ("CORS_ALLOW_ORIGINS" , cast = Csv (), default = "*" )
You can’t perform that action at this time.
0 commit comments