capture_with_retry: Capture chat model response with proper handling and retries

View source: R/hellmer-core.R

capture_with_retryR Documentation

Capture chat model response with proper handling and retries

Description

Capture chat model response with proper handling and retries

Usage

capture_with_retry(
  original_chat,
  prompt,
  type_spec,
  judgements,
  max_retries,
  initial_delay,
  max_delay,
  backoff_factor,
  echo,
  ...
)

Arguments

original_chat

Original chat model object

prompt

Prompt text

type_spec

Type specification for structured data

judgements

Number of judgements for structured data extraction resulting in refined data

max_retries

Maximum number of retry attempts

initial_delay

Initial delay in seconds before first retry

max_delay

Maximum delay in seconds between retries

backoff_factor

Factor to multiply delay by after each retry

Value

List containing response information


hellmer documentation built on June 8, 2025, 11:09 a.m.