Skip to content

Commit

Permalink
Merge pull request #31 from fadynakhla/arthur/cc
Browse files Browse the repository at this point in the history
cc by patient
  • Loading branch information
ArthurBook authored Jul 30, 2023
2 parents 451d02b + 170f116 commit 9783eb5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
3 changes: 3 additions & 0 deletions dr_claude/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ async def run_chain(
logger.error(e)
return
logger.info("Chief complaints are {}", chief_complaints)
await websocket.send_json(
{"patient": f'I have {", ".join([c.name for c in chief_complaints])}'}
)
state.pertinent_pos.update(chief_complaints)
rollout_policy = action_states.ArgMaxDiagnosisRolloutPolicy()
searcher = multi_choice_mcts.MultiChoiceMCTS(
Expand Down
30 changes: 14 additions & 16 deletions dr_claude/chains/decision_claude.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@
logger = loguru.logger


_decision_template = """You will be given the context of a patient through a list of positive and negative symptoms.
You will then be given a set of symptoms that an intelligent system has predicted are the next best questions to ask the patient.
Your job is to choose the best action.
Known patient state:
positive symptoms: {positive_symptoms}
negative symptoms: {negative_symptoms}
Symptoms to consider ordered by value: {symptoms}
What is the the best symptom to ask the patient about?
Remember to ensure the chosen symptom exactly matches one of those you are asked to consider. Do not provide any other information or text.
Chosen Symptom:
"""

_decision_template = (
"You are an insightful and inquisitive doctor. "
"You are with a patient and need to inquire about the patient for enabling the best possible diagnosis."
"\nYour job is to choose the best symptom to inquire about next."
"The following symptoms have already been confirmed and rejected, so asking about them again is a waste of time:"
"\npositive symptoms: {positive_symptoms}"
"\nnegative symptoms: {negative_symptoms}"
"You will then be given a set of symptoms that an intelligent system has predicted are the next best questions to ask the patient. "
"The intelligent system has predicted that the following symptoms are the most valuable to confirm or reject next: {symptoms}. "
"Your job is to determine which one of the symptoms from the intelligent system that we should inquire about next."
"\nRemember to ensure that symptom you chose should match exactly one of those that the intelligent system suggested."
"Now, given the information from above, determine which symptom that is the best to ask from the list predicted by the intelligent system."
"What is the best symptom to inquire about? Answer by quoting only the name of the symptom."
)
DECISION_PROMPT = PromptTemplate.from_template(_decision_template)


Expand Down

0 comments on commit 9783eb5

Please sign in to comment.