Initial commit
This commit is contained in:
commit
db896255d6
744 changed files with 56028 additions and 0 deletions
|
|
@ -0,0 +1,16 @@
|
|||
import json
|
||||
from typing import Any
|
||||
|
||||
from langchain.schema import BaseOutputParser
|
||||
from core.prompt.prompts import SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT
|
||||
|
||||
|
||||
class SuggestedQuestionsAfterAnswerOutputParser(BaseOutputParser):
|
||||
|
||||
def get_format_instructions(self) -> str:
|
||||
return SUGGESTED_QUESTIONS_AFTER_ANSWER_INSTRUCTION_PROMPT
|
||||
|
||||
def parse(self, text: str) -> Any:
|
||||
json_string = text.strip()
|
||||
json_obj = json.loads(json_string)
|
||||
return json_obj
|
||||
Loading…
Add table
Add a link
Reference in a new issue