This function retrieves the results of a completed batch and updates
the provided list of LLMMessage
objects with the responses. It aligns each
response with the original request using the custom_id
s generated in send_batch()
.
Usage
fetch_batch(
.llms,
.provider = getOption("tidyllm_fbatch_default"),
.dry_run = NULL,
.max_tries = NULL,
.timeout = NULL
)
Arguments
- .llms
A list of
LLMMessage
objects containing conversation histories.- .provider
A function or function call specifying the language model provider and any additional parameters. This should be a call to a provider function like
openai()
,claude()
, etc. You can also set a default provider function via thetidyllm_fbatch_default
option.- .dry_run
Logical; if
TRUE
, returns the constructed request without executing it- .max_tries
Integer; maximum number of retries if the request fails
- .timeout
Integer; request timeout in seconds