*/ public function form(): array { return [ 'provider' => '', 'instructions' => '', ]; } /** * Get validation rules for form fields. * * @return array */ public function rules(): array { return [ 'provider' => [ 'sometimes', 'nullable', Rule::in($this->getAvailableProviders()), ], 'instructions' => ['sometimes', 'nullable', 'string', 'max:1000'], ]; } /** * Get custom validation messages. * * @return array */ public function messages(): array { return [ 'provider.in' => 'The selected AI provider is not available.', 'instructions.max' => 'Instructions may not be greater than 1000 characters.', ]; } /** * Get list of available AI provider keys. * * @return array */ private function getAvailableProviders(): array { $agenticManager = app(AgenticManager::class); return array_keys($agenticManager->availableProviders()); } }