Skip to main content

Module enrich

Module enrich 

Source
Expand description

Note enrichment operations.

This module provides workflows for finding notes with empty fields and updating them with new content.

§Example

use ankit_engine::Engine;
use ankit_engine::enrich::EnrichQuery;

let engine = Engine::new();

// Find notes missing the "Example" field
let query = EnrichQuery {
    search: "deck:Japanese".to_string(),
    empty_fields: vec!["Example".to_string()],
};

let candidates = engine.enrich().find_candidates(&query).await?;
println!("Found {} notes needing enrichment", candidates.len());

// Update a note with enriched content
use std::collections::HashMap;
let mut updates = HashMap::new();
updates.insert("Example".to_string(), "New example sentence".to_string());
engine.enrich().update_note(candidates[0].note_id, &updates).await?;

Structs§

EnrichCandidate
A note that is a candidate for enrichment.
EnrichEngine
Enrichment workflow engine.
EnrichFailure
Details about a failed enrichment.
EnrichPipelineReport
Report from an enrichment pipeline commit.
EnrichQuery
Query parameters for finding notes to enrich.
EnrichReport
Report from a batch enrichment operation.
EnrichmentPipeline
A pipeline for batch enrichment operations.