cheshire-cat-ai / core

Production ready AI agent framework
https://cheshirecat.ai
GNU General Public License v3.0
2.14k stars 282 forks source link

Replace equals with levenshtein method #862

Closed lucagobbi closed 1 week ago

lucagobbi commented 1 week ago

Description

As discussed in issue #859, we should avoid strict equality checks for classified strings and instead use a fuzzy approach like the Levenshtein distance. To prevent outliers from being forced into the nearest label, a threshold is set at 0.5. This is fairly permissive but should be suitable for most use cases.

Let's try it out

Type of change

Checklist:

pieroit commented 1 week ago

Looks reasonable I'll test thanks @lucagobbi !