INNER CODE UNIT · Rust

try_from

lanterndata/lantern · lantern_cli/src/embeddings/core/mod.rs:46

    fn try_from(value: &str) -> Result<Self, Self::Error> {
        Self::from_str(value)
    }
}

impl ToString for Runtime {
    fn to_string(&self) -> String {
        match self {
            Runtime::Ort => "ort".to_owned(),
            Runtime::OpenAi => "openai".to_owned(),
            Runtime::Cohere => "cohere".to_owned(),
        }
    }
}

pub enum EmbeddingRuntime<'a> {
    Cohere(cohere_runtime::CohereRuntime<'a>),
    OpenAi(openai_runtime::OpenAiRuntime<'a>),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…