matchers.d.ts 962 B

123456789101112131415161718192021222324252627
  1. export type RelativeCloseToMatcherOptions = {
  2. threshold?: number;
  3. algorithm?: "levenshtein";
  4. };
  5. export declare function toBeRelativeCloseTo(received: string, expected: string, options?: RelativeCloseToMatcherOptions): Promise<{
  6. pass: boolean;
  7. message: () => string;
  8. }>;
  9. export type AbsoluteCloseToMatcherOptions = {
  10. threshold?: number;
  11. algorithm?: "levenshtein";
  12. };
  13. export declare function toBeAbsoluteCloseTo(received: string, expected: string, options?: AbsoluteCloseToMatcherOptions): Promise<{
  14. pass: boolean;
  15. message: () => string;
  16. }>;
  17. export type SemanticCloseToMatcherOptions = {
  18. embeddings: {
  19. embedQuery: (query: string) => number[] | Promise<number[]>;
  20. };
  21. threshold?: number;
  22. algorithm?: "cosine" | "dot-product";
  23. };
  24. export declare function toBeSemanticCloseTo(received: string, expected: string, options: SemanticCloseToMatcherOptions): Promise<{
  25. pass: boolean;
  26. message: () => string;
  27. }>;