An options manager for configuring agrillm parameters. This object provides methods to get and set all related parameters.

agrillm_options

Available Options

cache_dir

Directory for caching AI responses. Default: ".agrillm" in the current working directory

crops

List of crops and their associated names. Default: list of wheat, barley, and canola varieties

Methods

get(key)

Retrieve the value of an option by its key (e.g., "crops")

set(key, value)

Set the value of an option by its key

reset()

Reset all options to their default values

Examples

# Get default crops
agrillm_options$get("crops")
#> $wheat
#> [1] "wheat"        "bread wheat"  "spring wheat" "winter wheat"
#> 
#> $barley
#> [1] "barley"         "feed barley"    "malting barley"
#> 
#> $canola
#> [1] "canola"       "oilseed rape" "rapeseed"    
#> 

# Set custom values
agrillm_options$set("crops" = list(
    wheat = c("wheat", "bread wheat"),
    barley = c("barley", "feed barley"),
    canola = c("canola", "oilseed rape")
))
#> Warning: AZURE_OPENAI_API_KEY environment variable is not set. Azure LLM calls will fail.
#> Warning: AZURE_ENDPOINT_URL environment variable is not set. Azure LLM calls will fail.

# Reset to defaults
agrillm_options$reset()