Learn R Programming

tidyllm (version 0.1.0)

perform_api_request: Perform an API request to interact with language models

Description

Perform an API request to interact with language models

Usage

perform_api_request(
  request,
  .api,
  .stream = FALSE,
  .timeout = 60,
  parse_response_fn = NULL
)

Value

A list containing the assistant's reply and response headers.

Arguments

request

The httr2 request object.

.api

The API identifier (e.g., "claude", "openai").

.stream

Stream the response if TRUE.

.timeout

Request timeout in seconds.

parse_response_fn

A function to parse the assistant's reply.