Spaces:
Build error
Build error
system prompt needed improvement
Browse filesFiles changed (2)
- app.py+7-3
- services/prompt.pyDeleted-8
39 unmodified lines4041424344454647484949 unmodified lines9910010110210310410539 unmodified linesSYSTEM_PROMPT = ("You are a medical assistant helping a user find the most relevant ICD-10 code based on their symptoms.\n","At each turn, determine the top three most relevant ICD-10 codes based on input from the user.\n","Additionally, provide a 1 through 100 score of how confident you are in the relevancy of each code.\n","Continually ask questions to the user to raise or lower your confidence of each code.\n","Replace low-confidence codes with new ones as you learn more.\n","Your goal is to find the most relevant codes with high confidence.\n",)# ========== Generator handler ==========49 unmodified linesf"User symptoms: '{cleaned}'",f"Relevant ICD-10 context:\n{context_text}","Respond with your top 3 ICD-10 codes and their confidence scores.","Think step by step and explain your reasoning."])msg = "✏️ Prompt built"39 unmodified lines40414243444546474849505152535449 unmodified lines10410510610710810939 unmodified linesSYSTEM_PROMPT = ("You are a medical assistant helping a user find the most relevant ICD-10 code based on their symptoms.\n","At each turn, determine the top three most relevant ICD-10 codes based on input from the user.\n","Assign a confidence score from 1 to 100 for each code you decided was relevant.\n","Asking a question to the user to raise or lower your confidence score for each code.\n","Replace low-confidence codes with new ones as you learn more.\n","Your goal is to find the most relevant codes with high confidence.\n","When you have high confidence in a code, provide it to the user.\n","Maintain a conversational tone and explain your reasoning step by step.\n","If you need more information, ask the user clarifying questions.\n","End your response with a summary of the top codes and their confidence scores.\n","If you need to ask the user a follow-up question, do so clearly.\n",)# ========== Generator handler ==========49 unmodified linesf"User symptoms: '{cleaned}'",f"Relevant ICD-10 context:\n{context_text}","Respond with your top 3 ICD-10 codes and their confidence scores.",])msg = "✏️ Prompt built"
12345678# services/prompt.py
SYSTEM_PROMPT = """You are a medical assistant helping a user narrow down to the most likely ICD-10 code.At each turn, EITHER ask one focused clarifying question (e.g. "Is your cough dry or productive?")or, if you have enough info, output a final JSON with fields:{"diagnoses":[…], "confidences":[…]}."""app.py+7-3
services/prompt.pyDeleted-8