Learn R Programming

gooseR (version 0.1.2)

goose_test_cli: Test if Goose CLI is Working

Description

Tests if Goose CLI is properly configured and can execute queries. This is especially useful for Block employees who have CLI configured but don't need to provide API keys in R.

Usage

goose_test_cli(verbose = TRUE, timeout = 60)

Value

Logical, TRUE if CLI works, FALSE otherwise

Arguments

verbose

Logical, whether to print status messages

timeout

Numeric, timeout in seconds for the test query (default 60). Increase this if authentication prompts require more time.

Examples

Run this code
if (FALSE) {
# Check if CLI works
if (goose_test_cli()) {
  # Ready to use goose_ask() etc.
  response <- goose_ask("Hello!")
} else {
  # May need configuration
  goose_configure(provider = "openai", model = "gpt-4", api_key = "key")
}

# Allow more time for authentication
goose_test_cli(timeout = 120)
}

Run the code above in your browser using DataLab