cooklang-import 0.8.0

A tool for importing recipes into Cooklang format
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::url_to_text::text::TextExtractor;
use std::error::Error;

pub async fn process(text: &str, extract: bool) -> Result<String, Box<dyn Error + Send + Sync>> {
    if extract {
        // Run through LLM extractor
        TextExtractor::extract(text, "direct-input").await
    } else {
        // Assume already formatted
        Ok(text.to_string())
    }
}