django-lucy-assist 1.2.1__tar.gz → 1.2.2__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.
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/PKG-INFO +1 -1
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/django_lucy_assist.egg-info/PKG-INFO +1 -1
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/__init__.py +1 -1
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/admin.py +6 -1
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/constantes.py +7 -7
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/models/configuration.py +10 -2
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/signals.py +0 -15
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/pyproject.toml +1 -1
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/MANIFEST.in +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/README.md +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/django_lucy_assist.egg-info/SOURCES.txt +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/django_lucy_assist.egg-info/dependency_links.txt +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/django_lucy_assist.egg-info/requires.txt +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/django_lucy_assist.egg-info/top_level.txt +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/apps.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/conf.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/context_processors.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/migrations/0001_initial.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/migrations/0002_configurationlucyassist_prompt_complementaire.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/migrations/0003_configurationlucyassist_crud_views_mapping.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/migrations/0004_configurationlucyassist_system_prompt.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/migrations/__init__.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/models/__init__.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/models/base.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/models/conversation.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/models/message.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/models/project_context_cache.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/__init__.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/bug_notification_service.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/context_service.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/crud_service.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/gitlab_service.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/mistral_service.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/project_context_service.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/tool_executor_service.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/tools_definition.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/view_discovery_service.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/static/lucy_assist/css/lucy-assist.css +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/static/lucy_assist/image/icon-lucy.png +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/static/lucy_assist/js/lucy-assist.js +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/templates/lucy_assist/chatbot_sidebar.html +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/templates/lucy_assist/partials/documentation_content.html +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/tests/__init__.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/tests/factories/__init__.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/tests/factories/lucy_assist_factories.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/tests/test_lucy_assist.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/urls.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/utils/__init__.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/utils/log_utils.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/utils/message_utils.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/utils/token_utils.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/views/__init__.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/views/api_views.py +0 -0
- {django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/setup.cfg +0 -0
|
@@ -5,7 +5,7 @@ Un chatbot IA base sur Mistral AI, integrable dans n'importe quelle
|
|
|
5
5
|
application Django pour fournir une assistance contextuelle aux utilisateurs.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = '1.2.
|
|
8
|
+
__version__ = '1.2.2'
|
|
9
9
|
__author__ = 'Revolucy'
|
|
10
10
|
|
|
11
11
|
default_app_config = 'lucy_assist.apps.LucyAssistConfig'
|
|
@@ -26,7 +26,12 @@ class ConfigurationLucyAssistAdmin(admin.ModelAdmin):
|
|
|
26
26
|
'fields': ('tokens_disponibles', 'prix_par_million_tokens', 'actif')
|
|
27
27
|
}),
|
|
28
28
|
('Personnalisation', {
|
|
29
|
-
'fields': ('avatar', 'questions_frequentes'
|
|
29
|
+
'fields': ('avatar', 'questions_frequentes')
|
|
30
|
+
}),
|
|
31
|
+
('Prompt Système', {
|
|
32
|
+
'fields': ('system_prompt', 'prompt_complementaire'),
|
|
33
|
+
'classes': ('collapse',),
|
|
34
|
+
'description': 'Le prompt système est initialisé automatiquement si vide. Le prompt complémentaire est ajouté à la fin.'
|
|
30
35
|
}),
|
|
31
36
|
('Mapping Automatique (lecture seule)', {
|
|
32
37
|
'fields': ('crud_views_mapping_display', 'model_app_mapping_display'),
|
|
@@ -58,11 +58,11 @@ Tu as la capacité d'EXÉCUTER des actions directement dans l'application grâce
|
|
|
58
58
|
|
|
59
59
|
## COMPORTEMENT PRIORITAIRE - ACTION FIRST
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
tu dois
|
|
61
|
+
REGLE FONDAMENTALE : Quand l'utilisateur te demande de faire quelque chose (creer, modifier, rechercher, supprimer),
|
|
62
|
+
tu dois EXECUTER L'ACTION IMMEDIATEMENT en utilisant les tools disponibles.
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
NE FAIS PAS : Expliquer comment faire, rediriger vers une page, dire que tu ne peux pas
|
|
65
|
+
FAIS : Utiliser le tool approprie pour executer l'action demandee
|
|
66
66
|
|
|
67
67
|
## Quand NE PAS agir directement
|
|
68
68
|
|
|
@@ -91,10 +91,10 @@ Pour TOUTE demande de suppression, tu DOIS suivre cette procédure :
|
|
|
91
91
|
## Modèles disponibles dans l'application
|
|
92
92
|
{available_models}
|
|
93
93
|
|
|
94
|
-
## Format de
|
|
94
|
+
## Format de reponse apres action
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
"
|
|
96
|
+
Apres avoir execute une action, confirme brievement :
|
|
97
|
+
"[OK] [Action effectuee] - [Detail bref]"
|
|
98
98
|
""",
|
|
99
99
|
'crud': """Tu dois aider l'utilisateur à créer ou modifier un objet.
|
|
100
100
|
Formulaire disponible : {form_info}
|
|
@@ -57,12 +57,20 @@ class ConfigurationLucyAssist(LucyAssistBaseModel):
|
|
|
57
57
|
"""
|
|
58
58
|
Retourne la configuration singleton.
|
|
59
59
|
Utilise le cache pour optimiser les performances.
|
|
60
|
+
Initialise le system_prompt si vide.
|
|
60
61
|
"""
|
|
61
62
|
cache_key = 'lucy_assist_config'
|
|
62
63
|
config = cache.get(cache_key)
|
|
63
64
|
|
|
64
65
|
if config is None:
|
|
65
|
-
config,
|
|
66
|
+
config, created = cls.objects.get_or_create(pk=1)
|
|
67
|
+
|
|
68
|
+
# Initialiser le system_prompt si vide (première utilisation ou reset)
|
|
69
|
+
if not config.system_prompt:
|
|
70
|
+
from lucy_assist.constantes import LucyAssistConstantes
|
|
71
|
+
config.system_prompt = LucyAssistConstantes.SYSTEM_PROMPTS['default']
|
|
72
|
+
config.save(update_fields=['system_prompt'])
|
|
73
|
+
|
|
66
74
|
cache.set(cache_key, config, timeout=300) # Cache 5 minutes
|
|
67
75
|
|
|
68
76
|
return config
|
|
@@ -267,7 +275,7 @@ class ConfigurationLucyAssist(LucyAssistBaseModel):
|
|
|
267
275
|
"""
|
|
268
276
|
Retourne le nom de l'application depuis les settings.
|
|
269
277
|
"""
|
|
270
|
-
return lucy_assist_settings
|
|
278
|
+
return getattr(lucy_assist_settings, 'APPLICATION_NAME', 'cette application')
|
|
271
279
|
|
|
272
280
|
def get_available_models_description(self) -> str:
|
|
273
281
|
"""
|
|
@@ -5,7 +5,6 @@ from django.db.models.signals import post_save, pre_delete
|
|
|
5
5
|
from django.dispatch import receiver
|
|
6
6
|
|
|
7
7
|
from lucy_assist.models import Message, ConfigurationLucyAssist
|
|
8
|
-
from lucy_assist.constantes import LucyAssistConstantes
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
@receiver(post_save, sender=Message)
|
|
@@ -26,17 +25,3 @@ def message_post_save(sender, instance, created, **kwargs):
|
|
|
26
25
|
config.save(update_fields=['tokens_disponibles'])
|
|
27
26
|
|
|
28
27
|
|
|
29
|
-
@receiver(post_save, sender=ConfigurationLucyAssist)
|
|
30
|
-
def config_post_save(sender, instance, created, **kwargs):
|
|
31
|
-
"""
|
|
32
|
-
Signal déclenché après sauvegarde de la configuration.
|
|
33
|
-
Initialise le system_prompt avec le prompt par défaut si vide.
|
|
34
|
-
"""
|
|
35
|
-
if getattr(instance, '_skip_signals', False):
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
if not instance.system_prompt:
|
|
39
|
-
# Initialiser avec le prompt par défaut
|
|
40
|
-
instance.system_prompt = LucyAssistConstantes.SYSTEM_PROMPTS['default']
|
|
41
|
-
instance._skip_signals = True
|
|
42
|
-
instance.save(update_fields=['system_prompt'])
|
|
File without changes
|
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/django_lucy_assist.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/django_lucy_assist.egg-info/requires.txt
RENAMED
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/django_lucy_assist.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/migrations/0001_initial.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/models/project_context_cache.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/context_service.py
RENAMED
|
File without changes
|
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/gitlab_service.py
RENAMED
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/mistral_service.py
RENAMED
|
File without changes
|
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/tool_executor_service.py
RENAMED
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/tools_definition.py
RENAMED
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/services/view_discovery_service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_lucy_assist-1.2.1 → django_lucy_assist-1.2.2}/lucy_assist/tests/factories/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|