Skip to content

Latest commit

 

History

History
50 lines (38 loc) · 1.57 KB

LEARN.md

File metadata and controls

50 lines (38 loc) · 1.57 KB

Typing SVG

Working with JSON

The biggest challenge to make this whole application work was to make Large Language Models output JSON!

The trick for me was to use this line of prompting:

You are going to write a JSON resume section for an applicant applying for job posts.

Consider the following CV:
<CV_TEXT>

Now consider the following TypeScript Interface for the JSON schema:

interface Basics {
    name: string;
    email: string;
    phone: string;
    website: string;
    address: string;
}

Write the basics section according to the Basic schema. On the response, include only the JSON.

It turns out that the model we use understands TypeScript quite well, which gets us good JSONs in general.

LaTeX Templating

The secret was combining LaTeX with Jinja. The snippet of code from this slideshow was very helpful:

latex_jinja_env = jinja2.Environment(
        block_start_string="\BLOCK{",
        block_end_string="}",
        variable_start_string="\VAR{",
        variable_end_string="}",
        comment_start_string="\#{",
        comment_end_string="}",
        line_statement_prefix="%-",
        line_comment_prefix="%#",
        trim_blocks=True,
        autoescape=False,
        loader=jinja2.FileSystemLoader(dir_path),
    )