Skip to content

embedding-similarity accepts out-of-range threshold #34

Description

@royalpinto007

Problem

threshold: NaN never passes (even identical texts), threshold: -5 always passes (even junk): the threshold is used raw with no range check.

Where

src/scorers/embedding-similarity.ts (typeof spec.threshold === "number" ? spec.threshold : 0.8, then score >= threshold).

Acceptance

Add a failing test first asserting threshold: NaN (and <0/>1) fails validation or is clamped. Then fix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions