Spaces:
Runtime error
Runtime error
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -17,9 +17,9 @@ def call_ai_api(prompt):
|
|
| 17 |
def generer_prompt_seo(titre_article, mot_cle_principal, ton_cible, mots_cles_associes,optional_text):
|
| 18 |
mots_cles_lexicaux = mots_cles_associes
|
| 19 |
if optional_text :
|
| 20 |
-
p=f"
|
| 21 |
else:
|
| 22 |
-
p=""
|
| 23 |
prompt = f"""
|
| 24 |
CONTEXTE:
|
| 25 |
Veuillez écrire un article de 1500 - 2000 mots. N'hésitez pas à prendre votre temps pour réfléchir à votre réponse j'ai besoin d'un long article.
|
|
@@ -29,8 +29,7 @@ def generer_prompt_seo(titre_article, mot_cle_principal, ton_cible, mots_cles_as
|
|
| 29 |
Titre de l'article : {titre_article}
|
| 30 |
Mot-clé principal : {mot_cle_principal}
|
| 31 |
Ton et/ou public cible : {ton_cible}
|
| 32 |
-
Mots-clés lexicaux à inclure : {mots_cles_lexicaux}
|
| 33 |
-
+p+"""
|
| 34 |
|
| 35 |
INSTRUCTIONS:
|
| 36 |
NOMBRE DE MOTS : 1000 à 1500
|
|
@@ -50,10 +49,10 @@ N'hésitez pas à prendre votre temps pour réfléchir à votre réponse j'ai be
|
|
| 50 |
return prompt
|
| 51 |
def generate_seo_prompt(article_title, main_keyword, target_tone, associated_keywords,optional_text):
|
| 52 |
lexical_keywords = associated_keywords
|
| 53 |
-
if optional_text
|
| 54 |
-
p=f"
|
| 55 |
else:
|
| 56 |
-
p=""
|
| 57 |
prompt = f"""
|
| 58 |
CONTEXT:
|
| 59 |
Please write an article of 1500 - 2000 words. Feel free to take your time to think about your response, I need a long article.
|
|
@@ -63,7 +62,7 @@ def generate_seo_prompt(article_title, main_keyword, target_tone, associated_key
|
|
| 63 |
Article title: {article_title}
|
| 64 |
Main keyword: {main_keyword}
|
| 65 |
Target tone and/or audience: {target_tone}
|
| 66 |
-
Lexical keywords to include: {lexical_keywords}
|
| 67 |
|
| 68 |
INSTRUCTIONS:
|
| 69 |
WORD COUNT: 1000 to 1500
|
|
|
|
| 17 |
def generer_prompt_seo(titre_article, mot_cle_principal, ton_cible, mots_cles_associes,optional_text):
|
| 18 |
mots_cles_lexicaux = mots_cles_associes
|
| 19 |
if optional_text :
|
| 20 |
+
p=f"Données optionnel sur l'article : {optional_text}"
|
| 21 |
else:
|
| 22 |
+
p=""
|
| 23 |
prompt = f"""
|
| 24 |
CONTEXTE:
|
| 25 |
Veuillez écrire un article de 1500 - 2000 mots. N'hésitez pas à prendre votre temps pour réfléchir à votre réponse j'ai besoin d'un long article.
|
|
|
|
| 29 |
Titre de l'article : {titre_article}
|
| 30 |
Mot-clé principal : {mot_cle_principal}
|
| 31 |
Ton et/ou public cible : {ton_cible}
|
| 32 |
+
Mots-clés lexicaux à inclure : {mots_cles_lexicaux}{p}
|
|
|
|
| 33 |
|
| 34 |
INSTRUCTIONS:
|
| 35 |
NOMBRE DE MOTS : 1000 à 1500
|
|
|
|
| 49 |
return prompt
|
| 50 |
def generate_seo_prompt(article_title, main_keyword, target_tone, associated_keywords,optional_text):
|
| 51 |
lexical_keywords = associated_keywords
|
| 52 |
+
if optional_text:
|
| 53 |
+
p = f"Données optionnel sur l'article : {optional_text}"
|
| 54 |
else:
|
| 55 |
+
p = ""
|
| 56 |
prompt = f"""
|
| 57 |
CONTEXT:
|
| 58 |
Please write an article of 1500 - 2000 words. Feel free to take your time to think about your response, I need a long article.
|
|
|
|
| 62 |
Article title: {article_title}
|
| 63 |
Main keyword: {main_keyword}
|
| 64 |
Target tone and/or audience: {target_tone}
|
| 65 |
+
Lexical keywords to include: {lexical_keywords}{p}
|
| 66 |
|
| 67 |
INSTRUCTIONS:
|
| 68 |
WORD COUNT: 1000 to 1500
|