Spaces:
Runtime error
Runtime error
Commit ·
6b8bb1e
1
Parent(s): c4a75e6
fix(chat): les citations dans les phrases, pas en liste finale
Browse filesLe modele terminait parfois par une liste brute de references, affichee
telle quelle (« l'article 33 de la Loi N°2023/014 portant Code Minier
l'article 34 de la Loi... »), alors que l'interface montre deja les
sources sous la reponse.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- app/services/prompts.py +7 -0
app/services/prompts.py
CHANGED
|
@@ -38,6 +38,11 @@ LANGUAGE_INSTRUCTION = {
|
|
| 38 |
# citation, donc zero source affichee sous une reponse pourtant juste. La
|
| 39 |
# contrainte est verifiee par tests/test_services/test_prompts.py, qui applique
|
| 40 |
# la vraie regex a la phrase-exemple de chaque prompt.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
|
| 42 |
_FORME_FR = """
|
| 43 |
|
|
@@ -53,6 +58,7 @@ Citer tes sources est obligatoire, et la FORME de la citation ne se négocie pas
|
|
| 53 |
- Ni parenthèse ni virgule entre le numéro et le nom du texte. N'écris jamais « art. », ni « articles 5 et 6 ».
|
| 54 |
- Pour plusieurs articles, répète la formule entière : « l'article 5 du Code Minier et l'article 6 du Code Minier ».
|
| 55 |
- Ces citations sont relues par le programme pour construire les liens vers les textes. Une autre formulation ne casse rien, mais fait disparaître les sources sous ta réponse.
|
|
|
|
| 56 |
|
| 57 |
N'invente jamais un numéro d'article, un intitulé de loi, ni une obligation absente des documents fournis. Si l'information n'y est pas, dis-le en une phrase."""
|
| 58 |
|
|
@@ -70,6 +76,7 @@ Citing your sources is mandatory, and the FORM of the citation is not negotiable
|
|
| 70 |
- No parentheses and no comma between the number and the name of the text. Never write "art.", nor "Articles 5 and 6".
|
| 71 |
- For several articles, repeat the whole formula: "Article 5 of the Mining Code and Article 6 of the Mining Code".
|
| 72 |
- These citations are re-read by the program to build the links to the texts. A different wording breaks nothing, but makes the sources under your answer disappear.
|
|
|
|
| 73 |
|
| 74 |
Never invent an article number, a statute title, or an obligation absent from the supplied documents. If the information is not there, say so in one sentence."""
|
| 75 |
|
|
|
|
| 38 |
# citation, donc zero source affichee sous une reponse pourtant juste. La
|
| 39 |
# contrainte est verifiee par tests/test_services/test_prompts.py, qui applique
|
| 40 |
# la vraie regex a la phrase-exemple de chaque prompt.
|
| 41 |
+
#
|
| 42 |
+
# Les citations vont DANS les phrases. Constate sur le corpus ingere : le
|
| 43 |
+
# modele finissait parfois par une liste brute (« l'article 33 de la Loi
|
| 44 |
+
# N°2023/014 portant Code Minier l'article 34 de la Loi... »), affichee telle
|
| 45 |
+
# quelle, alors que l'interface montre deja les sources sous la reponse.
|
| 46 |
|
| 47 |
_FORME_FR = """
|
| 48 |
|
|
|
|
| 58 |
- Ni parenthèse ni virgule entre le numéro et le nom du texte. N'écris jamais « art. », ni « articles 5 et 6 ».
|
| 59 |
- Pour plusieurs articles, répète la formule entière : « l'article 5 du Code Minier et l'article 6 du Code Minier ».
|
| 60 |
- Ces citations sont relues par le programme pour construire les liens vers les textes. Une autre formulation ne casse rien, mais fait disparaître les sources sous ta réponse.
|
| 61 |
+
- Place chaque citation DANS la phrase qu'elle appuie. Ne termine jamais par une liste de références : les sources sont déjà affichées sous ta réponse.
|
| 62 |
|
| 63 |
N'invente jamais un numéro d'article, un intitulé de loi, ni une obligation absente des documents fournis. Si l'information n'y est pas, dis-le en une phrase."""
|
| 64 |
|
|
|
|
| 76 |
- No parentheses and no comma between the number and the name of the text. Never write "art.", nor "Articles 5 and 6".
|
| 77 |
- For several articles, repeat the whole formula: "Article 5 of the Mining Code and Article 6 of the Mining Code".
|
| 78 |
- These citations are re-read by the program to build the links to the texts. A different wording breaks nothing, but makes the sources under your answer disappear.
|
| 79 |
+
- Put each citation INSIDE the sentence it supports. Never end with a list of references: the sources are already displayed under your answer.
|
| 80 |
|
| 81 |
Never invent an article number, a statute title, or an obligation absent from the supplied documents. If the information is not there, say so in one sentence."""
|
| 82 |
|