Merged in feature/daip2-33-optimize-exhibit-start-prompt (pull request #343)
Feature/daip2 33 optimize exhibit start prompt * Updated Exhibit Check prompt * Updated prompt, reorg * Switch to claude 3 haiku for new exhibit check prompt Approved-by: Alex Galarce
This commit is contained in:
@@ -10,6 +10,7 @@ import smart_chunking_funcs
|
||||
import string_funcs
|
||||
import valid
|
||||
from valid import DERIVED_INDICATOR_FIELDS
|
||||
from regex_patterns import PIPE_PATTERN
|
||||
|
||||
|
||||
def clean_newlines(contract_text: str) -> str:
|
||||
@@ -299,3 +300,15 @@ def filter_quick_review(text_dict):
|
||||
or "COVER SHEET" in page_text.upper()
|
||||
}
|
||||
|
||||
def get_exhibit_pages(text_dict, filename):
|
||||
exhibit_pages = []
|
||||
for page_num, page in text_dict.items():
|
||||
prompt = prompts.EXHIBIT_CHECK(page[0:100])
|
||||
claude_answer_raw = claude_funcs.invoke_claude(
|
||||
prompt, config.MODEL_ID_CLAUDE3_HAIKU, filename, max_tokens=10
|
||||
)
|
||||
claude_answer_extracted = re.findall(pattern=PIPE_PATTERN, string=claude_answer_raw)[-1]
|
||||
if "Y" in claude_answer_extracted:
|
||||
exhibit_pages.append(page_num)
|
||||
return exhibit_pages
|
||||
|
||||
|
||||
Reference in New Issue
Block a user