R/resolve_decision.R
resolve_decision.RdThis function takes a free-text description of a decision (e.g. "sowing time choice", "cultivar choice", "yield risk assessment", "fertilisation nitrogen choice") and attempts to classify it into one of the allowed decision categories. It uses deterministic rules where possible, and falls back to an LLM-based classification if enabled. The output includes the resolved decision type, any extracted year range, the source of the resolution, and any assumptions made during interpretation.
resolve_decision(decision_input, use_ai = TRUE, use_cache = TRUE)A list with fields: type (decision category), year_start, year_end, source (resolution method), raw_input, assumptions. If the input cannot be resolved, type will be "unknown".
# With AI fallback enabled:
# resolve_decision("What about sowing time choice?")
# resolve_decision("I'm thinking about cultivar choice for the next season.")
# resolve_decision("How does the yield risk assessment look?")