query_openai_api {gptstudio} | R Documentation |
A function that sends a request to the OpenAI API and returns the response.
Description
A function that sends a request to the OpenAI API and returns the response.
Usage
query_openai_api(
task,
request_body,
openai_api_key = Sys.getenv("OPENAI_API_KEY")
)
Arguments
task |
A character string that specifies the task to send to the API. |
request_body |
A list that contains the parameters for the task. |
openai_api_key |
String containing an OpenAI API key. Defaults to the OPENAI_API_KEY environmental variable if not specified. |
Value
The response from the API.
[Package gptstudio version 0.4.0 Index]