Learn R Programming

openaiRtools (version 0.2.2)

cancel_response: Cancel a Streaming Response (Convenience Function)

Description

Shortcut that creates an OpenAI client from the OPENAI_API_KEY environment variable and cancels an in-progress response.

Usage

cancel_response(response_id)

Value

The cancelled response object.

Arguments

response_id

Character. Required. The response ID to cancel.

Examples

Run this code
if (FALSE) {
Sys.setenv(OPENAI_API_KEY = "sk-xxxxxx")
cancel_response("resp_abc123")
}

Run the code above in your browser using DataLab