IBM / prompt-declaration-language

Prompt Declaration Language (PDL) is a declarative prompt programming language.
https://ibm.github.io/prompt-declaration-language/
Apache License 2.0
29 stars 7 forks source link

Unhelpful error message #71

Closed claudiosv closed 1 month ago

claudiosv commented 1 month ago

I had a simple PDL program containing only defs:

defs:

  # ... several other defs, ~85 lines
  get_current_weather:
    function:
      subject: str
    return:
      api: https
      url: https://api.weatherapi.com/v1/current.json?key=cf601276764642cb96224947230712&q=
      input: "{{ subject }}"
      show_result: false

Upon executing the error message is:

examples/prompt_library/tools.pdl:0 - Missing required field: function
examples/prompt_library/tools.pdl:0 - Missing required field: return

The problem is actually show_result: false which is not on line 0 and not clear from the missing field errors.

vazirim commented 1 month ago

Fixed by PR #80