You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/ai-completions.ts
+47-1Lines changed: 47 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -148,6 +148,13 @@ export function getSystem(
148
148
? ""
149
149
: " Use the following tone: "+tone;
150
150
}
151
+
if(template==="ph_analysis_outline"){
152
+
return"You are an expert who writes philosophy text analysis similar to those required for a high school diploma in the United States."+
153
+
tone===
154
+
"tones-none"
155
+
? ""
156
+
: " Use the following tone: "+tone;
157
+
}
151
158
if(template==="table")
152
159
return"You are an expert who creates HTML Tables. You help organize data in HTML tables. You ONLY give the code for the HTML Table (body ONLY,no head, no scripts) on a single line."+
153
160
tone===
@@ -197,6 +204,13 @@ export function getSystem(
197
204
? ""
198
205
: " Utilise le ton suivant : "+tone;
199
206
}
207
+
if(template==="ph_analysis_outline"){
208
+
return"Tu es un expert qui fait des explications de texte type bac de philosophie."+
209
+
tone===
210
+
"tones-none"
211
+
? ""
212
+
: " Utilise le ton suivant : "+tone;
213
+
}
200
214
if(template==="table")
201
215
return"Tu es un expert qui crée des tableaux HTML. Tu aides à organiser les données dans les tableaux HTML. Tu donnes UNIQUEMENT le code du tableau en HTML (body SEULEMENT, pas de head, pas de scripts) en une seule ligne."+
202
216
tone===
@@ -266,7 +280,9 @@ export function getPrompt(
266
280
case"ph_analysis_basic":
267
281
return`Write the text analysis with Introduction, Development and Conclusion. Use the provided structures. Introduction structure: introduction, presentation of the text's theme, problematic (on the one hand, on the other, therefore), presentation of the author's thesis, announcement of the text's plan, using the author's arguments for each part. Development structure: The explanation is linear, i.e. the assignment must follow the order of the text. Each part corresponds to a part of the extract, and within the part, the various particular explanations (of terms, of sentences in themselves) follow one another as in the text. - For each part, start by giving the main idea. - For each sentence, give its function (premise, explanation, example...) and content, expressed in your own words. An explanation may follow if the sentence is very complex. - Explain the philosophical terms in the sentence, giving definitions, and explain underlying references (you may wish to mention other authors). End with a concrete example illustrating the author's idea. Conclusion structure: recall the most the most important elements of the development, clearly explaining how the development showed how the author demonstrated his thesis. Text: [[${prompt}]]`;
268
282
case"ph_analysis_dev":
269
-
return`Write the text explanation using sentences, no list. The explanation is linear, i.e. the assignment must follow the order of the text. Each part corresponds to a part of the extract, and within the part, the various specific explanations (of terms, of sentences in themselves) follow one another as in the text. Start from the broadest to the most precise: - For each part, start by giving the main idea. - For each sentence, give its function (premise, explanation, example...) and content expressed in your own words. An explanation may follow if the sentence is very complex. - Explain the philosophical terms in the sentence by giving definitions, and make explicit any implied meaning or underlying references (you may wish to mention other authors). - End with a concrete example illustrating the author's idea. Texte : [[${prompt}]]`;
283
+
return`Write the text explanation using sentences, no list. The explanation is linear, i.e. the assignment must follow the order of the text. Each part corresponds to a part of the extract, and within the part, the various specific explanations (of terms, of sentences in themselves) follow one another as in the text. Start from the broadest to the most precise: - For each part, start by giving the main idea. - For each sentence, give its function (premise, explanation, example...) and content expressed in your own words. An explanation may follow if the sentence is very complex. - Explain the philosophical terms in the sentence by giving definitions, and make explicit any implied meaning or underlying references (you may wish to mention other authors). - End with a concrete example illustrating the author's idea. Text: [[${prompt}]]`;
284
+
case"ph_analysis_outline":
285
+
return`Write the outline of the text explanation. The explanation is linear, i.e. the assignment must follow the order of the text. Each part corresponds to a part of the extract, and within the part, the various specific explanations (of terms, of sentences in themselves) follow one another as in the text. Start from the broadest to the most precise: - For each part, start by giving the main idea. - For each sentence, give its function (premise, explanation, example...) and content expressed in your own words. An explanation may follow if the sentence is very complex. - Explain the philosophical terms in the sentence by giving definitions, and make explicit any implied meaning or underlying references (you may wish to mention other authors). - End with a concrete example illustrating the author's idea. Text: [[${prompt}]]`;
270
286
271
287
case"table":
272
288
return`Give ONLY the corresponding HTML Table about (no other text): ${prompt}`;
@@ -309,6 +325,8 @@ export function getPrompt(
309
325
return`Rédige l'explication de texte avec Introduction, développement et conclusion. Utilise les structures proposées. Structure de l'introduction : introduction, présentation du thème du texte, problématique (d'une part, d'autre part, donc), présentation de la thèse de l'auteur, annonce du plan du texte, utilisation des arguments de l'auteur pour chaque partie. Structure du développement : L'explication est linéaire, c'est-à-dire que le devoir doit suivre l'ordre du texte. Chaque partie correspond à une partie de l'extrait, et à l'intérieur de la partie, les différentes explications particulières (de termes, de phrases en elles-mêmes) se succèdent comme dans le texte. - Pour chaque partie, commencez par donner l'idée principale. - Pour chaque phrase, donnez sa fonction (prémisse, explication, exemple...) et son contenu, exprimés avec vos propres mots. Une explication peut suivre si la phrase est très complexe. - Expliquez les termes philosophiques de la phrase, en donnant des définitions, et expliquez les références sous-jacentes (vous pouvez éventuellement mentionner d'autres auteurs). Terminez par un exemple concret illustrant l'idée de l'auteur. Structure de la conclusion : rappeler les éléments les plus importants du développement, en expliquant clairement comment le développement a montré comment l'auteur a démontré sa thèse. Texte : [[${prompt}]]`;
310
326
case"ph_analysis_dev":
311
327
return`Rédige le developpement l'explication de texte avec des phrases, pas de listes. L'explication est linéaire, c'est-à-dire que le devoir doit suivre l'ordre du texte. Chaque partie correspond à une partie de l'extrait, et à l'intérieur de la partie, les différentes explications particulières (des termes, des phrases en elles-mêmes) se succèdent comme dans le texte. Partez du plus large pour aller vers le plus précis : - Pour chaque partie, commencez par en donner l'idée principale. - Pour chaque phrase, donnez-en la fonction (postulat, explication, exemple...) et le contenu exprimé avec vos mots. Peut suivre une explication si la phrase est très complexe. - Expliquez les termes philosophiques de la phrase en donnant des définitions, et explicitez les sous-entendus, les références sous-jacentes (vous pouvez alors mentionner d'autres auteurs). - Terminez par un exemple concret illustrant l'idée de l'auteur. Texte : [[${prompt}]]`;
328
+
case"ph_analysis_outline":
329
+
return`Rédige le plan du developpement de l'explication de texte. L'explication est linéaire, c'est-à-dire que le devoir doit suivre l'ordre du texte. Chaque partie correspond à une partie de l'extrait, et à l'intérieur de la partie, les différentes explications particulières (des termes, des phrases en elles-mêmes) se succèdent comme dans le texte. Partez du plus large pour aller vers le plus précis : - Pour chaque partie, commencez par en donner l'idée principale. - Pour chaque phrase, donnez-en la fonction (postulat, explication, exemple...) et le contenu exprimé avec vos mots. Peut suivre une explication si la phrase est très complexe. - Expliquez les termes philosophiques de la phrase en donnant des définitions, et explicitez les sous-entendus, les références sous-jacentes (vous pouvez alors mentionner d'autres auteurs). - Terminez par un exemple concret illustrant l'idée de l'auteur. Texte : [[${prompt}]]`;
312
330
313
331
case"table":
314
332
return`Donne SEULEMENT le tableau HTML correspondant au sujet suivant (pas d'autre texte) : ${prompt}`;
return`Write ONLY the introduction of the text analysis using the following structure: introduction, presentation of the text's theme, problematic (on the one hand, on the other, therefore [question]), quick presentation of the author's thesis, announcement of the text's plan, using the provided outline. OUTLINE=[[${outline}]]\nTEXT=[[${text}]]`;
396
+
case"ph_analysis_dev":
397
+
return`Write the text explanation development (note that the intro and conclusion were previously written using the provided OUTLINE) using sentences, no list, don't show the different parts letters and numbers. The explanation is linear, i.e. the assignment must follow the order of the text. Each part corresponds to a part of the extract, and within the part, the various specific explanations (of terms, of sentences in themselves) follow one another as in the text. Start from the broadest to the most precise: - For each part, start by giving the main idea. - For each sentence, give its function (premise, explanation, example...) and content expressed in your own words. An explanation may follow if the sentence is very complex. - Explain the philosophical terms in the sentence by giving definitions, and make explicit any implied meaning or underlying references (you may wish to mention other authors). - End with a concrete example illustrating the author's idea. TEXT=[[${text}]]\nOUTLINE=[[${outline}]]`;
398
+
case"ph_analysis_conclusion":
399
+
return`Write ONLY the conclusion of the text analysis (which was based on the provided OUTLINE), recall the most the most important elements of the development, clearly explaining how the development showed how the author demonstrated his thesis. OUTLINE=[[${outline}]]\nTEXT=[[${text}]]`;
400
+
}
401
+
}else{
402
+
switch(template){
403
+
case"ph_analysis_intro":
404
+
return`Rédiger UNIQUEMENT l'introduction de l'analyse de texte selon la structure suivante (pas de développement) : amorce, présentation du thème du texte, problématique (paragraphe avec : d'une part, d'autre part, donc [question]), présentation très rapide en une phrase de la thèse de l'auteur, annonce du plan du texte, en utilisant le plan fourni. PLAN=[[${outline}]]\nTEXTE=[[${text}]]`;
405
+
case"ph_analysis_dev":
406
+
return`Rédiger UNIQUEMENT le développement de l'explication de texte (notez que l'introduction et la conclusion ont été rédigées au préalable à l'aide du schéma fourni) en utilisant des phrases, pas de liste, ne montrez pas les différentes parties sous forme de lettres et de chiffres. L'explication est linéaire, c'est-à-dire que le travail doit suivre l'ordre du texte. Chaque partie correspond à une partie de l'extrait, et à l'intérieur de la partie, les différentes explications spécifiques (des termes, des phrases en elles-mêmes) se succèdent comme dans le texte. Partez du plus large au plus précis : - Pour chaque partie, commencez par donner l'idée principale. - Pour chaque phrase, donnez sa fonction (prémisse, explication, exemple...) et son contenu exprimé avec vos propres mots. Une explication peut suivre si la phrase est très complexe. - Expliquez les termes philosophiques de la phrase en donnant des définitions, et explicitez les sous-entendus ou les références sous-jacentes (vous pouvez citer d'autres auteurs). - Terminez par un exemple concret illustrant l'idée de l'auteur. TEXTE=[[${text}]]\nPLAN=[[${outline}]]`;
407
+
case"ph_analysis_conclusion":
408
+
return`Rédiger UNIQUEMENT la conclusion de l'analyse du texte (qui était basée sur le PLAN fourni), en rappelant les éléments les plus importants du développement, en expliquant clairement comment le développement a montré comment l'auteur a démontré sa thèse. PLAN=[[${outline}]]\nTEXTE=[[${text}]]`;
0 commit comments