Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/src/app/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ export const initialGenerationForm: GenerationFormState = {
learning_session_id: 'session-fractions-bridge',
target_kc_ids: 'KC-1',
target_lo_ids: 'LO-1',
intent: 'practice',
requested_content_type: 'practice_problem',
intent: 'explanation',
requested_content_type: '',
learner_prompt: 'Use a supportive tone and name the transfer move explicitly.',
curriculum_context: 'Equivalent fractions',
}
Expand Down
14 changes: 14 additions & 0 deletions src/dibble/services/content_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@

logger = logging.getLogger(__name__)

_CONTENT_TYPE_TO_INTENT: dict[str | None, str] = {
RequestedContentType.micro_explanation.value: "explanation",
RequestedContentType.worked_example.value: "explanation",
RequestedContentType.practice_problem.value: "practice",
RequestedContentType.remedial_micro_module.value: "remediation",
RequestedContentType.assessment_probe.value: "assessment",
}


def _intent_for_content_type(content_type: str | None) -> str:
"""Map a content type string to the matching ``ContentIntent`` value."""
return _CONTENT_TYPE_TO_INTENT.get(content_type, "explanation")


class LearnerProfileNotFoundError(LookupError):
def __init__(self, student_id: UUID) -> None:
Expand Down Expand Up @@ -1036,6 +1049,7 @@ def _generation_request_payload(
),
"target_kc_ids": list(next_step.target_kc_ids),
"target_lo_ids": self._string_list(request_context.get("target_lo_ids")),
"intent": _intent_for_content_type(next_step.content_type),
"requested_content_type": next_step.content_type,
"curriculum_context": list(generated_content.response.curriculum_context),
"source_generation_id": generated_content.generation_id,
Expand Down
Loading