This function sends a series of messages alongside a chosen model to the Perplexity API to generate a chat completion. It returns the API's generated responses.
create_completion_perplexity(
prompt,
model = "mistral-7b-instruct",
api_key = Sys.getenv("PERPLEXITY_API_KEY")
)
The response from the Perplexity API containing the completion for the chat.
A list containing prompts to be sent in the chat.
A character string representing the Perplexity model to be used. Defaults to "mistral-7b-instruct".
The API key for accessing the Perplexity API. Defaults to the PERPLEXITY_API_KEY environment variable.