OpenPay (1 crate, 3277 LOC, 18 tests)
op-ewallets-asia APAC e-wallet rail adapters. Alipay Cross-Border v3,
WeChat Pay (JSAPI/Native/H5/MicroPay) with constant-time
HMAC notify, UPI 2.0 (collect/intent/mandate/VPA),
Paytm, GrabPay, GoPay (Midtrans), Touch'n Go.
EMVCo MPM TLV + CRC-16/CCITT-FALSE encoder for
PromptPay (TH), PayNow (SG), DuitNow (MY), QRIS (ID).
Transport-free traits — operators inject HTTP + RSA-SHA256
signers (keeps POS firmware / WASM consumers reqwest-free).
Smart Byte (1 crate, 1310 LOC, 15 tests)
smart-byte-zk Selective-disclosure ZK primitives.
Real: Bulletproofs over Ristretto255 (range proofs at
8/16/32/64-bit), RangePredicate / InequalityPredicate /
SetMembershipPredicate all delegating to Bulletproofs.
Stubs (documented): Groth16, PLONK — deterministic
placeholder proofs satisfying ZkScheme trait for future
arkworks integration. AnonCred sketch + VerifiablePresentation
builder.
EOC (1 crate, ~3000 LOC, 36 tests)
eoc-rag RAG orchestrator. Naive (Lewis 2020), HyDE (Gao 2022),
RAG-Fusion + RRF (Cormack 2009), Self-RAG (Asai 2023)
with Retrieve/ISREL/ISSUP/ISUSE critique tokens,
Corrective RAG (Yan 2024) with retrieval evaluator
+ external fallback, Adaptive RAG (Jeong 2024)
complexity router. Chunking: sentence-window, semantic,
recursive, late-chunking. Span-backed citations with
3-mode enforcement. SelfCheckGPT consistency guard.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
44 lines
1.2 KiB
Rust
44 lines
1.2 KiB
Rust
//! Errors raised by the RAG orchestrator.
|
|
|
|
use thiserror::Error;
|
|
|
|
/// RAG pipeline error.
|
|
#[derive(Debug, Error)]
|
|
pub enum RagError {
|
|
/// The document store could not be queried.
|
|
#[error("store error: {0}")]
|
|
Store(String),
|
|
|
|
/// An embedder backend failed.
|
|
#[error("embedder error: {0}")]
|
|
Embedder(String),
|
|
|
|
/// A generator (LLM) backend failed.
|
|
#[error("generator error: {0}")]
|
|
Generator(String),
|
|
|
|
/// A re-ranker backend failed.
|
|
#[error("reranker error: {0}")]
|
|
Reranker(String),
|
|
|
|
/// The configuration is invalid (e.g. `top_k == 0`).
|
|
#[error("invalid config: {0}")]
|
|
Config(String),
|
|
|
|
/// The pipeline produced an answer with no citation when one was
|
|
/// required by policy.
|
|
#[error("citation required but answer carries none")]
|
|
CitationRequired,
|
|
|
|
/// The pipeline produced an answer that failed the consistency
|
|
/// guard.
|
|
#[error("hallucination guard rejected answer: {0}")]
|
|
GuardRejected(String),
|
|
|
|
/// Retrieval returned zero chunks where at least one was required.
|
|
#[error("no chunks retrieved for query")]
|
|
NoChunks,
|
|
}
|
|
|
|
/// Convenience alias.
|
|
pub type RagResult<T> = std::result::Result<T, RagError>;
|