langchain icon indicating copy to clipboard operation
langchain copied to clipboard

StructuredOutputParser - Allow users to get multiple items from response.

Open keremnalbant opened this issue 1 year ago • 0 comments

  • Allow users to choose the type in the schema (string | List[string])
  • Allow users to get multiple json objects (get JSON array) in the response. I achieved it by replacing the {{ }} -> [[ ]] as follows: prompt.replace("""{{ "ID": string // IDs which refers to the sentences. "Text": string // Sentences that contains the answer to the question. }}""", """[[ "ID": string // IDs which refers to the sentences. "Text": string // Sentences that contains the answer to the question. ]]""") And got a list of json objects with this method.

keremnalbant avatar Mar 24 '23 20:03 keremnalbant