Zakariyya / blog

https://zakariyya.github.io/blog/
6 stars 1 forks source link

gpt、llama 提示词 #174

Open Zakariyya opened 1 month ago

Zakariyya commented 1 month ago

example 2,asking for output in a specified format

prompt_2=f"""

Your task is to perform the following actions: 1 - Summarize the followinggtextdelimited by<>with 1 sentence. 2 - Translate the summary into French. 3 - List each name in the French summary. 4 - Output a json object that contains thefollowing keys: french_summary,num_names.

Use the following format: Text: smmary:

Translation: Names: Output JSoN:

Text to summarize:<{text}> """

response = get_completion(prompt_2) print("\nCompletion for prompt 2:") print(response)