以下是关于如何写给 Claude 的 prompts 的相关内容:
A prompt is the text that you give Claude to elicit,or"prompt,"a relevant output.A prompt is usually in the form of a question or instructions.For example:提示是您给Claude的文本,用于引发相关输出。提示通常以问题或指示的形式出现。例如:|Role|Prompt||-|-||User|Why is the sky blue?<br>为什么天空是蓝色的?|The text that Claude responds with is called a"response",sometimes also called an"output"or"completion."Claude回答的文本被称为“响应”,有时也被称为“输出”或“完成”。|Role|Response||-|-||Assistant|The sky appears blue to us due to how the molecules in the air scatter light from the sun.The shorter wavelength light(blue)scatters more easily than the longer wavelength light(like reds and yellows),so when we look up at the sky,what we see is all the scattered blue light.This is known as Rayleigh scattering.The color of the sky varies based on conditions like the angle of the sun and amount of dust/water in the air,but during the day with a clear sky,the blue wavelength of light is most responsible for the color we perceive.<br>对我们来说,天空呈现蓝色是由于大气分子散射来自太阳的光线。较短波长的光(蓝色)比较长波长的光(如红色和黄色)更容易散射,因此当我们抬头望天空时,看到的是散射的蓝色光线。这被称为瑞利散射。天空的颜色会随着太阳角度和空气中灰尘/水的含量等条件而变化,但在白天晴朗的天空中,蓝色光波长最负责我们所感知的颜色。|
接下来,我们直接用Lisp来构建prompt,让Claude直接根据用户输入的领域和产品(也可自定义我们的产品特点),直接输出情绪营销语句~用Lisp这种编程语言是之前prompt圈李继刚刚哥带火了一波,使用下来更为凝练和简洁。当然,用我们一直倡导的Markdown的格式来写prompt的效果是一样的~[heading3]Lisp格式prompt(Claude专用)[heading3]Markdown格式prompt(GPT/国内大模型可用)@TODO待优化[content]备注:GPT等模型在卡片生成这步需要进行一些调整,不稳定。最好自定义html/css样式来进行强约束。[heading3]极简版输出(GPT o1系列,一步步思考推理)[heading2]打开Claude进行初始化[content]直接打开Claude首页,把上述提示词发送。初始化完成,接下来就可以直接进行使用~
One of the simplest ways to control Claude's output is to simply state the format you want.Claude can understand and follow instructions related to formatting,and format outputs such as:控制Claude输出的最简单方法之一是简单地说明您想要的格式。Claude可以理解并遵循与格式相关的指示,并格式化输出,例如:JSONXMLHTMLMarkdownCSVCustom formats自定义格式For example,if you want Claude to generate a haiku in JSON format,you can use a prompt like this:例如,如果你想让Claude以JSON格式生成一首俳句,你可以使用这样的提示:|Role|Content||-|-||User|Please write a haiku about a cat.Use JSON format with the keys"first_line","second_line",and"third_line".<br>请写一首关于猫的俳句。使用JSON格式,包括键"first_line"、"second_line"和"third_line"。||Assistant(Claude's response)<br>助手(克劳德的回答)|{<br>"first_line":"Soft furry feline",<br>first_line":"柔软毛茸茸的猫<br>"second_line":"Napping in the warm sunlight",<br>"second_line":"在温暖的阳光下打盹",<br>"third_line":"Purring contentedly"<br>third_line":"满足地咕噜着<br>}|