This function sends a prompt to the GROQ API and returns the model's structured response.

groq_query(
  prompt,
  model = "mixtral-8x7b-32768",
  api_key = Sys.getenv("GROQ_API_KEY")
)

Arguments

prompt

A character string containing the prompt.

model

The GROQ model to use. Default: "mixtral-8x7b-32768".

api_key

GROQ API key. If NULL, will look for environment variable "GROQ_API_KEY".

Value

A character string containing the model response.

Examples

if (FALSE) { # \dontrun{
  prompt <- idp_outcome_priors_prompt()
  res <- groq_query(prompt)
  print(res)
} # }