Skip to contents

Retrieves a finished job and returns one row per submitted request, in submission order, with the core result columns of call_llm_par() (response text, success, finish reason, token counts including cached tokens, response id, raw JSON); batch results have no duration, status_code, error_code, or bad_param columns, and a failed row's finish_reason is NA. Rows whose requests failed carry the provider's error message; a request the provider did not return is marked "not returned by provider", and a reply that cannot be read is a failed row with the reason. Unparseable result lines, results for ids that were not submitted, and duplicate results (the first is kept) are reported in one warning. Parse structured replies afterwards with llm_parse_structured_col() or llm_parse_tags_col(), exactly as for live results.

Usage

llm_batch_fetch(job)

Arguments

job

An llmr_batch_job from llm_batch_submit(), or the path to one saved via state_path.

Value

A tibble with custom_id plus the diagnostic columns described above. If the job is not finished yet, an error is raised; check with llm_batch_status() first.