View source: R/cli_integration.R
| goose_test_cli | R Documentation |
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.
goose_test_cli(verbose = TRUE, timeout = 60)
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. |
Logical, TRUE if CLI works, FALSE otherwise
## Not run:
# 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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.