File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 101101 """
102102_DATA_PARSER_SYSTEM_PROMPT = """\
103103 You are a legal scholar extracting structured data from {desc}documents. \
104- Follow all instructions in the following schema carefully:
105-
106- {schema}
107-
104+ Follow all instructions in the schema descriptions carefully.\
105+ """
106+ _DATA_PARSER_ADDITIONAL_CONTEXT = """\
108107 # ADDITIONAL CONTEXT #
109- Today's date is {todays_date}. If a moratorium or temporary restriction \
110- includes an explicit end date that has already passed as of today, treat it \
111- as expired and omit that prohibition feature.\
108+ - Today's date is {todays_date}. If you are extracting a moratorium or \
109+ temporary restriction that includes an explicit end date that has already \
110+ passed as of today, treat it as expired and omit that prohibition feature.\
112111 """
113112
114113
@@ -348,7 +347,10 @@ async def parse(self, text):
348347 )
349348
350349 todays_date = datetime .now ().strftime ("%B %d, %Y" )
351- sys_prompt = self .SYSTEM_PROMPT .format (
350+ sys_prompt = (
351+ f"{ self .SYSTEM_PROMPT } \n \n { _DATA_PARSER_ADDITIONAL_CONTEXT } "
352+ )
353+ sys_prompt = sys_prompt .format (
352354 desc = desc , schema = self .SCHEMA , todays_date = todays_date
353355 )
354356
You can’t perform that action at this time.
0 commit comments