Continuum C++ API
Unified runtime for token + tensor execution
Loading...
Searching...
No Matches
hit_verifier.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5namespace continuum::runtime {
6
17 public:
18 virtual ~HitVerifier() = default;
20 virtual bool verify(const std::string& cached_prompt, const std::string& new_prompt,
21 float similarity) const = 0;
23 virtual std::string name() const = 0;
24};
25
47 public:
48 struct Verdict {
49 bool accept = true;
50 std::string reason;
51 };
52 static Verdict explain(const std::string& cached_prompt, const std::string& new_prompt);
53 bool verify(const std::string& cached_prompt, const std::string& new_prompt, float similarity) const override;
54 std::string name() const override { return "lexical-near-miss-v1"; }
55};
56
57} // namespace continuum::runtime
Definition hit_verifier.hpp:16
virtual ~HitVerifier()=default
virtual bool verify(const std::string &cached_prompt, const std::string &new_prompt, float similarity) const =0
True to serve the cached answer, false to treat the lookup as a miss.
virtual std::string name() const =0
Stable name, for metrics and logs.
Definition hit_verifier.hpp:46
static Verdict explain(const std::string &cached_prompt, const std::string &new_prompt)
std::string name() const override
Stable name, for metrics and logs.
Definition hit_verifier.hpp:54
bool verify(const std::string &cached_prompt, const std::string &new_prompt, float similarity) const override
True to serve the cached answer, false to treat the lookup as a miss.
Definition checkpoint.hpp:12
std::string reason
"numbers", "polarity", "negation", "direction", "substitution", "ok", ...
Definition hit_verifier.hpp:50
bool accept
Definition hit_verifier.hpp:49