django-lucy-assist 1.0.1__py3-none-any.whl → 1.0.3__py3-none-any.whl
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.
- {django_lucy_assist-1.0.1.dist-info → django_lucy_assist-1.0.3.dist-info}/METADATA +3 -1
- {django_lucy_assist-1.0.1.dist-info → django_lucy_assist-1.0.3.dist-info}/RECORD +10 -10
- lucy_assist/__init__.py +1 -1
- lucy_assist/services/bug_notification_service.py +7 -2
- lucy_assist/services/context_service.py +9 -6
- lucy_assist/templates/lucy_assist/chatbot_sidebar.html +1 -1
- lucy_assist/utils/message_utils.py +39 -0
- lucy_assist/views/api_views.py +9 -3
- {django_lucy_assist-1.0.1.dist-info → django_lucy_assist-1.0.3.dist-info}/WHEEL +0 -0
- {django_lucy_assist-1.0.1.dist-info → django_lucy_assist-1.0.3.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: django-lucy-assist
|
|
3
|
-
Version: 1.0.
|
|
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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
lucy_assist/__init__.py,sha256=
|
|
1
|
+
lucy_assist/__init__.py,sha256=_hZjDVKKgOhD4bnWsBIiUmkG3hO1evJTIb91XzpJWis,335
|
|
2
2
|
lucy_assist/admin.py,sha256=-hNfuwuMfxgZVFQc_ODy6WcyZPxrM_8TfKsRMd0fj38,694
|
|
3
3
|
lucy_assist/apps.py,sha256=zHZtlBXs5ML4CKtGg7xDyptSWzLfB1ks2VvbXF50hdo,264
|
|
4
4
|
lucy_assist/conf.py,sha256=xp5t-CRG4L7R-NOkb2sY6-XkmGee7M7Eb-jAVr-CAzk,3500
|
|
@@ -15,9 +15,9 @@ lucy_assist/models/conversation.py,sha256=psx2AQtQ5SFP-AJD7wbGabpXXLIGYngdVZfeoT
|
|
|
15
15
|
lucy_assist/models/message.py,sha256=kf-ffMtLYNFhXYUrB3QSL97KKDJUOMrKaPjKeOcJa_o,1492
|
|
16
16
|
lucy_assist/models/project_context_cache.py,sha256=Bnb0VU7pv7QEvjOI6JSLEPvL4BxskCQ0ojWGxO7YDSM,6530
|
|
17
17
|
lucy_assist/services/__init__.py,sha256=I0brW674WNIKkGHj2lj4sGEDD7HUAr5Z254dsbirdLk,691
|
|
18
|
-
lucy_assist/services/bug_notification_service.py,sha256=
|
|
18
|
+
lucy_assist/services/bug_notification_service.py,sha256=OyowCvAs-QDlsGQ_WTFoc4lRe9detD7r6ZyYK0JD2Sc,7217
|
|
19
19
|
lucy_assist/services/claude_service.py,sha256=9eU28qGadHmUZYW3ExQZOfsH1pxcarzpYlcRhKJu3Yc,15897
|
|
20
|
-
lucy_assist/services/context_service.py,sha256=
|
|
20
|
+
lucy_assist/services/context_service.py,sha256=RakjdAV74GlJlLsLYiTRluTQVmnkKC92xrXgWhnYJHQ,12232
|
|
21
21
|
lucy_assist/services/crud_service.py,sha256=E8-xRxPXXbUuPakGXPsbZfImEJWZx4BZq5DhM5q2I08,11436
|
|
22
22
|
lucy_assist/services/gitlab_service.py,sha256=uH83fwRSCwiRItznENpYQG4aPckjafYIV9z6OChUrZg,8056
|
|
23
23
|
lucy_assist/services/project_context_service.py,sha256=bIuqTanc59gP_BLod3oQgWplxpiCgByg-kbUMe_57CQ,14053
|
|
@@ -26,7 +26,7 @@ lucy_assist/services/tools_definition.py,sha256=xUJCtFZ1uROxB7jNHY0X75fs5nzFAKr4
|
|
|
26
26
|
lucy_assist/static/lucy_assist/css/lucy-assist.css,sha256=gUfj4OUTz_aFiXWau1iXtHEmfUCkUI2zGMfwkLk2nXs,18190
|
|
27
27
|
lucy_assist/static/lucy_assist/image/icon-lucy.png,sha256=FOYlwXAt40Gr9jsWFmhgPivYOBFWKeYW0lxJI5Up-GM,6710
|
|
28
28
|
lucy_assist/static/lucy_assist/js/lucy-assist.js,sha256=dmXtSPQ38LisoRWZd3R1Ms6OvVaEk3OrYKcVM0OMb_Q,28207
|
|
29
|
-
lucy_assist/templates/lucy_assist/chatbot_sidebar.html,sha256=
|
|
29
|
+
lucy_assist/templates/lucy_assist/chatbot_sidebar.html,sha256=cKyXkH3hPTxqfo42Osr__Aa9eBleI6bw0j1tGJVa0nQ,18919
|
|
30
30
|
lucy_assist/templates/lucy_assist/partials/documentation_content.html,sha256=byA2EvQT1GaMB5yTQHNt5ZfJKEew9_LxutU8s5muM9s,4143
|
|
31
31
|
lucy_assist/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
32
|
lucy_assist/tests/test_lucy_assist.py,sha256=KBvuED10_gOJWdaRS2zMigM3W5Kp00KhMEwaR8tvhUc,6949
|
|
@@ -34,11 +34,11 @@ lucy_assist/tests/factories/__init__.py,sha256=cDkgr4aPFKwbPo6JLY2s22pHrGWPI_vqG
|
|
|
34
34
|
lucy_assist/tests/factories/lucy_assist_factories.py,sha256=Mz1EN7xtMpIDJPNMledDbjR6X6dsBNv7JWczjD9-_MQ,3674
|
|
35
35
|
lucy_assist/utils/__init__.py,sha256=FnL0QF7pyhjHCOywVAkZq3dl4IEgT39prJk1FtXMBDc,129
|
|
36
36
|
lucy_assist/utils/log_utils.py,sha256=gdjaKg5PNUYlDVCQNFXQJG3vsLKay_aWX6AJxoHtiG4,1720
|
|
37
|
-
lucy_assist/utils/message_utils.py,sha256=
|
|
37
|
+
lucy_assist/utils/message_utils.py,sha256=YzcLHnl1ig4d5_utHCJwgxS7tKmd49Q-tuo78e6w2Ww,4494
|
|
38
38
|
lucy_assist/utils/token_utils.py,sha256=rxe9jHjcRJcaIlcw0QuVmYXOjscTsUsxnhhI6RMBzDM,2608
|
|
39
39
|
lucy_assist/views/__init__.py,sha256=uUPYpuHlBC8j7zKS_DDoWjwpCpRnOIXETY-S2-Ss0cY,288
|
|
40
|
-
lucy_assist/views/api_views.py,sha256=
|
|
41
|
-
django_lucy_assist-1.0.
|
|
42
|
-
django_lucy_assist-1.0.
|
|
43
|
-
django_lucy_assist-1.0.
|
|
44
|
-
django_lucy_assist-1.0.
|
|
40
|
+
lucy_assist/views/api_views.py,sha256=iCvdTTTJ73r3jfyZVjcEDi3Of2wP_N24G_QsXwc-Euk,23617
|
|
41
|
+
django_lucy_assist-1.0.3.dist-info/METADATA,sha256=AJ1AqyVGx-wzBYyoXXOqH8TC1_qx59AgpQESpFJZs_M,5686
|
|
42
|
+
django_lucy_assist-1.0.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
43
|
+
django_lucy_assist-1.0.3.dist-info/top_level.txt,sha256=T-UCiwpn5yF3Oem3234TUpSVnEgbkrM2rGz9Tz5N-QA,12
|
|
44
|
+
django_lucy_assist-1.0.3.dist-info/RECORD,,
|
lucy_assist/__init__.py
CHANGED
|
@@ -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.
|
|
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]
|
|
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=
|
|
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
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
-
|
|
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)
|
lucy_assist/views/api_views.py
CHANGED
|
@@ -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=
|
|
532
|
+
from_email=from_email,
|
|
527
533
|
recipient_list=[destinataire],
|
|
528
534
|
fail_silently=False
|
|
529
535
|
)
|
|
File without changes
|
|
File without changes
|