05/22 Implement license version
This commit is contained in:
@@ -130,6 +130,14 @@ def _call_groq(api_key, history, user_msg, kb_context=''):
|
||||
@login_required
|
||||
@limiter.limit('20 per minute; 100 per hour')
|
||||
def chat():
|
||||
from app.services.license_service import feature_enabled
|
||||
if not feature_enabled('chatbot'):
|
||||
return jsonify({
|
||||
'reply' : 'The AI chatbot is not available on the Community plan. '
|
||||
'Upgrade to a Business or Enterprise license to enable it.',
|
||||
'ticket': None,
|
||||
}), 403
|
||||
|
||||
data = request.get_json(force=True)
|
||||
history = data.get('history', []) # [{role, content}, ...]
|
||||
user_msg = data.get('message', '').strip()
|
||||
|
||||
Reference in New Issue
Block a user