High-level function to call Azure OpenAI chat using tidyllm

azure_chat(
  message,
  use_cache = FALSE,
  persist_cache = TRUE,
  cache_path = NULL,
  ...
)

Arguments

message

A character string with the prompt or message.

use_cache

Logical. If TRUE, reuse a cached response for identical requests within the current R session. Default: FALSE.

persist_cache

Logical. If TRUE, persist cached responses to disk so they can be reloaded in later sessions. Default: TRUE.

cache_path

Optional character string path to the cache file used when persist_cache = TRUE. Default: .cache_agrillm.rds in the current working directory.

...

Additional arguments passed to azure_openai_chat.

Value

The response from Azure OpenAI chat.

Examples

if (FALSE) { # \dontrun{
msg <- llm_message("Test prompt")
response <- azure_chat(msg)
print(response)
} # }