Add bounded commit-pinned Hugging Face source streaming

This commit is contained in:
ms2k 2026-07-17 06:32:48 +09:00
commit e13c01441c

View file

@ -0,0 +1,25 @@
use std::time::Duration;
use thiserror::Error;
#[derive(Clone, Debug, Eq, Error, PartialEq)]
pub enum HfSourceError {
#[error("Hugging Face source request is invalid")]
InvalidRequest,
#[error("Hugging Face source authorization failed")]
Authorization,
#[error("Hugging Face source was not found")]
NotFound,
#[error("Hugging Face source changed")]
SourceChanged,
#[error("Hugging Face source returned an unsupported entry")]
UnsupportedEntry,
#[error("Hugging Face source response is invalid")]
InvalidResponse,
#[error("Hugging Face source inventory is invalid")]
InvalidInventory,
#[error("Hugging Face inventory capacity is exhausted")]
Capacity,
#[error("Hugging Face source failed transiently")]
Transient { retry_after: Option<Duration> },
}