You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's common when prompt engineering to require the LLM to return results in JSON format and to include an example JSON response within the prompt. The current Prompt variable parser can't handle this as it interprets the example JSON as an input variable and then complains that it is missing:
require"langchain"simple_template="Tell me a {adjective} joke. Return in JSON in the format {{joke: 'The joke'}}"Prompt::Base.extract_variables_from_template(simple_template)=>["adjective","joke: 'The joke'"]
The current Python f-string parser handles this by allowing you to escape a curly brace with a double curly brace, as shown in the example above. Python f-string spec
Looking at the regex its clearly trying to do something with double curly brackets so before I try and fix it can you shed some light on the original implementation?
The text was updated successfully, but these errors were encountered:
Interesting. I tried the jsonformer example notebook and it appeared to download a 5.6GB model before doing the JSON generation which is probably not something we want to drag into langchainrb!
It's common when prompt engineering to require the LLM to return results in JSON format and to include an example JSON response within the prompt. The current Prompt variable parser can't handle this as it interprets the example JSON as an input variable and then complains that it is missing:
The current Python f-string parser handles this by allowing you to escape a curly brace with a double curly brace, as shown in the example above. Python f-string spec
Looking at the regex its clearly trying to do something with double curly brackets so before I try and fix it can you shed some light on the original implementation?
The text was updated successfully, but these errors were encountered: