django-lucy-assist 0.1.0__tar.gz → 1.0.1__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 (52) hide show
  1. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/PKG-INFO +10 -20
  2. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/README.md +9 -19
  3. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/django_lucy_assist.egg-info/PKG-INFO +10 -20
  4. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/__init__.py +1 -1
  5. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/conf.py +3 -4
  6. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/migrations/0001_initial.py +24 -24
  7. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/services/claude_service.py +2 -2
  8. django_lucy_assist-1.0.1/lucy_assist/static/lucy_assist/css/lucy-assist.css +920 -0
  9. django_lucy_assist-1.0.1/lucy_assist/templates/lucy_assist/chatbot_sidebar.html +415 -0
  10. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/pyproject.toml +1 -1
  11. django_lucy_assist-0.1.0/lucy_assist/static/lucy_assist/css/lucy-assist.css +0 -160
  12. django_lucy_assist-0.1.0/lucy_assist/templates/lucy_assist/chatbot_sidebar.html +0 -419
  13. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/MANIFEST.in +0 -0
  14. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/django_lucy_assist.egg-info/SOURCES.txt +0 -0
  15. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/django_lucy_assist.egg-info/dependency_links.txt +0 -0
  16. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/django_lucy_assist.egg-info/requires.txt +0 -0
  17. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/django_lucy_assist.egg-info/top_level.txt +0 -0
  18. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/admin.py +0 -0
  19. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/apps.py +0 -0
  20. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/constantes.py +0 -0
  21. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/context_processors.py +0 -0
  22. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/migrations/__init__.py +0 -0
  23. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/models/__init__.py +0 -0
  24. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/models/base.py +0 -0
  25. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/models/configuration.py +0 -0
  26. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/models/conversation.py +0 -0
  27. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/models/message.py +0 -0
  28. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/models/project_context_cache.py +0 -0
  29. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/services/__init__.py +0 -0
  30. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/services/bug_notification_service.py +0 -0
  31. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/services/context_service.py +0 -0
  32. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/services/crud_service.py +0 -0
  33. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/services/gitlab_service.py +0 -0
  34. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/services/project_context_service.py +0 -0
  35. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/services/tool_executor_service.py +0 -0
  36. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/services/tools_definition.py +0 -0
  37. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/signals.py +0 -0
  38. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/static/lucy_assist/image/icon-lucy.png +0 -0
  39. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/static/lucy_assist/js/lucy-assist.js +0 -0
  40. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/templates/lucy_assist/partials/documentation_content.html +0 -0
  41. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/tests/__init__.py +0 -0
  42. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/tests/factories/__init__.py +0 -0
  43. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/tests/factories/lucy_assist_factories.py +0 -0
  44. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/tests/test_lucy_assist.py +0 -0
  45. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/urls.py +0 -0
  46. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/utils/__init__.py +0 -0
  47. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/utils/log_utils.py +0 -0
  48. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/utils/message_utils.py +0 -0
  49. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/utils/token_utils.py +0 -0
  50. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/views/__init__.py +0 -0
  51. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/lucy_assist/views/api_views.py +0 -0
  52. {django_lucy_assist-0.1.0 → django_lucy_assist-1.0.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-lucy-assist
3
- Version: 0.1.0
3
+ Version: 1.0.1
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>
@@ -68,11 +68,7 @@ Ajouter dans votre fichier `.env` :
68
68
 
69
69
  ```bash
70
70
  # ======================================== LUCY ASSIST ========================================
71
- # Clé API Claude
72
- ANTHROPIC_API_KEY=sk-ant-...
73
-
74
- # Configuration GitLab pour l'analyse de bugs (optionnel)
75
- GITLAB_URL=https://gitlab.example.com
71
+ CLAUDE_LUCY_ASSIST_API_KEY=sk-ant-...
76
72
  GITLAB_TOKEN=glpat-...
77
73
  GITLAB_PROJECT_ID=123
78
74
 
@@ -85,20 +81,13 @@ Puis dans votre `settings.py` :
85
81
  ```python
86
82
  import os
87
83
 
84
+ #############################################################################################################
88
85
  # Lucy Assist
89
- ANTHROPIC_API_KEY = os.getenv('ANTHROPIC_API_KEY')
90
- GITLAB_URL = os.getenv('GITLAB_URL')
91
- GITLAB_TOKEN = os.getenv('GITLAB_TOKEN')
92
- GITLAB_PROJECT_ID = os.getenv('GITLAB_PROJECT_ID')
93
- SIREN_CLIENT = os.getenv('SIREN_CLIENT')
94
-
95
- # Configuration avancée (optionnel)
96
- LUCY_ASSIST = {
97
- # Modèle de base personnalisé
98
- 'BASE_MODEL': 'mon_app.models.MonModeleBase',
99
- # Préfixe des apps du projet pour le mapping modèle -> app
100
- 'PROJECT_APPS_PREFIX': 'apps.',
101
- }
86
+ CLAUDE_LUCY_ASSIST_API_KEY = env('CLAUDE_LUCY_ASSIST_API_KEY', default=None)
87
+ GITLAB_URL = env('GITLAB_URL', default=None)
88
+ GITLAB_TOKEN = env('GITLAB_TOKEN', default=None)
89
+ GITLAB_PROJECT_ID = env('GITLAB_PROJECT_ID', default=None)
90
+ LUCY_ASSIST = {'PROJECT_APPS_PREFIX': 'apps.'}
102
91
  ```
103
92
 
104
93
  ### 3. Ajouter les URLs
@@ -197,10 +186,11 @@ Lucy Assist expose plusieurs endpoints API :
197
186
  ## Versionning
198
187
 
199
188
  - V1.0.0 | Création du module Lucy
189
+ - V1.0.1 | Correction de bugs
200
190
 
201
191
  ## Déploiement Pypi
202
192
 
203
- 1. `pip install build twine`
193
+ 1. `docker-compose exec django pip install build twine`
204
194
  2. `python -m build`
205
195
  3. `python -m twine upload dist/*`
206
196
  4. Indiquer le token présent dans 1Password
@@ -25,11 +25,7 @@ Ajouter dans votre fichier `.env` :
25
25
 
26
26
  ```bash
27
27
  # ======================================== LUCY ASSIST ========================================
28
- # Clé API Claude
29
- ANTHROPIC_API_KEY=sk-ant-...
30
-
31
- # Configuration GitLab pour l'analyse de bugs (optionnel)
32
- GITLAB_URL=https://gitlab.example.com
28
+ CLAUDE_LUCY_ASSIST_API_KEY=sk-ant-...
33
29
  GITLAB_TOKEN=glpat-...
34
30
  GITLAB_PROJECT_ID=123
35
31
 
@@ -42,20 +38,13 @@ Puis dans votre `settings.py` :
42
38
  ```python
43
39
  import os
44
40
 
41
+ #############################################################################################################
45
42
  # Lucy Assist
46
- ANTHROPIC_API_KEY = os.getenv('ANTHROPIC_API_KEY')
47
- GITLAB_URL = os.getenv('GITLAB_URL')
48
- GITLAB_TOKEN = os.getenv('GITLAB_TOKEN')
49
- GITLAB_PROJECT_ID = os.getenv('GITLAB_PROJECT_ID')
50
- SIREN_CLIENT = os.getenv('SIREN_CLIENT')
51
-
52
- # Configuration avancée (optionnel)
53
- LUCY_ASSIST = {
54
- # Modèle de base personnalisé
55
- 'BASE_MODEL': 'mon_app.models.MonModeleBase',
56
- # Préfixe des apps du projet pour le mapping modèle -> app
57
- 'PROJECT_APPS_PREFIX': 'apps.',
58
- }
43
+ CLAUDE_LUCY_ASSIST_API_KEY = env('CLAUDE_LUCY_ASSIST_API_KEY', default=None)
44
+ GITLAB_URL = env('GITLAB_URL', default=None)
45
+ GITLAB_TOKEN = env('GITLAB_TOKEN', default=None)
46
+ GITLAB_PROJECT_ID = env('GITLAB_PROJECT_ID', default=None)
47
+ LUCY_ASSIST = {'PROJECT_APPS_PREFIX': 'apps.'}
59
48
  ```
60
49
 
61
50
  ### 3. Ajouter les URLs
@@ -154,10 +143,11 @@ Lucy Assist expose plusieurs endpoints API :
154
143
  ## Versionning
155
144
 
156
145
  - V1.0.0 | Création du module Lucy
146
+ - V1.0.1 | Correction de bugs
157
147
 
158
148
  ## Déploiement Pypi
159
149
 
160
- 1. `pip install build twine`
150
+ 1. `docker-compose exec django pip install build twine`
161
151
  2. `python -m build`
162
152
  3. `python -m twine upload dist/*`
163
153
  4. Indiquer le token présent dans 1Password
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: django-lucy-assist
3
- Version: 0.1.0
3
+ Version: 1.0.1
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>
@@ -68,11 +68,7 @@ Ajouter dans votre fichier `.env` :
68
68
 
69
69
  ```bash
70
70
  # ======================================== LUCY ASSIST ========================================
71
- # Clé API Claude
72
- ANTHROPIC_API_KEY=sk-ant-...
73
-
74
- # Configuration GitLab pour l'analyse de bugs (optionnel)
75
- GITLAB_URL=https://gitlab.example.com
71
+ CLAUDE_LUCY_ASSIST_API_KEY=sk-ant-...
76
72
  GITLAB_TOKEN=glpat-...
77
73
  GITLAB_PROJECT_ID=123
78
74
 
@@ -85,20 +81,13 @@ Puis dans votre `settings.py` :
85
81
  ```python
86
82
  import os
87
83
 
84
+ #############################################################################################################
88
85
  # Lucy Assist
89
- ANTHROPIC_API_KEY = os.getenv('ANTHROPIC_API_KEY')
90
- GITLAB_URL = os.getenv('GITLAB_URL')
91
- GITLAB_TOKEN = os.getenv('GITLAB_TOKEN')
92
- GITLAB_PROJECT_ID = os.getenv('GITLAB_PROJECT_ID')
93
- SIREN_CLIENT = os.getenv('SIREN_CLIENT')
94
-
95
- # Configuration avancée (optionnel)
96
- LUCY_ASSIST = {
97
- # Modèle de base personnalisé
98
- 'BASE_MODEL': 'mon_app.models.MonModeleBase',
99
- # Préfixe des apps du projet pour le mapping modèle -> app
100
- 'PROJECT_APPS_PREFIX': 'apps.',
101
- }
86
+ CLAUDE_LUCY_ASSIST_API_KEY = env('CLAUDE_LUCY_ASSIST_API_KEY', default=None)
87
+ GITLAB_URL = env('GITLAB_URL', default=None)
88
+ GITLAB_TOKEN = env('GITLAB_TOKEN', default=None)
89
+ GITLAB_PROJECT_ID = env('GITLAB_PROJECT_ID', default=None)
90
+ LUCY_ASSIST = {'PROJECT_APPS_PREFIX': 'apps.'}
102
91
  ```
103
92
 
104
93
  ### 3. Ajouter les URLs
@@ -197,10 +186,11 @@ Lucy Assist expose plusieurs endpoints API :
197
186
  ## Versionning
198
187
 
199
188
  - V1.0.0 | Création du module Lucy
189
+ - V1.0.1 | Correction de bugs
200
190
 
201
191
  ## Déploiement Pypi
202
192
 
203
- 1. `pip install build twine`
193
+ 1. `docker-compose exec django pip install build twine`
204
194
  2. `python -m build`
205
195
  3. `python -m twine upload dist/*`
206
196
  4. Indiquer le token présent dans 1Password
@@ -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__ = '0.1.0'
8
+ __version__ = '1.0.1'
9
9
  __author__ = 'Revolucy'
10
10
 
11
11
  default_app_config = 'lucy_assist.apps.LucyAssistConfig'
@@ -17,8 +17,8 @@ class LucyAssistSettings:
17
17
  # Peut être une string "mon_app.models.MonModele" ou une classe directement
18
18
  'BASE_MODEL': None,
19
19
 
20
- # Clé API Claude (peut aussi être définie via ANTHROPIC_API_KEY)
21
- 'CLAUDE_API_KEY': None,
20
+ # Clé API Claude (peut aussi être définie via CLAUDE_LUCY_ASSIST_API_KEY)
21
+ 'CLAUDE_LUCY_ASSIST_API_KEY': None,
22
22
 
23
23
  # Modèle Claude à utiliser
24
24
  'CLAUDE_MODEL': 'claude-sonnet-4-20250514',
@@ -67,11 +67,10 @@ class LucyAssistSettings:
67
67
  return self._settings[name]
68
68
 
69
69
  # Cas spéciaux pour les settings qui peuvent être définis au niveau global
70
- if name == 'CLAUDE_API_KEY':
70
+ if name == 'CLAUDE_LUCY_ASSIST_API_KEY':
71
71
  # Chercher dans plusieurs variables possibles
72
72
  return (
73
73
  getattr(settings, 'CLAUDE_LUCY_ASSIST_API_KEY', None) or
74
- getattr(settings, 'ANTHROPIC_API_KEY', None) or
75
74
  self.DEFAULTS[name]
76
75
  )
77
76
 
@@ -1,8 +1,8 @@
1
- # Generated migration for lucy_assist
1
+ # Generated by Django 6.0.1 on 2026-01-26 17:03
2
2
 
3
+ import django.db.models.deletion
3
4
  from django.conf import settings
4
5
  from django.db import migrations, models
5
- import django.db.models.deletion
6
6
 
7
7
 
8
8
  class Migration(migrations.Migration):
@@ -19,7 +19,7 @@ class Migration(migrations.Migration):
19
19
  fields=[
20
20
  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
21
21
  ('created_date', models.DateTimeField(auto_now_add=True)),
22
- ('updated_date', models.DateTimeField(auto_now=True, null=True, blank=True)),
22
+ ('updated_date', models.DateTimeField(auto_now=True, null=True)),
23
23
  ('is_active', models.BooleanField(default=True)),
24
24
  ('tokens_disponibles', models.BigIntegerField(default=0)),
25
25
  ('prix_par_million_tokens', models.DecimalField(decimal_places=2, default=10.0, max_digits=10)),
@@ -33,12 +33,31 @@ class Migration(migrations.Migration):
33
33
  'verbose_name_plural': 'Configuration Lucy Assist',
34
34
  },
35
35
  ),
36
+ migrations.CreateModel(
37
+ name='ProjectContextCache',
38
+ fields=[
39
+ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
40
+ ('created_date', models.DateTimeField(auto_now_add=True)),
41
+ ('updated_date', models.DateTimeField(auto_now=True, null=True)),
42
+ ('is_active', models.BooleanField(default=True)),
43
+ ('cache_key', models.CharField(db_index=True, max_length=255, unique=True)),
44
+ ('contenu', models.JSONField(default=dict)),
45
+ ('content_hash', models.CharField(blank=True, max_length=64)),
46
+ ('expire_at', models.DateTimeField()),
47
+ ('tokens_economises', models.BigIntegerField(default=0)),
48
+ ('hit_count', models.IntegerField(default=0)),
49
+ ],
50
+ options={
51
+ 'verbose_name': 'Cache contexte projet',
52
+ 'verbose_name_plural': 'Caches contexte projet',
53
+ },
54
+ ),
36
55
  migrations.CreateModel(
37
56
  name='Conversation',
38
57
  fields=[
39
58
  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
40
59
  ('created_date', models.DateTimeField(auto_now_add=True)),
41
- ('updated_date', models.DateTimeField(auto_now=True, null=True, blank=True)),
60
+ ('updated_date', models.DateTimeField(auto_now=True, null=True)),
42
61
  ('is_active', models.BooleanField(default=True)),
43
62
  ('titre', models.CharField(blank=True, max_length=255, null=True)),
44
63
  ('page_contexte', models.CharField(blank=True, max_length=500, null=True)),
@@ -55,7 +74,7 @@ class Migration(migrations.Migration):
55
74
  fields=[
56
75
  ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
57
76
  ('created_date', models.DateTimeField(auto_now_add=True)),
58
- ('updated_date', models.DateTimeField(auto_now=True, null=True, blank=True)),
77
+ ('updated_date', models.DateTimeField(auto_now=True, null=True)),
59
78
  ('is_active', models.BooleanField(default=True)),
60
79
  ('repondant', models.CharField(choices=[('UTILISATEUR', 'Utilisateur'), ('CHATBOT', 'Lucy Assist')], max_length=20)),
61
80
  ('contenu', models.TextField()),
@@ -70,23 +89,4 @@ class Migration(migrations.Migration):
70
89
  'ordering': ['created_date'],
71
90
  },
72
91
  ),
73
- migrations.CreateModel(
74
- name='ProjectContextCache',
75
- fields=[
76
- ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
77
- ('created_date', models.DateTimeField(auto_now_add=True)),
78
- ('updated_date', models.DateTimeField(auto_now=True, null=True, blank=True)),
79
- ('is_active', models.BooleanField(default=True)),
80
- ('cache_key', models.CharField(db_index=True, max_length=255, unique=True)),
81
- ('contenu', models.JSONField(default=dict)),
82
- ('content_hash', models.CharField(blank=True, max_length=64)),
83
- ('expire_at', models.DateTimeField()),
84
- ('tokens_economises', models.BigIntegerField(default=0)),
85
- ('hit_count', models.IntegerField(default=0)),
86
- ],
87
- options={
88
- 'verbose_name': 'Cache contexte projet',
89
- 'verbose_name_plural': 'Caches contexte projet',
90
- },
91
- ),
92
92
  ]
@@ -31,9 +31,9 @@ class ClaudeService:
31
31
  MAX_CONTEXT_TOKENS = 2000 # Limiter le contexte à 2000 tokens estimés
32
32
 
33
33
  def __init__(self):
34
- self.api_key = lucy_assist_settings.CLAUDE_API_KEY
34
+ self.api_key = lucy_assist_settings.CLAUDE_LUCY_ASSIST_API_KEY
35
35
  if not self.api_key:
36
- raise ValueError("CLAUDE_API_KEY non configurée dans les settings")
36
+ raise ValueError("CLAUDE_LUCY_ASSIST_API_KEY non configurée dans les settings")
37
37
 
38
38
  self.client = anthropic.Anthropic(api_key=self.api_key)
39
39
  self._project_context_service = None