Merged in hotfix/remove-print-statements (pull request #411)

Hotfix/remove print statements

* Remove print statements

* added llm_answer_raw

* prompt edit


Approved-by: Alex Galarce
This commit is contained in:
Katon Minhas
2025-02-21 20:24:34 +00:00
parent 81dfe7896b
commit a43f574239
4 changed files with 8 additions and 16 deletions
@@ -99,9 +99,7 @@ def run_one_to_n_prompts(filename, text_dict, exhibit_pages, exhibit_chunk_mappi
for exhibit_page in exhibit_pages:
exhibit_chunk = string_utils.get_exhibit_chunk(text_dict, exhibit_chunk_mapping, exhibit_page)
if string_utils.contains_reimbursement(exhibit_chunk):
print(exhibit_page)
################## INITIALIZE FIELDS ##################
reimbursement_level_fields = FieldSet(relationship="one_to_n", field_type="reimbursement_level", file_path=FIELD_JSON_PATH)
exhibit_level_fields = FieldSet(relationship="one_to_n", field_type="exhibit_level", file_path=FIELD_JSON_PATH)
@@ -166,7 +166,6 @@ def get_special_cases(reimbursement_primary_answers: list[dict], filename: str)
for answer_dict in reimbursement_primary_answers:
contract_service_cd, contract_reimbursement_method = answer_dict.get("CONTRACT_SERVICE_CD_OR_DESC"), answer_dict.get("CONTRACT_REIMBURSEMENT_METHOD")
print(contract_service_cd)
if contract_service_cd and contract_reimbursement_method:
llm_answer_final = string_utils.extract_text_from_delimiters(
llm_utils.invoke_claude(
@@ -175,7 +174,6 @@ def get_special_cases(reimbursement_primary_answers: list[dict], filename: str)
filename
),
Delimiter.PIPE)
print(f"LLM Answers Final: {llm_answer_final}")
# Default
if "DEFAULT_TERM" in llm_answer_final:
@@ -10,39 +10,35 @@ def get_outlier_fields(answer_dict, filename):
service, methodology = answer_dict.get("CONTRACT_SERVICE_CD_OR_DESC"), answer_dict.get("CONTRACT_REIMBURSEMENT_METHOD")
answer_dict["CONTRACT_FACILITY_OUTLIER_TERMS"] = methodology
questions = FieldSet(file_path=config.FIELD_JSON_PATH, field_type="outlier")
llm_answer_final = string_utils.universal_json_load(
llm_utils.invoke_claude(
llm_answer_raw = llm_utils.invoke_claude(
investment_prompts.SERVICE_METHODOLOGY_BREAKOUT(service, methodology, questions),
config.MODEL_ID_CLAUDE35_SONNET,
filename
)
)
llm_answer_final = string_utils.universal_json_load(llm_answer_raw)
return {**answer_dict, **llm_answer_final}
def get_stop_loss_fields(answer_dict, filename):
service, methodology = answer_dict.get("CONTRACT_SERVICE_CD_OR_DESC"), answer_dict.get("CONTRACT_REIMBURSEMENT_METHOD")
answer_dict["CONTRACT_FACILITY_STOP_LOSS_TERMS"] = methodology
questions = FieldSet(file_path=config.FIELD_JSON_PATH, field_type="stop_loss")
llm_answer_final = string_utils.universal_json_load(
llm_utils.invoke_claude(
llm_answer_raw = llm_utils.invoke_claude(
investment_prompts.SERVICE_METHODOLOGY_BREAKOUT(service, methodology, questions),
config.MODEL_ID_CLAUDE35_SONNET,
filename
)
)
llm_answer_final = string_utils.universal_json_load(llm_answer_raw)
return {**answer_dict, **llm_answer_final}
def get_sequestration_fields(answer_dict, filename):
service, methodology = answer_dict.get("CONTRACT_SERVICE_CD_OR_DESC"), answer_dict.get("CONTRACT_REIMBURSEMENT_METHOD")
questions = FieldSet(file_path=config.FIELD_JSON_PATH, field_type="sequestration")
llm_answer_final = string_utils.universal_json_load(
llm_utils.invoke_claude(
llm_answer_raw = llm_utils.invoke_claude(
investment_prompts.SERVICE_METHODOLOGY_BREAKOUT(service, methodology, questions),
config.MODEL_ID_CLAUDE35_SONNET,
filename
)
)
llm_answer_final = string_utils.universal_json_load(llm_answer_raw)
return {**answer_dict, **llm_answer_final}
@@ -498,7 +498,7 @@ Here is the Service and Methodology:
Service: {service}
Methodology: {methodology}
Determine if the Service and Methodology match any of the descriptions.
Determine if the Service and Methodology match any of the special case descriptions.
If so, write the name of the Case. If they do not, simply write N/A.
{PIPE_FORMAT_INSTRUCTIONS}