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

agrillm_options

Value

An options manager object created by optree::create_options_manager() with methods get(), set(), and reset() for managing agrillm configuration parameters.

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"). Returns the option value.

set(key, value)

Set the value of an option by its key. Returns the options manager invisibly.

reset()

Reset all options to their default values. Returns the options manager invisibly.

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