Skip to main content

suggest_similar

Function
This function is defined in the parse_utils module.
Find the most similar string from candidates using Levenshtein distance. This function is ONLY called on error paths, never on happy paths.

Signature

Parameters

str
required
The invalid value
Iterable
required
Valid options to compare against
int
default:"2"
Maximum edit distance to consider a match

Returns

Optional[str]
Most similar candidate if within max_distance, None otherwise

Used By

Source

View on GitHub

praisonaiagents/config/parse_utils.py at line 142