jkomoros / prompt-garden

A framework for gardening LLM prompts
Apache License 2.0
13 stars 1 forks source link

Do packet-level verfication #39

Open jkomoros opened 1 year ago

jkomoros commented 1 year ago

Type checking helps find a number of errors in seed packet definition at parse time. But there are other possible errors that it would be good to catch earlier.

For example, SeedReference to an invalid seed in the same packet. In the future there will likely be other problems (and possibly other warnings, a lint). Once there is a verifyPacket() for an unrolled packet, I'm sure we'll figure out other things to verify.

Once this is done, a convention for let/var is to have a named seed that wraps it:

{
  "get-user-name": {
    "type": "var",
    "name": {
      "id": "get-user-name-name"
    }
  },
  "get-user-name-name": {
    "type": "noop",
    "value": "user-name"
  }
}

That way you can fail at packet parse if you have the wrong variable name.

If you want this to be internal, make sure it's marked private:true. But if it's private:false then it's able to be used by other seed packets.

Originally tracked in #36.