You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docassemble/ALToolbox/data/questions/goal_oriented_question_structured_demo.yml
+92-20Lines changed: 92 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -3,21 +3,40 @@ include:
3
3
- goal_oriented_question_structured.yml
4
4
---
5
5
metadata:
6
-
title: Legal Aid Intake - Structured Initial Question Demo
7
-
short title: Structured Intake Demo
6
+
title: Legal Aid Intake - Goal-Oriented Questions Demo (Structured or Unstructured)
7
+
short title: Flexible Intake Demo
8
8
description: |
9
-
This interview demonstrates using GoalOrientedQuestionList with a
10
-
structured initial question (using radio buttons, checkboxes, etc.)
11
-
instead of an open-ended narrative response.
9
+
This interview demonstrates using GoalOrientedQuestionList with either
10
+
a structured initial question (using radio buttons, checkboxes, etc.)
11
+
or an open-ended narrative response. You can choose the format that works
12
+
best for your use case.
12
13
---
13
14
objects:
14
-
- housing_intake: GoalOrientedQuestionList.using(rubric="The response provides complete information about the tenant's housing situation, including the type of issue, timeline, communication with landlord, and any immediate safety or habitability concerns.", initial_question="We need to understand your housing situation to determine how we can help. Please provide information about your housing issue.", llm_assumed_role="housing intake specialist", user_assumed_role="tenant seeking help")
15
+
- housing_intake: GoalOrientedQuestionList.using(
16
+
rubric="The response provides complete information about the tenant's housing situation, including the type of issue, timeline, communication with landlord, and any immediate safety or habitability concerns.",
17
+
initial_question="We need to understand your housing situation to determine how we can help. Please provide information about your housing issue.",
18
+
llm_assumed_role="housing intake specialist",
19
+
user_assumed_role="tenant seeking help",
20
+
model=model,
21
+
reasoning_effort=reasoning_effort,
22
+
skip_moderation=skip_moderation,
23
+
)
15
24
---
16
25
mandatory: True
17
26
code: |
18
27
intro_screen
19
-
# Trigger the initial structured question
20
-
housing_intake._initial_structured_complete
28
+
question_format_choice
29
+
30
+
# Set the use_structured_initial_question based on user choice
The AI generated structured fields for the initial question and then asked follow-ups until the response met this rubric:
182
+
The AI ${ "generated structured fields for the initial question and then" if question_format == "structured" else "" } asked follow-ups until the response met this rubric:
openai_base_url (Optional[str]): The base URL for the OpenAI API. Defaults to value provided in the configuration or "https://api.openai.com/v1/".
145
146
max_output_tokens (Optional[int]): The maximum number of tokens to return from the API. Defaults to 16380.
146
147
max_input_tokens (Optional[int]): The maximum number of tokens to send to the API. Defaults to 128000.
148
+
reasoning_effort (Optional[Literal["minimal", "low", "medium", "high"]]) = None: The reasoning effort to use for thinking models. Defaults to value provided in the configuration or "low".
147
149
148
150
Returns:
149
151
A string with the response from the API endpoint or JSON data if json_mode is True
@@ -1050,6 +1057,8 @@ class GoalOrientedQuestionList(DAList):
1050
1057
model (str): The model to use for the OpenAI API. Defaults to "gpt-5-nano".
1051
1058
llm_assumed_role (str): The role for the LLM to assume. Defaults to "legal aid intake worker".
1052
1059
user_assumed_role (str): The role for the user to assume. Defaults to "applicant for legal help".
1060
+
skip_moderation (bool): If True, skips moderation checks when generating structured fields. Defaults to True.
1061
+
reasoning_effort (Optional[Literal["minimal", "low", "medium", "high"]]): The level of reasoning effort to use when generating responses. Defaults to "low"; use "minimal" for increased speed.
0 commit comments