django-lucy-assist 1.0.2__tar.gz → 1.0.4__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.2 → django_lucy_assist-1.0.4}/PKG-INFO +3 -1
  2. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/README.md +2 -0
  3. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/django_lucy_assist.egg-info/PKG-INFO +3 -1
  4. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/__init__.py +1 -1
  5. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/models/configuration.py +3 -0
  6. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/services/bug_notification_service.py +1 -1
  7. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/services/claude_service.py +6 -0
  8. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/utils/message_utils.py +39 -0
  9. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/views/api_views.py +9 -3
  10. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/pyproject.toml +1 -1
  11. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/MANIFEST.in +0 -0
  12. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/django_lucy_assist.egg-info/SOURCES.txt +0 -0
  13. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/django_lucy_assist.egg-info/dependency_links.txt +0 -0
  14. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/django_lucy_assist.egg-info/requires.txt +0 -0
  15. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/django_lucy_assist.egg-info/top_level.txt +0 -0
  16. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/admin.py +0 -0
  17. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/apps.py +0 -0
  18. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/conf.py +0 -0
  19. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/constantes.py +0 -0
  20. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/context_processors.py +0 -0
  21. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/migrations/0001_initial.py +0 -0
  22. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/migrations/__init__.py +0 -0
  23. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/models/__init__.py +0 -0
  24. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/models/base.py +0 -0
  25. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/models/conversation.py +0 -0
  26. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/models/message.py +0 -0
  27. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/models/project_context_cache.py +0 -0
  28. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/services/__init__.py +0 -0
  29. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/services/context_service.py +0 -0
  30. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/services/crud_service.py +0 -0
  31. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/services/gitlab_service.py +0 -0
  32. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/services/project_context_service.py +0 -0
  33. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/services/tool_executor_service.py +0 -0
  34. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/services/tools_definition.py +0 -0
  35. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/signals.py +0 -0
  36. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/static/lucy_assist/css/lucy-assist.css +0 -0
  37. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/static/lucy_assist/image/icon-lucy.png +0 -0
  38. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/static/lucy_assist/js/lucy-assist.js +0 -0
  39. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/templates/lucy_assist/chatbot_sidebar.html +0 -0
  40. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/templates/lucy_assist/partials/documentation_content.html +0 -0
  41. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/tests/__init__.py +0 -0
  42. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/tests/factories/__init__.py +0 -0
  43. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/tests/factories/lucy_assist_factories.py +0 -0
  44. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/tests/test_lucy_assist.py +0 -0
  45. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/urls.py +0 -0
  46. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/utils/__init__.py +0 -0
  47. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/utils/log_utils.py +0 -0
  48. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/utils/token_utils.py +0 -0
  49. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/lucy_assist/views/__init__.py +0 -0
  50. {django_lucy_assist-1.0.2 → django_lucy_assist-1.0.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-lucy-assist
3
- Version: 1.0.2
3
+ Version: 1.0.4
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>
@@ -188,6 +188,8 @@ Lucy Assist expose plusieurs endpoints API :
188
188
  - V1.0.0 | Création du module Lucy
189
189
  - V1.0.1 | Correction de bugs
190
190
  - V1.0.2 | Correction de bugs
191
+ - V1.0.3 | Correction de bugs
192
+ - V1.0.4 | Ajout Prompt Custom dans configuration
191
193
 
192
194
  ## Déploiement Pypi
193
195
 
@@ -145,6 +145,8 @@ Lucy Assist expose plusieurs endpoints API :
145
145
  - V1.0.0 | Création du module Lucy
146
146
  - V1.0.1 | Correction de bugs
147
147
  - V1.0.2 | Correction de bugs
148
+ - V1.0.3 | Correction de bugs
149
+ - V1.0.4 | Ajout Prompt Custom dans configuration
148
150
 
149
151
  ## Déploiement Pypi
150
152
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-lucy-assist
3
- Version: 1.0.2
3
+ Version: 1.0.4
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>
@@ -188,6 +188,8 @@ Lucy Assist expose plusieurs endpoints API :
188
188
  - V1.0.0 | Création du module Lucy
189
189
  - V1.0.1 | Correction de bugs
190
190
  - V1.0.2 | Correction de bugs
191
+ - V1.0.3 | Correction de bugs
192
+ - V1.0.4 | Ajout Prompt Custom dans configuration
191
193
 
192
194
  ## Déploiement Pypi
193
195
 
@@ -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.2'
8
+ __version__ = '1.0.4'
9
9
  __author__ = 'Revolucy'
10
10
 
11
11
  default_app_config = 'lucy_assist.apps.LucyAssistConfig'
@@ -20,6 +20,9 @@ class ConfigurationLucyAssist(LucyAssistBaseModel):
20
20
  actif = models.BooleanField(default=True)
21
21
  avatar = models.ImageField(null=True, blank=True)
22
22
 
23
+ # Instructions complémentaires pour le prompt
24
+ prompt_complementaire = models.TextField(blank=True,default='')
25
+
23
26
  # Mapping des modèles vers leurs applications Django
24
27
  model_app_mapping = models.JSONField(blank=True, default=dict)
25
28
 
@@ -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.
@@ -87,6 +87,12 @@ class ClaudeService:
87
87
  user_permissions=', '.join(user_permissions)
88
88
  )
89
89
 
90
+ # Ajouter les instructions complémentaires si configurées
91
+ from lucy_assist.models import ConfigurationLucyAssist
92
+ config = ConfigurationLucyAssist.get_config()
93
+ if config.prompt_complementaire:
94
+ prompt += f"\n\n## Instructions complémentaires\n{config.prompt_complementaire}"
95
+
90
96
  return prompt
91
97
 
92
98
  def _optimize_messages(self, messages: List) -> List[Dict]:
@@ -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.2"
7
+ version = "1.0.4"
8
8
  description = "Assistant IA intelligent Revolucy pour outil métier"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}