use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(transparent)]
pub struct InstallProviderId(String);
impl InstallProviderId {
pub fn huggingface() -> Self {
Self("huggingface".to_owned())
}
pub fn ollama() -> Self {
Self("ollama".to_owned())
}
pub fn as_str(&self) -> &str {
&self.0
}
}
impl From<&str> for InstallProviderId {
fn from(value: &str) -> Self {
Self(value.to_owned())
}
}
impl std::fmt::Display for InstallProviderId {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(&self.0)
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum InstallAvailability {
Ready,
Unavailable {
hint: String,
},
}