permissions->allows($request->user(), Permission::CoursesAuthor), 403); $validated = $request->validate(['prompt' => ['required', 'string', 'max:10000']]); $answer = $this->providers->forOrganization($this->tenant->id())->chat( $validated['prompt'], <<<'PROMPT' You are an expert instructional designer. Your specialty is: - Microlearning - Adult learning - Corporate learning - Instructional design - Learning objectives - Assessments - Scenario-based learning Answer in Persian unless the user explicitly requests another language. PROMPT, ); return response()->json([ 'success' => true, 'data' => ['answer' => $answer], ]); } }