ExLLM.Testing.TestCacheMatcher (ex_llm v0.8.1)
View SourceIntelligent matching of requests to cached responses.
This module provides sophisticated request-to-cache matching strategies including exact matching, fuzzy matching, content-based matching, and test context-aware matching for the automatic test response caching system.
Summary
Functions
Calculate similarity score between two requests.
Find context-aware match considering test module and tags.
Find exact match for a request in cached responses.
Extract message content from request for semantic matching.
Find best match using comprehensive strategy.
Find fuzzy match for a request with configurable tolerance.
Normalize request for comparison.
Find semantic match based on request content similarity.
Types
Functions
Calculate similarity score between two requests.
@spec context_match(map(), [cached_request()], map()) :: match_result()
Find context-aware match considering test module and tags.
@spec exact_match(map(), [cached_request()]) :: match_result()
Find exact match for a request in cached responses.
Extract message content from request for semantic matching.
@spec find_best_match(map(), [cached_request()], atom()) :: match_result()
Find best match using comprehensive strategy.
@spec fuzzy_match(map(), [cached_request()], float()) :: match_result()
Find fuzzy match for a request with configurable tolerance.
Normalize request for comparison.
@spec semantic_match(map(), [cached_request()]) :: match_result()
Find semantic match based on request content similarity.