Skip to content

Commit

Permalink
wac: split long function definition in multiple lines
Browse files Browse the repository at this point in the history
And order the keyword arguments alphabetically while at it.

Fixes the following flake8 error:

E501 line too long (330 > 120 characters)
  • Loading branch information
stintel committed Jan 17, 2024
1 parent dd76fa1 commit b246a65
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/internal/wac.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,18 @@ def add_ha_entities():
# WAC Search


def wac_search(command, exact_match=False, distance=SEARCH_DISTANCE, num_results=CORRECT_ATTEMPTS, raw=False, token_match_threshold=TOKEN_MATCH_THRESHOLD, semantic=TYPESENSE_SEMANTIC_MODE, semantic_model=TYPESENSE_SEMANTIC_MODEL, vector_distance_threshold=VECTOR_DISTANCE_THRESHOLD, hybrid_score_threshold=HYBRID_SCORE_THRESHOLD):
def wac_search(
command,
distance=SEARCH_DISTANCE,
exact_match=False,
hybrid_score_threshold=HYBRID_SCORE_THRESHOLD,
num_results=CORRECT_ATTEMPTS,
raw=False,
semantic=TYPESENSE_SEMANTIC_MODE,
semantic_model=TYPESENSE_SEMANTIC_MODEL,
token_match_threshold=TOKEN_MATCH_THRESHOLD,
vector_distance_threshold=VECTOR_DISTANCE_THRESHOLD,
):
log.info(
f"Searching for command '{command}' with distance {distance} token match threshold {token_match_threshold} "
f"exact match {exact_match} semantic {semantic} with vector distance threshold {vector_distance_threshold} "
Expand Down

0 comments on commit b246a65

Please sign in to comment.