Merged in bugfix/payer_name (pull request #827)
Bugfix/payer name to main * added full context instruction for payer name * removed print statement Approved-by: Katon Minhas
This commit is contained in:
committed by
Katon Minhas
parent
04a190d5b7
commit
a9b08388e3
@@ -256,6 +256,7 @@ def run_hybrid_smart_chunked_fields(
|
||||
raw = llm_utils.invoke_claude(
|
||||
prompt, "sonnet_latest", filename, max_tokens=8192
|
||||
)
|
||||
logging.debug(f"Hybrid Smart Chunking RAG Raw response for {field.field_name}: {raw}")
|
||||
try:
|
||||
parsed = string_utils.universal_json_load(
|
||||
raw
|
||||
@@ -270,6 +271,8 @@ def run_hybrid_smart_chunked_fields(
|
||||
|
||||
if answers_dict[field.field_name] == "N/A":
|
||||
field.field_type = "full_context"
|
||||
if field.field_name == "PAYER_NAME":
|
||||
field.prompt = field.prompt + prompt_templates.FULL_CONTEXT_PAYER_NAME_ADDITIONAL_INSTRUCTION()
|
||||
logging.warning(
|
||||
f"Obtained N/A for {field.field_name}, marking as full_context"
|
||||
)
|
||||
|
||||
@@ -986,6 +986,8 @@ def FULL_CONTEXT_ADDITIONAL_INSTRUCTIONS(allow_na):
|
||||
else:
|
||||
return " Do NOT leave this field N/A. Choose the most appropriate answer based on the context. If there are multiple answers, return them in a pipe (|) separated list."
|
||||
|
||||
def FULL_CONTEXT_PAYER_NAME_ADDITIONAL_INSTRUCTION():
|
||||
return " Additionally check the contract text for the payer name or payer organization name or payer entity or name of organization issuing the health plan/policy and Choose the most appropriate answer based on the context."
|
||||
|
||||
def CHECK_PROVIDER_NAME_MATCH_PROMPT(provider_name: str, hybrid_smart_chunking_provider_group_name: str) -> str:
|
||||
"""Create prompt for LLM-based provider name matching."""
|
||||
|
||||
Reference in New Issue
Block a user