django-lucy-assist 1.0.1__tar.gz → 1.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/PKG-INFO +3 -1
  2. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/README.md +2 -0
  3. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/django_lucy_assist.egg-info/PKG-INFO +3 -1
  4. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/__init__.py +1 -1
  5. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/services/bug_notification_service.py +7 -2
  6. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/services/context_service.py +9 -6
  7. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/templates/lucy_assist/chatbot_sidebar.html +1 -1
  8. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/utils/message_utils.py +39 -0
  9. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/views/api_views.py +9 -3
  10. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/pyproject.toml +1 -1
  11. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/MANIFEST.in +0 -0
  12. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/django_lucy_assist.egg-info/SOURCES.txt +0 -0
  13. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/django_lucy_assist.egg-info/dependency_links.txt +0 -0
  14. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/django_lucy_assist.egg-info/requires.txt +0 -0
  15. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/django_lucy_assist.egg-info/top_level.txt +0 -0
  16. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/admin.py +0 -0
  17. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/apps.py +0 -0
  18. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/conf.py +0 -0
  19. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/constantes.py +0 -0
  20. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/context_processors.py +0 -0
  21. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/migrations/0001_initial.py +0 -0
  22. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/migrations/__init__.py +0 -0
  23. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/models/__init__.py +0 -0
  24. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/models/base.py +0 -0
  25. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/models/configuration.py +0 -0
  26. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/models/conversation.py +0 -0
  27. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/models/message.py +0 -0
  28. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/models/project_context_cache.py +0 -0
  29. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/services/__init__.py +0 -0
  30. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/services/claude_service.py +0 -0
  31. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/services/crud_service.py +0 -0
  32. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/services/gitlab_service.py +0 -0
  33. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/services/project_context_service.py +0 -0
  34. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/services/tool_executor_service.py +0 -0
  35. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/services/tools_definition.py +0 -0
  36. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/signals.py +0 -0
  37. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/static/lucy_assist/css/lucy-assist.css +0 -0
  38. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/static/lucy_assist/image/icon-lucy.png +0 -0
  39. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/static/lucy_assist/js/lucy-assist.js +0 -0
  40. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/templates/lucy_assist/partials/documentation_content.html +0 -0
  41. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/tests/__init__.py +0 -0
  42. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/tests/factories/__init__.py +0 -0
  43. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/tests/factories/lucy_assist_factories.py +0 -0
  44. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/tests/test_lucy_assist.py +0 -0
  45. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/urls.py +0 -0
  46. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/utils/__init__.py +0 -0
  47. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/utils/log_utils.py +0 -0
  48. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/utils/token_utils.py +0 -0
  49. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/lucy_assist/views/__init__.py +0 -0
  50. {django_lucy_assist-1.0.1 → django_lucy_assist-1.0.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-lucy-assist
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: Assistant IA intelligent Revolucy pour outil métier
5
5
  Author-email: Revolucy <hello@revolucy.fr>
6
6
  Maintainer-email: Maxence <hello@revolucy.fr>
@@ -187,6 +187,8 @@ Lucy Assist expose plusieurs endpoints API :
187
187
 
188
188
  - V1.0.0 | Création du module Lucy
189
189
  - V1.0.1 | Correction de bugs
190
+ - V1.0.2 | Correction de bugs
191
+ - V1.0.3 | Correction de bugs
190
192
 
191
193
  ## Déploiement Pypi
192
194
 
@@ -144,6 +144,8 @@ Lucy Assist expose plusieurs endpoints API :
144
144
 
145
145
  - V1.0.0 | Création du module Lucy
146
146
  - V1.0.1 | Correction de bugs
147
+ - V1.0.2 | Correction de bugs
148
+ - V1.0.3 | Correction de bugs
147
149
 
148
150
  ## Déploiement Pypi
149
151
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-lucy-assist
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: Assistant IA intelligent Revolucy pour outil métier
5
5
  Author-email: Revolucy <hello@revolucy.fr>
6
6
  Maintainer-email: Maxence <hello@revolucy.fr>
@@ -187,6 +187,8 @@ Lucy Assist expose plusieurs endpoints API :
187
187
 
188
188
  - V1.0.0 | Création du module Lucy
189
189
  - V1.0.1 | Correction de bugs
190
+ - V1.0.2 | Correction de bugs
191
+ - V1.0.3 | Correction de bugs
190
192
 
191
193
  ## Déploiement Pypi
192
194
 
@@ -5,7 +5,7 @@ Un chatbot IA basé sur Claude d'Anthropic, intégrable dans n'importe quelle
5
5
  application Django pour fournir une assistance contextuelle aux utilisateurs.
6
6
  """
7
7
 
8
- __version__ = '1.0.1'
8
+ __version__ = '1.0.3'
9
9
  __author__ = 'Revolucy'
10
10
 
11
11
  default_app_config = 'lucy_assist.apps.LucyAssistConfig'
@@ -110,7 +110,7 @@ class BugNotificationService:
110
110
  'high': '🔴 Élevée'
111
111
  }.get(severity, '🟠 Moyenne')
112
112
 
113
- sujet = f"[Lucy Assist] 🐛 Bug détecté - Sévérité {severity_label}"
113
+ sujet = f"[Lucy Assist] Bug détecté - Sévérité {severity_label}"
114
114
 
115
115
  message_email = f"""
116
116
  Lucy Assist a détecté un bug dans le code.
@@ -153,10 +153,15 @@ suite à la détection d'un bug lors de l'analyse du code via GitLab.
153
153
  ================================================================================
154
154
  """
155
155
 
156
+ # Récupérer l'email expéditeur avec fallback
157
+ from_email = getattr(settings, 'EMAIL_EXPEDITEUR', None) \
158
+ or getattr(settings, 'DEFAULT_FROM_EMAIL', None) \
159
+ or 'noreply@revolucy.fr'
160
+
156
161
  send_mail(
157
162
  subject=sujet,
158
163
  message=message_email,
159
- from_email=settings.DEFAULT_FROM_EMAIL,
164
+ from_email=from_email,
160
165
  recipient_list=[destinataire],
161
166
  fail_silently=False
162
167
  )
@@ -299,12 +299,15 @@ class ContextService:
299
299
  for field_name in search_fields[:5]: # Limiter à 5 champs
300
300
  q_objects |= Q(**{f'{field_name}__icontains': query})
301
301
 
302
- # Filtrer par permissions si le manager user_filter existe
303
- queryset = model.objects
304
- if hasattr(model, 'user_filter'):
305
- queryset = model.user_filter
306
-
307
- objects = queryset.filter(q_objects)[:limit]
302
+ # Filtrer par permissions si possible
303
+ # Note: certains modèles utilisent des managers customs qui
304
+ # dépendent de ThreadLocal/middleware pour l'utilisateur courant
305
+ try:
306
+ queryset = model.objects.all()
307
+ objects = queryset.filter(q_objects)[:limit]
308
+ except AttributeError:
309
+ # Si le manager a besoin d'un utilisateur non disponible, skip ce modèle
310
+ continue
308
311
 
309
312
  for obj in objects:
310
313
  result = {
@@ -329,7 +329,7 @@
329
329
  <div class="lucy-modal-body">
330
330
  <div class="lucy-info-box">
331
331
  <i class="fa-solid fa-info-circle"></i>
332
- <span>Votre conversation sera envoyee a l'equipe Revolucy pour analyse et amelioration de Lucy.</span>
332
+ <span>Votre conversation sera envoyée à l'équipe Revolucy pour analyse et amélioration de Lucy Assist.</span>
333
333
  </div>
334
334
 
335
335
  <div class="lucy-form-group">
@@ -128,3 +128,42 @@ class MessageUtils:
128
128
  texte = texte.replace('\n', '<br>')
129
129
 
130
130
  return texte
131
+
132
+ @staticmethod
133
+ def remove_emojis(texte: str) -> str:
134
+ """
135
+ Supprime les emojis et caractères 4-bytes incompatibles avec MySQL utf8.
136
+
137
+ Args:
138
+ texte: Texte contenant potentiellement des emojis
139
+
140
+ Returns:
141
+ Texte sans emojis
142
+ """
143
+ if not texte:
144
+ return ""
145
+
146
+ # Pattern pour les emojis et caractères 4-bytes (U+10000 et au-delà)
147
+ emoji_pattern = re.compile(
148
+ "["
149
+ "\U0001F600-\U0001F64F" # emoticons
150
+ "\U0001F300-\U0001F5FF" # symbols & pictographs
151
+ "\U0001F680-\U0001F6FF" # transport & map symbols
152
+ "\U0001F1E0-\U0001F1FF" # flags
153
+ "\U00002500-\U00002BEF" # chinese char
154
+ "\U00002702-\U000027B0"
155
+ "\U000024C2-\U0001F251"
156
+ "\U0001f926-\U0001f937"
157
+ "\U00010000-\U0010ffff"
158
+ "\u2640-\u2642"
159
+ "\u2600-\u2B55"
160
+ "\u200d"
161
+ "\u23cf"
162
+ "\u23e9"
163
+ "\u231a"
164
+ "\ufe0f" # dingbats
165
+ "\u3030"
166
+ "]+",
167
+ re.UNICODE
168
+ )
169
+ return emoji_pattern.sub('', texte)
@@ -9,6 +9,7 @@ from django.utils.decorators import method_decorator
9
9
  from django.contrib.auth.mixins import LoginRequiredMixin
10
10
 
11
11
  from lucy_assist.utils.log_utils import LogUtils
12
+ from lucy_assist.utils.message_utils import MessageUtils
12
13
  from lucy_assist.models import Conversation, Message, ConfigurationLucyAssist
13
14
  from lucy_assist.constantes import LucyAssistConstantes
14
15
  from lucy_assist.services.claude_service import ClaudeService
@@ -145,7 +146,7 @@ class MessageCreateView(LucyAssistAPIView):
145
146
  message = Message.objects.create(
146
147
  conversation=conversation,
147
148
  repondant=LucyAssistConstantes.Repondant.UTILISATEUR,
148
- contenu=contenu
149
+ contenu=MessageUtils.remove_emojis(contenu)
149
150
  )
150
151
 
151
152
  # Générer le titre si c'est le premier message
@@ -261,7 +262,7 @@ class ChatCompletionView(LucyAssistAPIView):
261
262
  message = Message.objects.create(
262
263
  conversation=conversation,
263
264
  repondant=LucyAssistConstantes.Repondant.CHATBOT,
264
- contenu=full_response,
265
+ contenu=MessageUtils.remove_emojis(full_response),
265
266
  tokens_utilises=total_tokens,
266
267
  type_action=type_action
267
268
  )
@@ -520,10 +521,15 @@ Total tokens : {conversation.total_tokens}
520
521
  Créée le : {conversation.created_date.strftime('%d/%m/%Y à %H:%M')}
521
522
  """
522
523
 
524
+ # Récupérer l'email expéditeur avec fallback
525
+ from_email = getattr(settings, 'EMAIL_EXPEDITEUR', None) \
526
+ or getattr(settings, 'DEFAULT_FROM_EMAIL', None) \
527
+ or 'noreply@revolucy.fr'
528
+
523
529
  send_mail(
524
530
  subject=sujet,
525
531
  message=message_email,
526
- from_email=settings.DEFAULT_FROM_EMAIL,
532
+ from_email=from_email,
527
533
  recipient_list=[destinataire],
528
534
  fail_silently=False
529
535
  )
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "django-lucy-assist"
7
- version = "1.0.1"
7
+ version = "1.0.3"
8
8
  description = "Assistant IA intelligent Revolucy pour outil métier"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}