|
| 1 | +--- |
| 2 | +include: |
| 3 | + - goal_oriented_question.yml |
| 4 | +--- |
| 5 | +metadata: |
| 6 | + title: Legal Aid Intake - Goal-Oriented Questions Demo |
| 7 | + short title: Intake Questions Demo |
| 8 | + description: | |
| 9 | + This interview demonstrates how to use the GoalOrientedQuestionList |
| 10 | + to conduct a legal aid intake by asking follow-up questions until |
| 11 | + the intake worker has sufficient information about the client's goals. |
| 12 | +--- |
| 13 | +objects: |
| 14 | + - divorce_intake: GoalOrientedQuestionList.using(rubric="The response is complete and gives clear guidance to the intake worker about the client's primary goals and circumstances for the divorce, including enough detail to understand the key issues before the initial meeting.", initial_question="Are you filing for no-fault divorce (for example, 'irretrievable breakdown' or 'separated for at least six months'), or do you believe you have a fault-based reason (for example, cruelty, adultery, desertion, substance abuse, etc.)?\n\nIf it's no-fault, please say when you and your spouse stopped living together (if you still live in the same home, please explain how things are separated — e.g., 'separate bedrooms, no financial sharing').\n\nIf it's fault-based, please give a short description of what happened and when the behavior occurred.", llm_assumed_role="intake worker", user_assumed_role="client") |
| 15 | +--- |
| 16 | +mandatory: True |
| 17 | +code: | |
| 18 | + intro_screen |
| 19 | + divorce_intake.initial_draft |
| 20 | + divorce_intake.gather() |
| 21 | + final_response |
| 22 | + intake_summary |
| 23 | +--- |
| 24 | +code: | |
| 25 | + if len(divorce_intake): |
| 26 | + final_response_default = divorce_intake.synthesize_draft_response() |
| 27 | + else: |
| 28 | + final_response_default = divorce_intake.initial_draft |
| 29 | +--- |
| 30 | +continue button field: intro_screen |
| 31 | +question: | |
| 32 | + Welcome to Legal Aid Intake |
| 33 | +subquestion: | |
| 34 | + This demo shows how the **GoalOrientedQuestionList** can be used |
| 35 | + in a legal aid intake setting to gather complete information from clients. |
| 36 | + |
| 37 | + #### Scenario |
| 38 | + |
| 39 | + You are seeking help with a divorce case. An intake worker needs to understand |
| 40 | + your situation to determine if you qualify for services and to prepare for |
| 41 | + your initial consultation. |
| 42 | + |
| 43 | + #### How it works: |
| 44 | + |
| 45 | + 1. You'll be asked an open-ended question about your divorce situation |
| 46 | + 2. The AI intake assistant will evaluate your response to see if it provides enough detail |
| 47 | + 3. If more information is needed, you'll get follow-up questions |
| 48 | + 4. The assistant will continue asking questions (up to a limit) until it has sufficient information |
| 49 | + 5. Your responses will be synthesized into a complete intake summary |
| 50 | + |
| 51 | + This approach allows for a more natural conversation while ensuring the intake |
| 52 | + worker gets all the essential information before your first meeting. |
| 53 | +--- |
| 54 | +question: | |
| 55 | + Tell us about your divorce situation |
| 56 | +subquestion: | |
| 57 | + To help us prepare for your consultation, please answer the following: |
| 58 | + |
| 59 | + **Are you filing for no-fault divorce** (for example, "irretrievable breakdown" |
| 60 | + or "separated for at least six months"), **or do you believe you have a fault-based |
| 61 | + reason** (for example, cruelty, adultery, desertion, substance abuse, etc.)? |
| 62 | + |
| 63 | + * If it's **no-fault**, please say when you and your spouse stopped living together. |
| 64 | + If you still live in the same home, please explain how things are separated |
| 65 | + (e.g., "separate bedrooms, no financial sharing"). |
| 66 | + |
| 67 | + * If it's **fault-based**, please give a short description of what happened and |
| 68 | + when the behavior occurred. |
| 69 | + |
| 70 | + Don't worry if you're not sure about the legal terms—just tell us about your |
| 71 | + situation in your own words. |
| 72 | +fields: |
| 73 | + - Your response: divorce_intake.initial_draft |
| 74 | + datatype: area |
| 75 | + rows: 8 |
| 76 | +--- |
| 77 | +question: | |
| 78 | + Review your intake information |
| 79 | +subquestion: | |
| 80 | + % if len(divorce_intake): |
| 81 | + Based on your responses, we've prepared this summary of your situation. |
| 82 | + Please review it and make any corrections or additions before we finalize |
| 83 | + your intake information. |
| 84 | +
|
| 85 | + ${ collapse_template(divorce_intake.show_current_progress) } |
| 86 | + % else: |
| 87 | + Here is the information you provided. You can make any edits before we finalize |
| 88 | + your intake. |
| 89 | + % endif |
| 90 | +fields: |
| 91 | + - Intake summary: final_response |
| 92 | + datatype: area |
| 93 | + rows: 10 |
| 94 | + default: | |
| 95 | + ${ final_response_default } |
| 96 | +--- |
| 97 | +event: intake_summary |
| 98 | +question: | |
| 99 | + Intake completed |
| 100 | +subquestion: | |
| 101 | + Thank you for providing this information. Your intake summary is ready |
| 102 | + for the intake worker to review before your consultation. |
| 103 | + |
| 104 | + #### Intake Summary |
| 105 | + |
| 106 | + > ${ final_response } |
| 107 | + |
| 108 | + % if len(divorce_intake): |
| 109 | + #### Your Conversation |
| 110 | + |
| 111 | + ${ collapse_template(divorce_intake.show_current_progress) } |
| 112 | + |
| 113 | + % endif |
| 114 | + |
| 115 | + #### Next Steps |
| 116 | + |
| 117 | + An intake worker will review this information and contact you to schedule |
| 118 | + your initial consultation. They now have a clear understanding of your |
| 119 | + situation and can better prepare to help you. |
| 120 | + |
| 121 | + --- |
| 122 | + |
| 123 | + #### About this demo |
| 124 | + |
| 125 | + This demo used a **GoalOrientedQuestionList** with: |
| 126 | + |
| 127 | + * **Question limit**: ${ divorce_intake.question_limit } follow-up questions maximum |
| 128 | + * **Follow-ups asked**: ${ len(divorce_intake) } |
| 129 | + * **Sufficient information gathered**: ${ "Yes" if divorce_intake.satisfied() else "Partially" } |
| 130 | + * **Model**: ${ divorce_intake.model } |
| 131 | + * **LLM role**: ${ divorce_intake.llm_assumed_role } |
| 132 | + * **User role**: ${ divorce_intake.user_assumed_role } |
| 133 | + |
| 134 | + The AI asked follow-up questions until the response met this rubric: |
| 135 | + |
| 136 | + > ${ divorce_intake.rubric } |
| 137 | +buttons: |
| 138 | + - Exit: exit |
| 139 | + - Restart: restart |
0 commit comments