This 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)

Arguments

decision_input

Character string. The free-text description of the decision to resolve.

use_ai

Logical. Whether to use AI fallback if deterministic rules do not yield a clear resolution. Default: TRUE.

use_cache

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

Value

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".

Examples

# 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?")