request_base_perplexity: Base for a request to the Perplexity API

View source: R/service-perplexity.R

request_base_perplexityR Documentation

Base for a request to the Perplexity API

Description

This function sets up a POST request to the Perplexity API's chat/completions endpoint and includes necessary headers such as 'accept', 'content-type', and 'Authorization' with a bearer token.

Usage

request_base_perplexity(api_key = Sys.getenv("PERPLEXITY_API_KEY"))

Arguments

api_key

String containing a Perplexity API key. Defaults to the PERPLEXITY_API_KEY environment variable if not specified.

Value

An httr2 request object pre-configured with the API endpoint and required headers.


gptstudio documentation built on May 29, 2024, 12:30 p.m.