Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add YAML code comments to PDL examples in READMEs, tutorial, and examples #241

Open
esnible opened this issue Dec 19, 2024 · 0 comments
Open
Labels

Comments

@esnible
Copy link
Member

esnible commented Dec 19, 2024

Is your feature request related to a problem? Please describe.
Some of the PDL features are novel and deserve comments to help the reader understand what is happening.

In a few cases the a comment would also help warn the user if they are doing something incorrect. For example, the user shouldn't run pdl repair_prompt.pdl, but instead run a Python program that illustrates how to invoke PDL from Python. To deal with a user who isn't paying attention, repair_prompt.pdl line 24 should have a note indicating that it isn't expected to work except via the Python program.

Describe the solution you'd like
Add # comments, especially to early tutorial steps and examples. Especially for language features that are unusual.

For example, the second tutorial example has the line:

- "Hello\n"

There should be a comment such as # set "Hello\n" as the default LLM context for the next line. I found strings confusing because they have a meaning in Python (doc comments) and are tolerated in K&R C, but in PDL they have a special meaning and it should be explicitly documented the first few times.

Another block that confused me was:

- lang: python
  def: parsed_output
  spec: {thought: str, code_line: str}
  code: |
    import repair_main
    result = repair_main.parse_output(raw_output)

It wasn't obvious to me that this was a CodeBlock. The spec: confused me and it wasn't obvious that this was inherited from Block. Also, the def: confuses me -- I see that Block has a defs but I don't see that the spec allows def:.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant