View source: R/service-perplexity.R
create_completion_perplexity | R Documentation |
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")
)
prompt |
A list containing prompts to be sent in the chat. |
model |
A character string representing the Perplexity model to be used. Defaults to "mistral-7b-instruct". |
api_key |
The API key for accessing the Perplexity API. Defaults to the PERPLEXITY_API_KEY environment variable. |
The response from the Perplexity API containing the completion for the chat.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.