langchain icon indicating copy to clipboard operation
langchain copied to clipboard

KeyError: '1; 2; 3; 4; 5; 6; 8; 10'

Open duynvher opened this issue 2 years ago • 1 comments

When i use FewShotPromptTemplate function, if the examples contain "{" and "}" characters, I get this error. Like this: {"question": "A = {1; 2; 3; 4; 5; 6; 8; 10}; B = {1; 3; 5; 7; 9; 11}"} How can i fix it. Thank you!!!

duynvher avatar Apr 12 '23 08:04 duynvher

You can escape the braces - use "{{" and "}}".

ladlestein avatar May 15 '23 21:05 ladlestein

Hi, @Nduy2k! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you opened this issue regarding a KeyError when using the FewShotPromptTemplate function with examples containing "{" and "}" characters. Ladlestein suggested escaping the braces by using "{{" and "}}", which seems to have resolved the issue.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your contribution!

dosubot[bot] avatar Sep 03 '23 16:09 dosubot[bot]