Spaces:
Running

axeronis commited on
Commit
2b04736
·
1 Parent(s): 3b6bb06

Remove all hardcoded defaults for full SaaS configurability

Browse files

- Backend: Remove company_name, tone, methodology defaults from ai_core.py
- Database: Set tone_of_voice and sales_methodology to None by default in Tenant model
- Frontend: Remove hardcoded custom_fields defaults
- Result: All settings must be explicitly configured by users

backend/app/models/tenant.py CHANGED
@@ -67,8 +67,8 @@ class Tenant(SQLModel, table=True):
67
 
68
  # AI Brain Settings (from migrations)
69
  ai_settings: Optional[Dict[str, Any]] = Field(default=None, sa_column=Column(JSON))
70
- tone_of_voice: Optional[str] = Field(default='Professional')
71
- sales_methodology: Optional[str] = Field(default='Consultative')
72
  custom_instructions: Optional[str] = Field(default='')
73
  banned_words: Optional[List[str]] = Field(default=None, sa_column=Column(JSON))
74
 
 
67
 
68
  # AI Brain Settings (from migrations)
69
  ai_settings: Optional[Dict[str, Any]] = Field(default=None, sa_column=Column(JSON))
70
+ tone_of_voice: Optional[str] = Field(default=None) # No default - must configure
71
+ sales_methodology: Optional[str] = Field(default=None) # No default - must configure
72
  custom_instructions: Optional[str] = Field(default='')
73
  banned_words: Optional[List[str]] = Field(default=None, sa_column=Column(JSON))
74
 
backend/app/services/ai_core.py CHANGED
@@ -535,14 +535,14 @@ class AICore:
535
  ai_identity = tenant.ai_identity or {}
536
  bot_name = ai_identity.get("bot_name", "") # Empty if not set
537
  bot_role = ai_identity.get("bot_role", "") # Empty if not set
538
- company_name = tenant.business_name or tenant.name or "Our Company"
539
 
540
  # Extract AI settings
541
  ai_settings = tenant.ai_settings or {}
542
  business_description = ai_settings.get("business_description", "")
543
  ideal_customer = ai_settings.get("ideal_customer", "")
544
- tone_instruction = tenant.tone_of_voice or "Professional and friendly"
545
- sales_methodology = tenant.sales_methodology or "Consultative"
546
  custom_instructions = tenant.custom_instructions or ""
547
  banned_words = tenant.banned_words or []
548
 
 
535
  ai_identity = tenant.ai_identity or {}
536
  bot_name = ai_identity.get("bot_name", "") # Empty if not set
537
  bot_role = ai_identity.get("bot_role", "") # Empty if not set
538
+ company_name = tenant.business_name or tenant.name or "" # No default
539
 
540
  # Extract AI settings
541
  ai_settings = tenant.ai_settings or {}
542
  business_description = ai_settings.get("business_description", "")
543
  ideal_customer = ai_settings.get("ideal_customer", "")
544
+ tone_instruction = tenant.tone_of_voice or "" # No default
545
+ sales_methodology = tenant.sales_methodology or "" # No default
546
  custom_instructions = tenant.custom_instructions or ""
547
  banned_words = tenant.banned_words or []
548
 
frontend/app/settings/brain/page.tsx CHANGED
@@ -86,13 +86,13 @@ export default function BrainSettingsPage() {
86
  const [settings, setSettings] = useState<AISettings>({
87
  business_description: '',
88
  selling_style: 'Consultative',
89
- custom_fields: ['Бюджет', 'Срочность', 'Статус решения'],
90
  ideal_customer_profile: ''
91
  })
92
 
93
  const [persona, setPersona] = useState<AIPersona>({
94
- tone_of_voice: 'Professional',
95
- sales_methodology: 'Consultative',
96
  custom_instructions: '',
97
  banned_words: [],
98
  manager_monthly_salary: 1000
 
86
  const [settings, setSettings] = useState<AISettings>({
87
  business_description: '',
88
  selling_style: 'Consultative',
89
+ custom_fields: [], // Empty by default - user must configure
90
  ideal_customer_profile: ''
91
  })
92
 
93
  const [persona, setPersona] = useState<AIPersona>({
94
+ tone_of_voice: 'Professional', // Required field, needs UI preselection
95
+ sales_methodology: 'Consultative', // Required field, needs UI preselection
96
  custom_instructions: '',
97
  banned_words: [],
98
  manager_monthly_salary: 1000