parse_joint: Parse LLM response into a fuzzy-join joint data.frame

View source: R/llmjoin.R

parse_jointR Documentation

Parse LLM response into a fuzzy-join joint data.frame

Description

Strips markdown fences, extracts the longest consecutive block of comma-separated lines, ensures a header row matching 'key1,key2' is present, and parses the CSV into a 2-column data.frame.

Usage

parse_joint(llm_response, key1, key2)

Arguments

llm_response

character, raw response from the LLM.

key1

string, name of the lhs key column.

key2

string, name of the rhs key column.

Value

a 2-column data.frame mapping values from key1 to key2.

Examples

parse_joint("01,January\n02,Feb\n04,May", key1 = "id", key2 = "month")

llmjoin documentation built on June 17, 2026, 1:08 a.m.