Skip to content

Commit 25d0731

Browse files
Henrique Schumann Costavmesel
authored andcommitted
fix typo in COSINE_SIMILARITY_THRESHOLD
1 parent 94062b7 commit 25d0731

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎src/dialog/llm/embeddings.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from dialog.models import CompanyContent
77
from 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

1010
EMBEDDINGS_LLM = OpenAIEmbeddings(openai_api_key=OPENAI_API_KEY)
1111

@@ -26,7 +26,7 @@ def generate_embedding(document: str):
2626
def 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:

‎src/dialog/settings.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
LLM_RELEVANT_CONTENTS = config("LLM_RELEVANT_CONTENTS", default=1, cast=int)
2222
LLM_MEMORY_SIZE = config("LLM_MEMORY_SIZE", default=5, cast=int)
2323
STATIC_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
2727
CORS_ALLOW_ORIGINS = config("CORS_ALLOW_ORIGINS", cast=Csv(), default="*")

0 commit comments

Comments
 (0)