This function attempts to interpret a farmer's free-text description of a sowing window using a combination of deterministic rules and an LLM fallback (only AI is implemented now). It returns a structured sowing window with start/end dates and any assumptions made.

resolve_sowing(sowing_input, use_ai = TRUE, use_cache = TRUE)

Arguments

sowing_input

Character string. The sowing window description to resolve.

use_ai

Logical. Whether to use AI fallback if no deterministic match is found. Default: TRUE.

use_cache

Logical. Whether to use caching for AI responses. Default: TRUE.

Value

A list with fields: type, start, end, shift, source, raw_input, assumptions. If not resolvable, type is "unknown".

Examples

# Example with AI backend configured:
# resolve_sowing("early May")
# resolve_sowing("mid June")
# resolve_sowing("unknown phrase")